diff --git a/.github/workflows/fortran.yml b/.github/workflows/fortran.yml
index 40e46d0f..15d96379 100644
--- a/.github/workflows/fortran.yml
+++ b/.github/workflows/fortran.yml
@@ -85,10 +85,23 @@ jobs:
# at once, so each runs single-threaded: OpenMP and OpenBLAS would otherwise start a
# thread per core in every test and oversubscribe the runner. Tests that check
# threading set their own thread counts.
+ #
+ # A pull request runs the Debug tier without the tests labelled slow (the long lazy-wave,
+ # mooring and statics campaigns) or debug_long (tests over about 200 CPU-s at -O0, listed in
+ # CMakeLists.txt): the -O0 faults this tier exists for live in code the remaining tests
+ # reach, and the skipped tests still run in Release on both platforms and on the Prescott
+ # kernel. Every push to dev
+ # and main runs the full suite at -O0, so each merge is hardened without holding the PR.
env:
OMP_NUM_THREADS: "1"
OPENBLAS_NUM_THREADS: "1"
- run: ctest --test-dir build --output-on-failure --parallel 4
+ FAST_DEBUG: ${{ matrix.build_type == 'Debug' && github.event_name == 'pull_request' }}
+ run: |
+ if [ "$FAST_DEBUG" = "true" ]; then
+ ctest --test-dir build --output-on-failure --parallel 4 -LE 'slow|debug_long'
+ else
+ ctest --test-dir build --output-on-failure --parallel 4
+ fi
# Round-off fragility: a result that depends on the BLAS kernel fails here although every
# job above, on the runner's own kernel, passes. Prescott, an SSE3 kernel of the conda-forge
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1b8be549..838c3f59 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,360 @@ All notable changes to CableDyn are recorded in this file. The format follows
## [Unreleased]
+## [0.4.3] - 2026-11-20
+
+### 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
+ station channels at a small step the record is a large share of the module's output cost.
+ Retries, rewinds and restarts keep the row grid; OpenFAST's own channels follow `DT_Out` as
+ before.
+- Stochastic VIV band centre: an optional `VIV STOCHASTIC` section, rows `TypeName sigma c
+ [Nf [seed]]`, makes the centre `cF` of a line type's synchronisation band the slowly varying
+ random process of Ulveseter et al. (2017): `Nf` (default 100) sinusoids of a flat spectrum up to
+ `c` times `cF` with standard deviation `sigma`, each advancing at its non-dimensional frequency
+ times `U/D` as the shedding phase does, from start phases the seed fixes per node and line (the
+ nodes independent). On `EI = 0` lines and finite-EI cables, standalone and coupled, with or
+ without in-line VIV. The node's travelled distance `integral U/D dt` is the one new state (step
+ recovery, snapshots, checkpoints); a run repeats its realisation, `sigma` 0 leaves runs unchanged
+ to the bit. With the article's NDP values the process has the mean `cF` to 2e-6 and the standard
+ deviation `sigma` to four digits.
+- Rayleigh damping of finite-EI cables: the LINE TYPES EI column takes `EI|-zeta|f1|f2`, the
+ damping ratio `zeta` at the two frequencies `f1` and `f2` [Hz]. Beside the bending damping
+ `Bb = zeta EI/(pi (f1 + f2))` it adds a mass-proportional transverse damping
+ `alpha = 4 pi zeta f1 f2/(f1 + f2)` [1/s], the force `alpha m` on the velocity normal to the
+ tangent, so a mode has `zeta(omega) = alpha/(2 omega) + omega Bb/(2 EI)` times its bending share
+ for `Bb`: `zeta` at `f1` and `f2` and less between them. Free decays of modes 1 to 3 of a pinned
+ cable match this to 0.06 %. The velocity is absolute, so rigid transverse and pendulum motion is
+ damped as well (more below `f1`). No new state; exact Jacobians; the work is in `DampPow`; the
+ Python deck reader and builder take the form. Existing decks give bit-identical outputs.
+- A finite-EI line may end on a `Free` point: the line's free End B, its position free in the
+ static equilibrium and the dynamics, with the point's Mass/Vol/CdA/Ca acting on the end node as
+ an attachment (a free-hanging cable or riser with a clump). The static solve holds the end on
+ the stretched chord first and then releases it; `Point
p…` channels read the end node.
+ Standalone decks of finite-EI lines without bodies, rods or Connect points, every Free point
+ such an end (pinned in bending at both ends, net heavy, from a Coupled/Vessel End A; a torsion
+ restraint at one end is noted and not solved); any other deck,
+ and host-driven decks, keep their behaviour. The Python deck reader takes the same rule.
+- Bending damping of finite-EI cables: the LINE TYPES EI column takes `EI|Bb`, a Kelvin-Voigt
+ damping moment `Bb` [N m^2 s] times the curvature rate (in the frame carried with the tangent),
+ or `EI|-zeta|f`, the damping ratio of a pure bending mode of frequency `f` (Bb = zeta EI/(pi f)).
+ A mode is damped in its bending share, `omega Bb/(2 EI) * EI k^2/(EI k^2 + T)`; free decays of a
+ pinned cable match this to 0.05 %. It acts on every dynamic route beside the axial (`BA`) and
+ torsional (`GJ|K|Bt`) damping, with exact Jacobians; the Python deck reader and builder take the
+ same forms.
+- In-line VIV: an optional `VIV` section row `TypeName ClX [alpha]` adds the
+ in-line vortex-shedding force of Ulveseter et al. (2018), `1/2 rho D ClX cos(phi_x) U v_n` along
+ the relative flow, with its phase slaved to twice the cross-flow one in a band `alpha` (default
+ 0.15). On the taut line of `examples/viv_taut_cable_inline.dat` the in-line response runs at
+ twice the cross-flow frequency, A/D 0.19 against 0.03 with the lift alone, on `EI = 0` lines and
+ finite-EI cables alike (within 1 % of each other). Exact Jacobians; the phase is in the
+ step-recovery, snapshot and checkpoint state; the Python deck reader and builder take the
+ section.
+- The higher-harmonic VIV force of Ulveseter et al. (2019): a fourth `VIV` section column `Chh`
+ adds `1/2 rho D Chh cos(phi + phi_x) U (t x v_n)`, the lift's form at the sum of the cross-flow
+ and in-line phases, on `EI = 0` lines and finite-EI cables. On the in-line example `Chh` 1.0
+ raises the quarter-span in-line response at four times the cross-flow frequency fourfold. The
+ Python deck reader and builder take the column.
+- The cross-flow VIV columns `Cl [dF cF]` may follow the 14-column finite-EI `LINE TYPES` row
+ (15 or 17 columns), so a line restrained in torsion can carry VIV; such a row free in torsion
+ runs as the 13-column one. The Python deck reader and builder take it.
+- Wake-oscillator VIV: an optional `WAKE OSCILLATOR` section row `TypeName CL0 [St [eps [A]]]`
+ replaces the synchronisation lift of a type (which keeps `Cl` 0) by the van der Pol wake
+ oscillator of Facchinetti et al. (2004) with acceleration coupling (defaults St 0.2, eps 0.3,
+ A 12), distributed along finite-EI cables and at the nodes of `EI = 0` lines, standalone and
+ coupled. The kernel follows the
+ published forced-wake lift magnification within 2 %; on the taut example cable the wake locks
+ the cable in at its first mode (A/D 0.58 against 0.10 uncoupled) and the drag and damping take
+ out the wake lift's power within 0.3 %; the same line with `EI = 0` locks in within 0.1 % of
+ the cable's A/D, at a frequency 0.001 Hz from it. Its state is in the step-recovery, snapshot and
+ checkpoint state (on an `EI = 0` line, in the slots of the VIV phase and first motion
+ statistic); the Python deck reader and builder take the section.
+- Amplitude-dependent VIV coefficients: an optional `VIV AMPLITUDE` section, rows
+ `TypeName AD Cv [CdAmp]`, gives a line type a table over the cross-flow amplitude ratio of the
+ coefficient `Cv` that replaces its `Cl` and a factor `CdAmp` of its normal drag coefficient, read
+ at the amplitude estimate of Thorsen et al. (2016, Eq. 8 and 9) of each node, on `EI = 0` lines
+ and finite-EI cables, standalone and coupled. `VIVAmpN` writes the estimate. On the taut
+ example line it follows the steady response amplitude within 0.04 % (0.1 % on an `EI = 0`
+ line), a falling `Cv` limits the response inside its falling range, and a table with
+ `Cv = Cl` and `CdAmp = 1` is the line without it, bit for bit. The estimate is in the step-recovery, snapshot and checkpoint state;
+ the Python deck reader and builder take the section.
+- Cross-flow damping: an optional `VIV DAMPING` section row `TypeName a b [c]` splits the drag
+ of a finite-EI line type about the ambient normal flow: Morison's drag in line, and across it
+ the hydrodynamic damping `C_dy = a + b y0/D` of Thorsen et al. (2016) (Eq. 1, `0.31 0.89`) at
+ the `VIV AMPLITUDE` estimate `y0`, plus a Morison-form term `c Cdn |w| w_y`, blended to
+ Morison's drag in still water, with exact Jacobians. `0 0 1` is Morison's drag
+ with the `CdAmp` drag factor on the in-line part alone (the cross-flow VIV motion is not
+ damped twice); the quadratic form of Thorsen et al. suits cross-flow-only VIV models. Needs a
+ `VIV AMPLITUDE` table; `EI = 0` lines refused; the Python deck reader and builder take the
+ section.
+- VIV diameter: an optional `VIV DIAMETER` section row `TypeName Dviv` gives the VIV model of a
+ line type (shedding frequency, wake frequency and coupling, VIV forces, amplitude ratio) a
+ diameter apart from the `Diam` its drag, added mass and buoyancy keep, for buoyancy-module zones
+ with ATTACHMENTS, on `EI = 0` lines and finite-EI cables, standalone and coupled. `Dviv` equal to
+ `Diam` is the type without it, bit for bit; the Python deck reader and builder take the section.
+- Load power channels `VIVPow`, `DragPow` and `DampPow` [W], and `N` per
+ unit length about a node [W/m]: the power the VIV loads, the drag and the structural damping
+ (`BA`, `Bb`) deliver to a line at the committed state, on `EI = 0` lines and finite-EI cables,
+ standalone and coupled. Their work closes a cable's energy balance to 0.04 % in free decays
+ and VIV runs, and on the locked-in line of `examples/viv_taut_cable_inline.dat` their means
+ balance within 0.5 % of the VIV power.
+- `cabledyn.viv_response`: the VIV response of a line from its node positions, in the local flow
+ frame of every node: cross-flow and in-line amplitude along the span, the response
+ frequencies and `f D/U_n`, modal weights (taut-line sines or given shapes), the complex shape
+ and its travelling-wave index (Feeny 2008), orbits and the in-line/cross-flow phase
+ difference, with a CSV export and plots.
+- `cabledyn.section_stress` and `damage_along_arc(..., quantity="section")`: the axial stress at
+ points around the section from the tension and the curvature vector on the section axes
+ (`CurvX`/`CurvY`), `T/A - E r (kappa_x cos theta + kappa_y sin theta)`, counted point by point
+ for the fatigue of biaxial bending; a whirling section, which the two-fibre recovery from the
+ curvature magnitude sees as constant, now accumulates its damage.
+- `cabledyn.current_steps`: a stepped-current schedule for a VIV study in one run (each speed
+ held, then ramped to the next), written as the deck's MoorDyn-C `Currents 2` file, with the
+ VIV response of every hold.
+- Validation case L3-C (`validation/experiments/chaplin`): the still-water natural frequencies of
+ the Delta Flume vertical riser of Chaplin et al. (2005), modes 1-7 at five top tensions, from
+ CableDyn's modal analysis with no fitted parameter: 1.87 % high on average over 34 of the 35
+ measured values (largest 4.88 %), the 35th, an outlier in the measurements, reported apart.
+- Validation case L3-W (`validation/experiments/wang_scr`): cross-flow VIV of the SJTU truncated
+ steel catenary riser of Wang et al. (2014) in a 0.2 m/s uniform current, with the coefficient set
+ Thorsen et al. (2017) use for it: dominant strain frequency 0.992 Hz against the measured
+ 1.00 Hz, largest r.m.s. strain 7.3 % above the measured largest, station mean 3.6 % above;
+ converged in mesh and time step to 0.2 %.
+- Validation case L3-D (`validation/experiments/delta_flume`): cross-flow and in-line VIV of the
+ Delta Flume riser in the nine blind-trial stepped-current cases of Chaplin et al. (2005b), with
+ one generic coefficient set and the drag amplification on the in-line drag alone, against the
+ experimenters' measured envelopes and summaries: dominant mode right in 5 of 9 and within one in
+ all, mean in-line displacement within 17 % in 7 of 9, cross-flow amplitude −45 % to +4 %.
+- Validation case L3-N (`validation/experiments/ndp_riser`): cross-flow VIV of the NDP 38 m
+ high-mode riser of Trim et al. (2005) at its 22 uniform-flow tow speeds, with four coefficient
+ sets against the measured maximum r.m.s. cross-flow strain (Thorsen et al. 2016, Fig. 8), the
+ dominant frequency and σ/D: the set Ulveseter et al. (2019) fitted to these tests matches strain
+ (r.m.s. log error 0.178), frequency and amplitude together; Andersen et al.'s (2024b)
+ sheared-flow average 0.186; the generic set, blind, 0.277.
+- Validation case L3-F (`validation/experiments/flotant`): VIV of the FLOTANT OD 48 mm
+ power-cable specimen of de Wilde et al. (2021) with its 200 kg clump weight at the 40 tow
+ speeds, cross-flow and in-line A/D_rms at three stations, with three published coefficient
+ sets none of which is fitted to these tests, on a structure identified from the specimen's
+ in-air and in-water RAOs. The set of Ulveseter et al. (2019) gives the first cross-flow peak
+ (0.755 against 0.776 at mid-length) but responds from a lower speed and releases 1.2 Ur late
+ (cross-flow r.m.s. log error 0.731); the generic set is 38 % low at the peak and releases at
+ the measured speed (0.594); the wake oscillator of Facchinetti et al. (2004) is 62 % low
+ (1.208).
+- Validation case L3-Wh (`validation/experiments/wang_scr`): heave-induced cross-flow VIV of
+ the L3-W riser in still water, its upper end moved along the measured top trajectory of
+ Thorsen et al. (2017, period 5.96 s), with their coefficient set, the strain band-passed as
+ Wang et al. (2014) process it. Without a `VIV FRAME` row the dominant frequency is 1.019 Hz
+ (measured close to 1 Hz), the largest r.m.s. strain 20.8 % above the measured largest and the
+ lower half of the span 1.71 times the measured on average (Thorsen et al.'s model 5.6 % and
+ 1.44). The heave period is about 6 VIV periods, below the `VIV FRAME` scale separation, and the
+ result depends on `Tf` (0.35–1 s): the response falls on a 1.01–1.02 Hz or a 0.88–0.89 Hz
+ branch, reported as a sensitivity. The case's script is now `wang_scr_viv.py` for both parts
+ (it replaces `wang_scr_uniform_current.py`; the L3-W numbers are unchanged), and its data,
+ including Thorsen et al.'s simulated lines, are read by `extract_thorsen2017.py`.
+- Validation case L3-O (`validation/experiments/fu_oscillatory`): cross-flow VIV of the SJTU
+ flexible cylinder of Fu et al. (2014) moved harmonically through still water (KC 178, U_R,max 4,
+ 6.5 and 7.9), A/D at mid-span on the acceleration and deceleration paths against the measured
+ paths of their Figs. 15-17 (read from the figures by `extract_fu2014.py`), with three published
+ coefficient sets and a `VIV FRAME` row. Every run converges through the flow reversals. At
+ U_R,max 4 the wake oscillator gives the measured largest A/D (0.280 against 0.286); at 6.5 and
+ 7.9 every set holds the lock-in while the flow slows, the gap between the paths 2-5 times the
+ measured one and the largest A/D 1.3-2.3 times the measured.
+- Validation case L3-K (`validation/experiments/chaplin_catenary`): cross-flow VIV of the
+ untensioned catenary model riser of Chaplin & King (2018), 5.36 m long with EI 1.3 N m² and
+ floor touchdown, at both mass ratios in current of 0.2–1.4 m/s in both directions, with three
+ published coefficient sets none of which is fitted to these tests, against the measured mean
+ top tension, cross-flow frequencies and straight-part inclination (read from the article's
+ figures by `extract_chaplin2018.py`). Every set gives the measured single frequency along the
+ span in positive current, at f d/U 0.121 (Ulveseter et al. 2019), 0.138 (generic set) and
+ 0.17 (wake oscillator) against 0.111; the generic set's drag amplification gives the light
+ riser's tension rise (9.8 % r.m.s.) and the heavy riser's inclination in negative current
+ (5.0° r.m.s.). The heavy riser's still-water tension is 37 % above the measured with the
+ article's geometry, reported as a caveat of the data.
+- Theory manual, Published coefficient sets: the VIV coefficient sets of Thorsen et al. (2016,
+ 2017), Ulveseter et al. (2018), Andersen et al. (2024a, b) and Facchinetti et al. (2004), each
+ with its source, its test data and the line-type columns it maps to, and Thorsen et al.'s
+ excitation curve as a `VIV AMPLITUDE` table.
+
+- Wake oscillator for moving cables: an optional `VIV FRAME` section, rows `TypeName Tf`, takes
+ the free stream of a line type's VIV model relative to the cable's velocity low-pass filtered
+ over `Tf` [s] (first order). The wake frequency then follows a cable towed or moved by its
+ floater through still water, which the ambient flow alone never made shed. A taut cable towed
+ at 0.15 m/s with `Tf` 10 s locks in as the cable held in a 0.15 m/s current (A/D within
+ 0.6 %); on a held cable `Tf` changes A/D by 0.03 %. On `EI = 0` lines and finite-EI cables,
+ the filtered velocity in the step-recovery, snapshot and checkpoint state; `Tf` 0 or no row
+ leaves runs unchanged to the bit. The Python deck reader and builder (`viv_frame_tf`) take the
+ section.
+
+- The `VIV FRAME` section on the synchronisation model (LINE TYPES `Cl > 0`): `Tf > 0` takes the
+ cable's filtered velocity as the frame of the cross-flow and in-line phases (the node's
+ velocity relative to it; the shedding speed stays the relative normal speed), of the amplitude
+ estimate (and so `Cv` and `CdAmp`) and of the axes and blend of the `VIV DAMPING` split. A cable
+ moved through still water had a phase input of zero cross-flow velocity, `y0 = 0`, `Cv(0)`,
+ `CdAmp(0)` and Morison's drag. A pipe moved at 0.6 m/s amplitude and 40 s period in still water
+ now gives peak A/D 0.811 against 0.818 for the same pipe held in the moving water with the
+ amplitude table and damping (0.700 against 0.851 without the row), and 0.713 against 0.712 with
+ the lift alone (0.700 against 0.733); a cable towed at 0.15 m/s gives the A/D of the cable held
+ in the current with the same row within 0.02 %. On `EI = 0` lines and finite-EI cables, the
+ filtered velocity in rows 7-9 of the VIV motion statistics, so in the step-recovery, snapshot
+ and checkpoint state; `Tf` 0 or no row leaves runs unchanged to the bit. A VIV FRAME row now
+ needs LINE TYPES `Cl > 0` or a WAKE OSCILLATOR row; the Python deck reader and builder follow.
+
+- A long-run check of the VIV synchronisation model (`viv_long_run`, 400 cycles). With every node
+ of a finite-EI cable moved across the flow, the shedding phase follows the closed-form solution
+ of its equation (Adler's) with an error that grows linearly in time and falls fourfold per
+ halving of the step: 0.017 rad after 400 cycles at 100 steps per cycle; inside the
+ synchronisation band the phase lag holds to 3e-5 rad. On a taut line locked in, finite-EI and
+ `EI = 0`, the load powers close the line's energy balance to 2e-4 of the VIV work at second
+ order, and the response amplitude, VIV power and lock-in frequency of the run's two halves agree
+ within 0.18 %.
+
+### Changed
+
+- `run_study` (and `cabledyn-study`) with `jobs > 1` runs every case with `OMP_NUM_THREADS=1`
+ unless the environment sets it, and `study.json` records the value (`omp_num_threads`). Many
+ processes that each start an OpenMP team oversubscribed the cores: 24 lazy-wave runs at 24 jobs
+ took 19.1 s with the OpenMP default and 16.7 s with one thread each. The Python manual gives the
+ measured batch scaling (13.3 times faster at 24 jobs on a 24-core workstation, 15.1 at 48).
+- The load power channels (`VIVPow`, `DragPow`, `DampPow` and their per-length forms) of a line
+ evaluate its node powers once per output row instead of once per channel, on finite-EI cables,
+ `EI = 0` lines and line systems. Outputs are unchanged to the bit; with the three line totals
+ the VIV examples run about 11 % faster (`viv_taut_cable_inline.dat` 2.39 s to 2.14 s; the same
+ line with 200 elements at 100 steps per cycle 18.1 s to 16.1 s).
+- The output channels of one row evaluate the line-wide values a finite-EI cable's channels
+ share once per row instead of once per channel: the element twists and torsion state behind
+ every `TwistN`, the node torques of `TorqN`, the section curvature of
+ `CurvX`/`CurvY` and the VIV amplitude. This applies to every `CalcOutput` of the OpenFAST
+ module (`CompMooring = 5`) and FAST.Farm, their committed-step `.CD.out` row and
+ linearization, and to the standalone mixed, multibody and cubic-Hermite routes. A supercycled
+ module's `.CD.out` row also takes the channels the same call has just evaluated on the
+ committed state. Outputs, `.CD.out`, linearization files and restarts are unchanged to the
+ bit. On the IEA-15MW UMaine model with the three chains and a 600-element lazy-wave cable
+ restrained in torsion (nine `Twist` and nine `BendMom` channels, `DT = 0.01 s`), `CalcOutput`
+ takes 12.3 ms per step instead of 26.6 ms (the channels 1.0 ms instead of 9.9 ms, the `.CD.out`
+ row 0.6 ms instead of 5.1 ms), and CableDyn as a whole 26 ms instead of 42 ms.
+- `CalcOutput` of the OpenFAST module is cheaper for a finite-EI cable with the nodal twist
+ (torsion with polar inertia `Irn`). Its fairlead force and the moment of a rigid end connection
+ come from the end element, as without torsion, instead of from an assembly of the whole line:
+ the nodal twist's element torques reach a node's rows only from the node's elements. The
+ transfer of the current fairlead kinematics before the evaluation no longer checks the twist of
+ every element twice ahead of the write, which checks it again (the module reloads its committed
+ state on any failure), and the restore after it leaves the cable to the reload of its committed
+ state, which rewrites the coupled end, its frames and the twist, instead of transferring the
+ committed kinematics first. Outputs, `.CD.out`, linearization files and restarts are unchanged
+ to the bit. On the IEA-15MW UMaine model with the three chains and a lazy-wave cable of 184
+ elements restrained in torsion (`DT = 0.025 s`), `CalcOutput` takes 1.9 ms per step instead of
+ 5.1 ms, and the run 26 minutes per simulated hour instead of 32.
+- The bending damping of a finite-EI cable (`EI|Bb`, `EI|-zeta|f`) evaluates the second
+ derivatives of the curvature only where the position Jacobian needs them, not in every residual
+ evaluation. Results are unchanged to the bit; the Delta Flume case 9 deck of
+ `validation/experiments/delta_flume` (64 elements, 80 000 steps) runs in 58.6 s instead of
+ 73.2 s.
+- The nodal twist of a finite-EI cable (torsion with polar inertia `Irn`) is cheaper to
+ evaluate. Its reference-twist and holonomy Hessians no longer call the run-time library for
+ small outer products and skew matrices, and they form only the solid-angle and intermediate
+ blocks that are read. A frame-only twist transfer (the OpenFAST output probe on every
+ `CalcOutput`, the checkpoint rebuild, linearization) re-bases only the elements at a rigid end
+ or at a turned node; the others keep their reference twist, which the evaluation would return
+ unchanged. Outputs, `.CD.out` and restarts are unchanged to the bit. On the IEA-15MW
+ VolturnUS-S with three chains and a lazy-wave power cable restrained in torsion (one thread),
+ simulation CPU per simulated hour fell from 36.5 to 32.5 min (241 elements, `DT = 0.02 s`)
+ and from 35.0 to 30.6 min (291 elements, `DT = 0.025 s`).
+
+### Fixed
+
+- The side a finite-EI line leaves its vertical plane to in an in-plane current past the
+ pitchfork (the grounded run turned sideways on the seabed) followed the line's heading, not
+ the line. The symmetry-breaking cross-flow was taken from the line's local frame, which is
+ the identity for any chord without a y component, so a chord along -x took it at +y (to its
+ right) and a chord a round-off away from -x at -y (to its left), and a deck rotated by 180
+ degrees about the vertical left to the same global side as the original. The cross-flow now
+ points to the left of the horizontal chord from the anchor (End B) to the fairlead (End A)
+ whatever its heading (+y for a vertical chord, as before), so the rotated deck reaches the
+ rotated equilibrium. A deck whose chord points exactly along -x and that reaches this branch
+ now leaves to the other side: the mirror image, with the same end forces. The statics matrix
+ checks the side of the deck and of its 180-degree rotation, and that a cross current of the
+ deck's own picks the side (mirror twins to 1e-6). The theory page states the rule.
+- The statics of a finite-EI line through the free surface could fail at isolated currents:
+ each Gauss point's hydrodynamic load switched on and off at the surface, so the residual
+ jumped and an equilibrium with a point at the waterline had no root (a light lazy-wave cable,
+ OD 31 mm, in a cross current solved at 0.399 and 0.401 m/s and failed every static route at
+ 0.400 m/s, the load stepping stopping at a drag fraction of 0.997). The drag, added mass, wave
+ Froude-Krylov load and VIV lift of a Gauss point now carry the immersed fraction of its
+ section, linear across one diameter about the surface, with its derivative in the Jacobians.
+ Fully submerged points are unchanged to the bit; the full test suite passes unchanged.
+- A buoyancy module (an `ATTACHMENTS` row) on a finite-EI line that floats had no static
+ position: its buoyancy switched off at its node's height, so its weight in air took it below
+ the surface and its weight in water above it, and the static start stopped with an error. Its
+ buoyancy, Froude-Krylov force and drag now carry the immersed fraction of the sphere of its
+ volume (of its drag area without one), as a Rigid6 body's buoyancy does, continuous with its
+ slope through the surface; the statics solve for it in each Newton iterate with its stiffness.
+ A 200 kg, 2 m^3 module on a slack cable now floats 0.35 m below the surface and holds that
+ height in the march, and rides 1.5 m waves. A module deeper than its sphere's radius is
+ unchanged to the bit. In deck waves a node above the instantaneous surface takes the wave
+ kinematics at the surface (they were zero there), as a cable's internal waves already did.
+- A finite-EI dynamic step at a small time step could fail on a line near rest: the Newton
+ residual stagnated just above the tolerance, and the step recovery's smaller steps only raised
+ it (a 13 m riser, 64 elements, at rest in a 0.95 m/s current, took the VIV lift at dtM
+ 1.25e-4 s and stopped at 1.06 times the tolerance; each 4-fold smaller substep raised the
+ stagnant residual about 16-fold, to 3.4e4 times the tolerance at 1024 substeps). The inertia
+ takes the acceleration `(q - q_n)/(beta dt^2) - ...` from coordinates stored to their last
+ bits, so its residual cannot be settled below about `eps sum_j |M_ij| |q_j| / (beta dt^2)`, a
+ floor that grows like `dt^-2` and, where the line's inertia sets no force scale, stands above
+ the tolerance. As on the `EI = 0` route, an iterate on that floor is now converged: when no
+ step length of a fresh Newton correction reduces the residual, the residual is below 1e-4 of
+ the force scale and the correction moves no free coordinate by more than `16 eps` times its
+ scale. A step that meets the tolerance is unchanged: every example and test deck gives
+ bit-identical outputs.
+- A finite-EI step could converge to a spurious root with every nodal tangent reversed, and the
+ march then failed: a taut 20 m line locked in by the VIV lift, seeded with unit tangents while
+ its elements were stretched by 7.6e-5, failed within 13 steps at `rho_inf` 0.8 to 1 at 25 and
+ 50 steps per VIV cycle (and without the lift too). The tangents' stretch is the line's stiffest
+ motion; with little numerical damping its seed offset rang on with a committed acceleration of
+ 4.9e3 1/s^2, and the constant-acceleration and Newmark guesses carried every tangent across
+ zero (by 3.4 and 1.7 of its length), from where Newton converged to the folded root (2.4e8 J of
+ strain energy against 3.5 J). A guess that changes the length of a free tangent by more than a
+ quarter now holds that tangent at its committed value, and a step that ends with a tangent
+ turned by 90 degrees or more fails, so the step recovery re-solves it. The line now runs at
+ `rho_inf` 0.5 to 1 and 25 and 50 steps per cycle, with the response of the same line seeded
+ at its stretch (largest A/D within 0.1 %, except at `rho_inf` 1 and 25 steps per cycle, where
+ the VIV response is resolution-sensitive; see the time-step entry below). Every other step
+ starts as before: every example and test deck gives bit-identical outputs.
+- A locked-in VIV response converged at first order in the time step, and at `rhoInf` 1 to a
+ wrong frequency: the phase of the synchronisation model (and the forcing of the wake
+ oscillator) sampled the generalised-alpha acceleration, which is the line's acceleration at
+ `t_n + (alpha_m - alpha_f) dt` only and at `rhoInf` 1 carries an undamped alternating mode of
+ the integrator. On a taut 20 m line locked in at 0.65 Hz the frequency changed 0.74 %, 0.41 %
+ and 0.27 % per halving of the step from 25 to 200 steps per cycle, and at `rhoInf` 1 it
+ converged 3.4 % low. The phase now advances by the implicit mid-point rule on the step's
+ mid-point motion, its velocity and acceleration the step means of the converged positions and
+ velocities, and the lift is predicted with the rate of the previous step's mid-point, a new row
+ of the VIV state (two with in-line VIV) carried by the step recovery, snapshots and checkpoints;
+ the running mean squares, the in-line phase, the flow frame's and the wake filter's filtered
+ velocities and the wake oscillator follow the same mid-point treatment. The response is now
+ second order at every `rhoInf` and does not depend on it (limits within 1e-9): the frequency
+ is low by about 2.2/n^2 to 3.4/n^2 at n steps per response period (doc/theory.rst; test
+ `viv_step_order`). The two VIV example decks change at their default `dtM` and move toward
+ their fine-step results (the cross-flow example's mid-span RMS from 0.31 % to 0.02 % off, its
+ frequency from 0.15 % to 0.018 %); every other example and test deck gives bit-identical
+ outputs. At `rhoInf` 1 from an unbalanced seed (tangent lengths not at the static stretch) the
+ response is resolution-sensitive below about 50 steps per cycle; keep `rhoInf` at or below 0.95
+ or seed at the stretch.
+
## [0.4.2] - 2026-11-09
### Added
@@ -83,6 +437,14 @@ All notable changes to CableDyn are recorded in this file. The format follows
### Fixed
+- A finite-EI dynamic step with bending damping (`EI|Bb`) could fail to converge on a soft line:
+ the Newton residual stagnated just above the tolerance (1.06 times it on a 20 m riser on a
+ 20 kN/m tensioner, EA_eff 4e5 N, 80 elements, Bb 500 N m^2 s, dt 1e-3 s, in VIV), and the
+ step recovery's smaller steps only made it worse. The bending damping takes the curvature rate
+ from the Newmark velocity, so its forces round at about `Bb gamma/(beta dt) eps |r|/l0^3`,
+ which the tolerance's round-off floor (the axial forces' `(EA + BA gamma/(beta dt)) eps
+ |r|/l0`) did not cover. The floor now takes the bending forces, `(EI + Bb gamma/(beta dt))
+ eps |r|/l0^3`, as well; it binds only where that term is the larger.
- Finite-EI node tension, curvature and bend moment next to the touchdown point: the floor
reaction of the first grounded node was spread over its grounded half-element alone, wherever
the touchdown point lay in the touchdown element. The local tension error there fell only at
@@ -1050,7 +1412,8 @@ Corrections made during the pre-release review.
values of the shipped example decks and states which tension (end element or
`FairTen` end force) each comparison uses.
-[Unreleased]: https://github.com/SMI-Lab-Inha/CableDyn/compare/v0.4.2...HEAD
+[Unreleased]: https://github.com/SMI-Lab-Inha/CableDyn/compare/v0.4.3...HEAD
+[0.4.3]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.4.3
[0.4.2]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.4.2
[0.4.1]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.4.1
[0.4.0]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.4.0
diff --git a/CITATION.cff b/CITATION.cff
index a34cf73c..69442422 100644
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -23,8 +23,8 @@ authors:
repository-code: "https://github.com/SMI-Lab-Inha/CableDyn"
url: "https://github.com/SMI-Lab-Inha/CableDyn"
license: Apache-2.0
-version: 0.4.2
-date-released: 2026-11-09
+version: 0.4.3
+date-released: 2026-11-20
keywords:
- mooring dynamics
- cable dynamics
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d92bc8ce..ddbfa291 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@
#
cmake_minimum_required(VERSION 3.20)
# VERSION is a bare numeric triple matching the release version.
-project(CableDynCore VERSION 0.4.2 LANGUAGES C Fortran
+project(CableDynCore VERSION 0.4.3 LANGUAGES C Fortran
DESCRIPTION "CableDyn geometrically exact cable/mooring solver — Fortran core")
option(CABLEDYN_ENABLE_COVERAGE "Instrument the GNU Fortran core for gcov/gcovr source coverage" OFF)
@@ -766,6 +766,27 @@ add_executable(test_hermite_axial_damping tests/test_hermite_axial_damping.f90)
target_link_libraries(test_hermite_axial_damping PRIVATE cabledyn_core)
add_test(NAME hermite_axial_damping COMMAND test_hermite_axial_damping)
set_tests_properties(hermite_axial_damping PROPERTIES LABELS "fortran;unit;dynamic;damping")
+add_executable(test_hermite_bending_damping tests/test_hermite_bending_damping.f90)
+target_link_libraries(test_hermite_bending_damping PRIVATE cabledyn_core)
+add_test(NAME hermite_bending_damping COMMAND test_hermite_bending_damping)
+set_tests_properties(hermite_bending_damping PROPERTIES LABELS "fortran;unit;damping")
+add_executable(test_hermite_bending_damping_dynamic tests/test_hermite_bending_damping_dynamic.f90)
+target_link_libraries(test_hermite_bending_damping_dynamic PRIVATE cabledyn_core)
+add_test(NAME hermite_bending_damping_dynamic COMMAND test_hermite_bending_damping_dynamic)
+set_tests_properties(hermite_bending_damping_dynamic PROPERTIES LABELS "fortran;unit;dynamic;damping")
+add_executable(test_hermite_mass_damping tests/test_hermite_mass_damping.f90)
+target_link_libraries(test_hermite_mass_damping PRIVATE cabledyn_core)
+add_test(NAME hermite_mass_damping COMMAND test_hermite_mass_damping)
+set_tests_properties(hermite_mass_damping PROPERTIES LABELS "fortran;unit;damping")
+add_executable(test_hermite_mass_damping_dynamic tests/test_hermite_mass_damping_dynamic.f90)
+target_link_libraries(test_hermite_mass_damping_dynamic PRIVATE cabledyn_core)
+add_test(NAME hermite_mass_damping_dynamic COMMAND test_hermite_mass_damping_dynamic)
+set_tests_properties(hermite_mass_damping_dynamic PROPERTIES LABELS "fortran;unit;dynamic;damping")
+# Bending damping on a deck (EI|Bb, EI|-zeta|f, EI|-zeta|f1|f2): resolution, effect and refusals end to end.
+add_executable(test_bending_damping_deck tests/test_bending_damping_deck.f90)
+target_link_libraries(test_bending_damping_deck PRIVATE cabledyn_core)
+add_test(NAME bending_damping_deck COMMAND test_bending_damping_deck)
+set_tests_properties(bending_damping_deck PROPERTIES LABELS "fortran;driver;integration;dynamic;damping")
# Active line control of a finite-EI cable: the length update rebuilds the caches a fresh
# build carries (bit for bit), is atomic and rewinds exactly; hanging, taut and paid-out
@@ -1303,11 +1324,145 @@ 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.
+add_executable(test_viv_step_order tests/test_viv_step_order.f90)
+target_link_libraries(test_viv_step_order PRIVATE cabledyn_core)
+add_test(NAME viv_step_order COMMAND test_viv_step_order)
+set_tests_properties(viv_step_order PROPERTIES LABELS "fortran;integration;dynamic;viv" TIMEOUT 1200)
+
+# Wake-oscillator kernel (Facchinetti et al. 2004): the free limit cycle, the forced lift
+# magnification of their Eq. 17, and the sub-stepped Runge-Kutta advance.
+add_executable(test_viv_wake_kernel tests/test_viv_wake_kernel.f90)
+target_link_libraries(test_viv_wake_kernel PRIVATE cabledyn_core)
+add_test(NAME viv_wake_kernel COMMAND test_viv_wake_kernel)
+set_tests_properties(viv_wake_kernel PROPERTIES LABELS "fortran;unit;dynamic;viv")
+
+# Wake-oscillator VIV on a deck: lock-in against the uncoupled wake, the power balance, CL0 0 as no
+# section, and the refusals of the WAKE OSCILLATOR section.
+add_executable(test_viv_wake_deck tests/test_viv_wake_deck.f90)
+target_link_libraries(test_viv_wake_deck PRIVATE cabledyn_core)
+add_test(NAME viv_wake_deck COMMAND test_viv_wake_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(viv_wake_deck PROPERTIES LABELS "fortran;integration;dynamic;viv" TIMEOUT 1200)
+add_executable(test_static_surface_crossing tests/test_static_surface_crossing.f90)
+target_link_libraries(test_static_surface_crossing PRIVATE cabledyn_core)
+add_test(NAME static_surface_crossing COMMAND test_static_surface_crossing WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(static_surface_crossing PROPERTIES LABELS "fortran;integration;static" TIMEOUT 600)
+add_executable(test_attachment_surface tests/test_attachment_surface.f90)
+target_link_libraries(test_attachment_surface PRIVATE cabledyn_core)
+add_test(NAME attachment_surface COMMAND test_attachment_surface)
+set_tests_properties(attachment_surface PROPERTIES LABELS "fortran;unit;static")
+
+# VIV amplitude estimate (Thorsen et al. 2016, Eq. 8 and 9) and the amplitude tables.
+add_executable(test_viv_amplitude_kernel tests/test_viv_amplitude_kernel.f90)
+target_link_libraries(test_viv_amplitude_kernel PRIVATE cabledyn_core)
+add_test(NAME viv_amplitude_kernel COMMAND test_viv_amplitude_kernel)
+set_tests_properties(viv_amplitude_kernel PROPERTIES LABELS "fortran;unit;dynamic;viv")
+
+# The split cross-flow drag of Thorsen et al. (2016) per unit length: Morison at rest, the
+# quadratic cross-flow damping across the flow, Morison without ambient flow, exact Jacobians.
+add_executable(test_viv_cf_damping_kernel tests/test_viv_cf_damping_kernel.f90)
+target_link_libraries(test_viv_cf_damping_kernel PRIVATE cabledyn_core)
+add_test(NAME viv_cf_damping_kernel COMMAND test_viv_cf_damping_kernel)
+set_tests_properties(viv_cf_damping_kernel PROPERTIES LABELS "fortran;unit;dynamic;viv")
+# The split drag on a deck (VIV DAMPING section): Morison recombined, the in-line drag alone
+# amplified, Thorsen's quadratic cross-flow damping, the energy ledger and the refusals.
+add_executable(test_viv_cf_damping_deck tests/test_viv_cf_damping_deck.f90)
+target_link_libraries(test_viv_cf_damping_deck PRIVATE cabledyn_core)
+add_test(NAME viv_cf_damping_deck COMMAND test_viv_cf_damping_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(viv_cf_damping_deck PROPERTIES LABELS "fortran;integration;dynamic;viv;driver")
+# The flow frame (VIV FRAME section) of the synchronisation model on a deck: a Tf 0 row as no
+# section, a cable towed through still water against the same cable held in a current, the frame
+# leaving the held cable's response on both cores, and the refusals.
+add_executable(test_viv_frame_deck tests/test_viv_frame_deck.f90)
+target_link_libraries(test_viv_frame_deck PRIVATE cabledyn_core)
+add_test(NAME viv_frame_deck COMMAND test_viv_frame_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(viv_frame_deck PROPERTIES LABELS "fortran;integration;dynamic;viv;driver")
+# The VIV STOCHASTIC section (the stochastic band centre of Ulveseter et al. 2017): the process's
+# mean, standard deviation, near-Gaussian shape and seeded phases; a sigma 0 row bit-identical to
+# none, a seeded run repeatable and locked in, on both cores; and the refusals.
+add_executable(test_viv_stochastic tests/test_viv_stochastic.f90)
+target_link_libraries(test_viv_stochastic PRIVATE cabledyn_core)
+add_test(NAME viv_stochastic COMMAND test_viv_stochastic WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(viv_stochastic PROPERTIES LABELS "fortran;integration;dynamic;viv;driver")
+
+# Amplitude-dependent VIV coefficients on a deck (VIV AMPLITUDE section), both line kinds: the
+# identity table, the amplitude channel against the response, self-limiting, drag amplification
+# and the refusals.
+add_executable(test_viv_amplitude_deck tests/test_viv_amplitude_deck.f90)
+target_link_libraries(test_viv_amplitude_deck PRIVATE cabledyn_core)
+add_test(NAME viv_amplitude_deck COMMAND test_viv_amplitude_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(viv_amplitude_deck PROPERTIES LABELS "fortran;integration;dynamic;viv" TIMEOUT 1200)
+
+# The diameter of the VIV model on a deck (VIV DIAMETER section), both line kinds: Dviv = Diam as
+# no section, the shedding band and the uncoupled wake frequency following Dviv, and the refusals.
+add_executable(test_viv_diameter_deck tests/test_viv_diameter_deck.f90)
+target_link_libraries(test_viv_diameter_deck PRIVATE cabledyn_core)
+add_test(NAME viv_diameter_deck COMMAND test_viv_diameter_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+add_executable(test_free_end_deck tests/test_free_end_deck.f90)
+target_link_libraries(test_free_end_deck PRIVATE cabledyn_core)
+add_test(NAME free_end_deck COMMAND test_free_end_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(viv_diameter_deck PROPERTIES LABELS "fortran;integration;dynamic;viv" TIMEOUT 1200)
+
add_executable(test_hermite_viv tests/test_hermite_viv.f90)
target_link_libraries(test_hermite_viv PRIVATE cabledyn_core)
add_test(NAME hermite_viv COMMAND test_hermite_viv)
set_tests_properties(hermite_viv PROPERTIES LABELS "fortran;dynamic;viv")
+# The Newton predictor against the ringing stretch of the nodal tangents: a taut line seeded with
+# unit tangents (off the elements' stretch) at rho_inf 0.5 to 1 and 25 and 50 steps per VIV cycle,
+# with and without the lift, against the same line seeded at the stretch.
+add_executable(test_hermite_tangent_predictor tests/test_hermite_tangent_predictor.f90)
+target_link_libraries(test_hermite_tangent_predictor PRIVATE cabledyn_core)
+add_test(NAME hermite_tangent_predictor COMMAND test_hermite_tangent_predictor)
+set_tests_properties(hermite_tangent_predictor PROPERTIES LABELS "fortran;dynamic;viv")
+
+add_executable(test_hermite_viv_inline tests/test_hermite_viv_inline.f90)
+target_link_libraries(test_hermite_viv_inline PRIVATE cabledyn_core)
+add_test(NAME hermite_viv_inline COMMAND test_hermite_viv_inline)
+set_tests_properties(hermite_viv_inline PROPERTIES LABELS "fortran;dynamic;viv")
+
+# The flow frame of the synchronisation model (Set_VIV tf): a pipe moved through still water
+# against the same pipe held in the water moving the other way, with the lift alone and with the
+# amplitude tables and the cross-flow damping; the refusals, the all-zero identity and the
+# snapshot replay.
+add_executable(test_hermite_viv_frame tests/test_hermite_viv_frame.f90)
+target_link_libraries(test_hermite_viv_frame PRIVATE cabledyn_core)
+add_test(NAME hermite_viv_frame COMMAND test_hermite_viv_frame)
+set_tests_properties(hermite_viv_frame PROPERTIES LABELS "fortran;dynamic;viv")
+
+add_executable(test_hermite_load_power tests/test_hermite_load_power.f90)
+target_link_libraries(test_hermite_load_power PRIVATE cabledyn_core)
+add_test(NAME hermite_load_power COMMAND test_hermite_load_power)
+set_tests_properties(hermite_load_power PROPERTIES LABELS "fortran;dynamic;viv")
+
+# Long VIV runs (400 cycles at 100 and 200 steps per cycle): the shedding phase under prescribed
+# motion against Adler's closed form (linear error growth, second order), and a locked-in taut
+# line of both kinds (energy closure of the load powers, stationary statistics and frequency).
+# About 26 s in Release and 160 s in Debug locally.
+add_executable(test_viv_long_run tests/test_viv_long_run.f90)
+target_link_libraries(test_viv_long_run PRIVATE cabledyn_core)
+add_test(NAME viv_long_run COMMAND test_viv_long_run)
+set_tests_properties(viv_long_run PROPERTIES LABELS "fortran;dynamic;viv;slow" TIMEOUT 1200)
+
+add_executable(test_load_power_deck tests/test_load_power_deck.f90)
+target_link_libraries(test_load_power_deck PRIVATE cabledyn_core)
+add_test(NAME load_power_deck COMMAND test_load_power_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(load_power_deck PROPERTIES LABELS "fortran;integration;dynamic;viv;driver")
+
+add_executable(test_viv_inline_deck tests/test_viv_inline_deck.f90)
+target_link_libraries(test_viv_inline_deck PRIVATE cabledyn_core)
+add_test(NAME viv_inline_deck COMMAND test_viv_inline_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(viv_inline_deck PROPERTIES LABELS "fortran;integration;dynamic;viv;driver")
+
add_executable(test_viv_coupled tests/test_viv_coupled.f90)
target_link_libraries(test_viv_coupled PRIVATE cabledyn_core)
add_test(NAME viv_coupled COMMAND test_viv_coupled WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
@@ -2637,6 +2792,14 @@ target_link_libraries(test_coupled_torsion PRIVATE cabledyn_core)
add_test(NAME coupled_torsion COMMAND test_coupled_torsion WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(coupled_torsion PROPERTIES LABELS "fortran;unit;static;dynamic;openfast")
+# The channels of one output row evaluated together (CD_AGG_EvalChannels, the line-wide twists
+# and torques once per row) against one at a time, bit for bit, through a rolling march and a
+# probe transfer: a row value kept from another state would fail.
+add_executable(test_channel_row tests/test_channel_row.f90)
+target_link_libraries(test_channel_row PRIVATE cabledyn_core)
+add_test(NAME channel_row COMMAND test_channel_row WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+set_tests_properties(channel_row PROPERTIES LABELS "fortran;unit;dynamic;openfast")
+
# OpenFAST linearisation of a line restrained in torsion, by the shell's lin_eval recipe on the
# aggregate: the twist modes of A against n pi/L sqrt(GJ/Irn), the reduced roll stiffness GJ/L
# (nodal twist and condensed), the damping and inertia columns of the platform's angular rates.
@@ -3436,6 +3599,11 @@ if(CABLEDYN_ENABLE_COVERAGE)
test_hermite_cable_dynamic
test_hermite_drag_dynamics
test_hermite_axial_damping
+ test_hermite_bending_damping
+ test_hermite_bending_damping_dynamic
+ test_hermite_mass_damping
+ test_hermite_mass_damping_dynamic
+ test_bending_damping_deck
test_hermite_cable_control
test_control_torsion
test_hermite_added_mass
@@ -3552,7 +3720,7 @@ foreach(_feature_example IN ITEMS
airy_wave_shallow_chain laid_cable_cross_current chain_modes lazy_wave_modes buoy_clamped_cable
moordynC_wavekin/chain_wavekin7_currents1 spar_pinned_rods mixed_body_rods_points
als_volturnus_line_break_time als_volturnus_line_break_tension
- viv_taut_line_crossflow composite_axial_damping_mode1 composite_ve_syrope_jonswap
+ viv_taut_line_crossflow viv_taut_cable_inline composite_axial_damping_mode1 composite_ve_syrope_jonswap
composite_chain_poly_chain_modes shared_cable_two_floaters lazy_wave_modules_stiffener
chain_sloped_bathymetry_friction torsion_free_end_armoured_cable
moordynC_currents/chain_wavekin3_currents2 moordynC_currents/chain_currents5_grid)
@@ -3638,3 +3806,41 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
endif()
endforeach()
endif()
+
+# Tests over about 200 CPU-s at -O0 on the Windows Debug runner (the CI run of #181). A pull
+# request's Debug tier skips them with the slow tests (fortran.yml); Release runs them on every
+# pull request and the Debug tier on every push to dev and main.
+set(CABLEDYN_DEBUG_LONG_TESTS
+ viv_coupled
+ viv_inline_deck
+ viv_frame_deck
+ viv_wake_deck
+ python_package
+ graded_mesh_statics
+ viv_riser
+ viv_step_order
+ coupled_cable_tolerance
+ static_current_balance
+ bending_damping_deck
+ viv_amplitude_deck
+ hermite_static_azimuth
+ ei0_slack_dynamics
+ arclength_rigid_end
+ viv_lockin
+ viv_diameter_deck
+ torsion_current_start
+ body_rod_physics
+ c_api_threads_exit
+ load_power_deck
+ driver_axial_damping_ratio
+ example_lazy_wave_vessel_rao
+ torsion_orcaflex
+ monolithic_gates
+ driver_graded_cross_current
+ attachment_polish_floor
+)
+foreach(_t IN LISTS CABLEDYN_DEBUG_LONG_TESTS)
+ if(TEST ${_t})
+ set_property(TEST ${_t} APPEND PROPERTY LABELS debug_long)
+ endif()
+endforeach()
diff --git a/README.md b/README.md
index 9ee384f5..a9d6998c 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ lifting off the seabed lie inside the formulation.
It runs as a standalone program, as a mooring module of OpenFAST and FAST.Farm
(`CompMooring = 5`), through a C interface, or from Python.
-The current stable release is `v0.4.2`; interfaces are versioned and may change before `1.0.0`.
+The current stable release is `v0.4.3`; interfaces are versioned and may change before `1.0.0`.
## What CableDyn does
@@ -68,10 +68,10 @@ selection:
| Bergdahl dynamic chain test, 30 conditions | measured end force | correlation 0.993 |
| IEA 15 MW VolturnUS-S in OpenFAST with a power cable | OpenFAST with MoorDyn | platform motions within 0.6 % |
-Run times on one processor thread, same host and protocol, with the timing scripts in
+Run times of the 0.4.2 release driver on one processor thread, same host and protocol, with the timing scripts in
[`validation/performance`](https://cabledyn.readthedocs.io/en/latest/validation.html):
-| Case | CableDyn 0.4.2 | OrcaFlex 11.6d |
+| Case | CableDyn | OrcaFlex 11.6d |
|---|---|---|
| 80 / 200 / 800 m lazy-wave spans, 60 s of heave | 1.3 / 2.4 / 5.0 s | 2.7 / 5.3 / 27.8 s |
| One-hour VolturnUS-S chain mooring | 4.3 s | 19.7 s |
@@ -89,8 +89,8 @@ Unsupported combinations stop with a named error rather than running approximate
|---|---|
| `CableDyn_driver.exe` | Standalone solver for Windows x64 (AVX2 processor) |
| `openfast.exe` | OpenFAST with CableDyn available as `CompMooring = 5` |
- | `cabledyn-0.4.2-py3-none-any.whl` | Python package (pre- and post-processing, batch runs) |
- | `cabledyn-0.4.2.tar.gz` | Python source distribution |
+ | `cabledyn-0.4.3-py3-none-any.whl` | Python package (pre- and post-processing, batch runs) |
+ | `cabledyn-0.4.3.tar.gz` | Python source distribution |
| `SHA256SUMS.txt` | Checksums for the assets above |
Both executables are statically linked, need no installer, compiler, or runtime
@@ -128,7 +128,7 @@ Unsupported combinations stop with a named error rather than running approximate
cabledyn-run examples\wd0050_chain.dat wd0050
```
- The pure Python wheel on the release page (`cabledyn-0.4.2-py3-none-any.whl`)
+ The pure Python wheel on the release page (`cabledyn-0.4.3-py3-none-any.whl`)
carries no driver: `cabledyn-run` then needs `--executable .\CableDyn_driver.exe`,
the `CABLEDYN_DRIVER` environment variable, or the driver on `PATH`. A source
build names the driver `cabledyn` (see [Build from source](#build-from-source));
@@ -171,8 +171,10 @@ layout is described in the architecture notes in the repository.
## Validation
CableDyn is verified against analytical solutions and compared with MoorDyn,
-OrcaFlex, two physical experiments (Holcombe lazy-wave, Bergdahl dynamic chain),
-the IEA 15 MW VolturnUS-S reference systems, and coupled OpenFAST runs. Results,
+OrcaFlex, nine published physical experiments (Holcombe lazy-wave, Bergdahl dynamic
+chain, Chaplin riser natural frequencies and stepped-current VIV, Wang catenary-riser VIV in
+current and heave, NDP high-mode riser VIV, FLOTANT power-cable VIV, oscillatory-flow cylinder VIV, Chaplin & King
+untensioned catenary-riser VIV), the IEA 15 MW VolturnUS-S reference systems, and coupled OpenFAST runs. Results,
acceptance criteria, and reproduction commands are in
the [validation record](https://cabledyn.readthedocs.io/en/latest/validation.html); data and scripts are in
[`validation/`](https://cabledyn.readthedocs.io/en/latest/validation.html).
@@ -200,7 +202,7 @@ If you use CableDyn in academic work, please cite:
> offshore wind. *Ocean Engineering* 368 (Part 2), 128332, 2026.
>
-To identify the software version, also cite the release (CableDyn 0.4.2).
+To identify the software version, also cite the release (CableDyn 0.4.3).
The [citation file](https://cabledyn.readthedocs.io/en/latest/citing.html) contains both entries (GitHub **Cite this
repository**); BibTeX is on the manual's
[How to cite](https://cabledyn.readthedocs.io/en/latest/citing.html) page.
diff --git a/RELEASE.md b/RELEASE.md
index 0758dcda..4d17a314 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -104,7 +104,7 @@ The build fails if either executable imports a non-system DLL or lacks the UTF-8
active-code-page manifest (`release/check_static_windows_binary.ps1`), or if the
standalone and `CompMooring = 5` smoke cases fail with a system-only `PATH` or from
a folder named in mixed scripts. It also fails unless `openfast.exe -v` names the
-executable `OpenFAST-v5.0.0-CableDyn-0.4.2`: the OpenFAST base and the CableDyn version,
+executable `OpenFAST-v5.0.0-CableDyn-0.4.3`: the OpenFAST base and the CableDyn version,
never a `-dirty` describe of the patched tree.
The release workflow (`.github/workflows/release-windows-static.yml`) produces
diff --git a/VALIDATION.md b/VALIDATION.md
index f5d2257b..ea5cf05f 100644
--- a/VALIDATION.md
+++ b/VALIDATION.md
@@ -62,9 +62,10 @@ article's methods, are compared in
| **L2-V** | VolturnUS-S anchor tension | closed-form catenary | 0.77% | <3% | Pass |
| **L2-80** | Lozon 80 m all-chain mooring | catenary (H) / MoorDyn-F (fairlead) | 0.03% / 1.8% | <2% / <5% | Pass |
| **L2-arb** | Closed-form catenary reference check | OrcaFlex VolturnUS-S ref | 0.69% | <2% | Pass |
-| **L2-VIV** | Cross-flow VIV lock-in of a taut 100 m line, U = 0.06–0.42 m/s | MoorDyn-C v2.7.2 (RK2, `dtM` 5e-4 s) and MoorDyn-F (OpenFAST v5 `moordyn_driver`, `dtM` 5e-4 s) | mode-1 and mode-3 lock-in (U ≤ 0.18 and ≥ 0.36 m/s): mid-span A/D within 1.2% of MoorDyn-F, frequency within one spectral bin; same response at `dtM` 5e-4 to 1e-2 s. At 0.21–0.33 m/s two branches coexist (a run ramped up from 0.18 m/s stays in mode 1, one ramped down from 0.30 m/s stays in mode 2): from rest CableDyn and MoorDyn-C settle in mode 2 (U 0.24 m/s: A/D 0.575 against 0.574 at x/L 0.24, same frequency); MoorDyn-F, whose phases start at zero (it does not carry its seed into its state), in mode 1, which `zero VIVphaseSeed` reproduces (0.701 against 0.699, transient to four digits) | A/D <3%, frequency within one spectral bin; band: 3% (MoorDyn-C), 1% (MoorDyn-F) (`viv_lockin`) | Pass |
+| **L2-VIV** | Cross-flow VIV lock-in of a taut 100 m line, U = 0.06–0.42 m/s | MoorDyn-C v2.7.2 (RK2, `dtM` 5e-4 s) and MoorDyn-F (OpenFAST v5 `moordyn_driver`, `dtM` 5e-4 s) | over 150–300 s, mode-1 lock-in at U 0.09–0.18 m/s: mid-span A/D within 0.2% of MoorDyn-F (0.017 against 0.018 at 0.06 m/s, below lock-in); mode 3 at 0.39–0.42 m/s within 1.4%; at 0.36 m/s MoorDyn-F settles in mode 2 and CableDyn in mode 3; frequency within one spectral bin wherever the modes agree; same response at `dtM` 5e-4 and 1e-2 s. At 0.21–0.33 m/s two branches coexist (a run ramped up from 0.18 m/s stays in mode 1, one ramped down from 0.30 m/s stays in mode 2): from rest CableDyn and MoorDyn-C settle in mode 2 (U 0.24 m/s: A/D 0.575 against 0.574 at x/L 0.24, same frequency); MoorDyn-F, whose phases start at zero (it does not carry its seed into its state), in mode 1, which `zero VIVphaseSeed` reproduces (0.699 against 0.699) | A/D <3%, frequency within one spectral bin; band: 3% (MoorDyn-C), 1% (MoorDyn-F) (`viv_lockin`) | Pass |
| **L2-VIV-riser** | Catenary riser of Thorsen et al. in a uniform 0.2 m/s current (MoorDyn-C's VIV test: D 0.024 m, EI 10.5 N m², 100 segments, `Cl` 0.7), deck written anchor first | measured cross-flow frequency 1.04 Hz; MoorDyn-C v2.7.2 (RK4, `dtM` 1e-4 s) | over 20–40 s at `dtM` 1e-3 s: mean fairlead tension 69.92 N against 69.93 N, range 3.73 N against 3.72 N, tension period 0.4853 s against the measured 0.4808 s and MoorDyn-C's 0.4811 s (0.4843 / 0.4829 s at `dtM` 5e-4 / 2.5e-4 s) | mean 0.2%, range 10%, period 1.5% (`viv_riser`) | Pass |
-| **L2-VIV-EI** | Cross-flow VIV of a finite-EI cable: the L2-VIV line with EI = 1 N m², and a bending-stiff line (EA 5e9 N, EI 5e7 N m², β = π²EI/(TL²) ≈ 1, neutrally buoyant) against the EI = 0 string of equal first-mode frequency, U = 0.10–0.36 m/s | CableDyn `EI = 0` line (verification) | EI = 1: mid/quarter A/D 0.662/0.421 against 0.663/0.421, same frequency, at `dtM` 5e-4 to 1e-2 s; stiff line: mode-1 lock-in A/D within 2.5% of the string's at the same frequency for U ≤ 0.24 m/s; for U ≥ 0.27 m/s the string jumps to mode 2 while the stiff line stays in mode 1 (bending raises f₂/f₁ to 3.15) | EI = 1: A/D within 1% at `dtM` 0.01 and 0.002 s (5e-4 s run once over 200 s); stiff line at U 0.21 m/s: A/D within 3%; frequency within one spectral bin; at U 0.30 m/s stiff line A/D > 0.6, string < 0.15 (`viv_lockin`, `hermite_viv`) | Pass |
+| **L2-VIV-EI** | Cross-flow VIV of a finite-EI cable: the L2-VIV line with EI = 1 N m², and a bending-stiff line (EA 5e9 N, EI 5e7 N m², β = π²EI/(TL²) ≈ 1, neutrally buoyant) against the EI = 0 string of equal first-mode frequency, U = 0.10–0.36 m/s | CableDyn `EI = 0` line (verification) | EI = 1: mid/quarter A/D 0.661/0.420 against 0.661/0.420, same frequency, at `dtM` 5e-4 to 1e-2 s; stiff line: mode-1 lock-in A/D within 2.5% of the string's at the same frequency for U ≤ 0.24 m/s; for U ≥ 0.27 m/s the string jumps to mode 2 while the stiff line stays in mode 1 (bending raises f₂/f₁ to 3.15) | EI = 1: A/D within 1% at `dtM` 0.01 and 0.002 s (5e-4 s run once over 200 s); stiff line at U 0.21 m/s: A/D within 3%; frequency within one spectral bin; at U 0.30 m/s stiff line A/D > 0.6, string < 0.15 (`viv_lockin`, `hermite_viv`) | Pass |
+| **L2-VIV-long** | Long VIV runs, 400 cycles: (a) every node of a finite-EI cable moved across a 0.3 m/s flow at 5.5 rad/s (outside the synchronisation band) and inside it; (b) a taut 20 m line locked in, finite-EI and `EI = 0`, ρ∞ = 1, at 100 and 200 steps per cycle | (a) Adler's equation in closed form, `tan(ψ/2) = (b + s tan(θ/2))/a`; (b) the load powers against the change of the line's energy; a 2× finer step | (a) phase error 0.017 rad after 400 cycles at 100 steps per cycle, growing linearly (T/(T/2) 1.99) and second order (4.01 from 50 to 100 steps); inside the band the lag stays within 3.0e-5 rad of ψ*; (b) energy mismatch 2.0e-4 / 1.8e-4 of the VIV work, second order (3.98 / 3.67), A/D and VIV power of the run's two halves within 7.3e-4 and 1.8e-3, lock-in frequency within 1.9e-4 | (a) growth ratio 1.8–2.2, order 3.6–4.4, ≤0.05 rad; locked ≤1e-4 rad; (b) ≤3e-4, ratio 3–5; halves 2e-3 / 1e-2 / 2e-3 (`viv_long_run`) | Pass |
| **L3-1** | WD0050 static | OrcaFlex | 0.15 / 0.85% | <2% | Pass |
| **L3-2** | Regular-wave dynamic | OrcaFlex (pinned, dt-converged) | mean 0.30%, swing 8.4% | <2% / <15% | Pass |
| **L3-3** | Current-deflected static | OrcaFlex | 0.07–0.67% | <2% | Pass |
@@ -81,6 +82,14 @@ article's methods, are compared in
| **L3-8** | Bend stiffener at a clamped hang-off (5 m tapered polyurethane) | OrcaFlex 11.6d (stiffener attachment) / planar elastica | curvature 0.45% of root; cable moment 0.01%, section moment 0.01%, deflection angle 0.0001°; local curvature 0.27% (0.1 m elements) | <1.5% / <2%, 0.05°, <0.5% | Pass |
| **L3-H** | Holcombe static lazy-wave experiment | measured marker geometry | position RMSE 1.07–1.89% of suspended length; peak marker-curvature error 0.34–5.54% | end-restraint bracket | Pass |
| **L3-B** | Bergdahl chain experiment, 30 orbit conditions | measured upper-end force | RMSE 1.58 N; MAPE 3.11%; Pearson 0.993; Lin concordance 0.989 | full published matrix | Pass |
+| **L3-C** | Chaplin Delta Flume riser, still-water natural frequencies | measured modes 1–7 at five tensions | mean error +1.87%, mean absolute 2.28%, largest 4.88% (34 of 35; one outlier reported) | full published table, no fitted parameter | Pass |
+| **L3-D** | Chaplin Delta Flume riser in a stepped current, blind-trial cases 1–9, cross-flow and in-line VIV | measured dominant mode, peak cross-flow amplitude, mean in-line displacement, curvature standard deviations | mode right in 5/9, within one in 9/9; mean in-line within ±17% in 7/9 (−25% to +34%); cross-flow amplitude −45% to +4%; cross-flow curvature −39% to +26% | generic coefficient set, no fitted parameter | Pass measured |
+| **L3-W** | SJTU steel catenary riser in 0.2 m/s current, cross-flow VIV | measured r.m.s. strain (25 stations) and dominant frequency | frequency 0.992 vs 1.00 Hz; max r.m.s. strain +7.3%, station mean +3.6% (Thorsen et al. 2017: 1.02 Hz, −0.4%, −3.0%) | published coefficient set, no fitted parameter | Pass |
+| **L3-Wh** | SJTU steel catenary riser, heave-induced cross-flow VIV in still water (measured top motion, 5.96 s) | measured r.m.s. strain (25 stations, band-passed 0.67–50 Hz) and dominant frequency | no `VIV FRAME`: frequency 1.019 Hz vs close to 1 Hz; max r.m.s. strain +20.8%, station mean +33%, lower/upper half 1.71/0.93 (Thorsen et al. 2017: +5.6%, +8.7%, 1.44/0.71); `VIV FRAME` `Tf` 0.35–1 s: two branches, 1.01–1.02 Hz (max +7 to +13%) or 0.88–0.89 Hz (max −2.8 to −4.2%), `Tf` 0.5 s changes branch at dt/2 | published coefficient set, no fitted parameter; heave period about 6 VIV periods, below the `VIV FRAME` scale separation | Pass measured |
+| **L3-N** | NDP 38 m high-mode riser in uniform flow, 0.3–2.4 m/s (22 tests), cross-flow VIV | measured maximum r.m.s. cross-flow strain, dominant frequency, spatial-mean σ/D | strain r.m.s. log error: Ulveseter et al. (2019) set 0.178, Andersen et al. (2024b) 0.186, generic set 0.277, Thorsen et al. (2016) 0.363 (their own simulation 0.187); f D/U 0.145 / 0.134 / 0.192 / 0.193 vs 0.143 measured | generic set blind; the other sets fitted by their authors to NDP tests (implementation check) | Pass measured |
+| **L3-F** | FLOTANT OD 48 mm power-cable specimen with a 200 kg clump, tow tests at 0.025–1.0 m/s (40 tests), cross-flow and in-line VIV | measured A/D_rms (σ/OD) at 1/2L, 3/4L and L (de Wilde et al. 2021, App. 3) | CF r.m.s. log error (Ur ≥ 3): Ulveseter et al. (2019) set 0.731, generic set 0.594, wake oscillator 1.208; first peak at 1/2L 0.755 / 0.483 / 0.296 vs 0.776 measured; release Ur 7.06 / 5.89 / 5.30 vs 5.88 | published VIV sets, none fitted to these tests; structure identified from the specimen's in-air and in-water RAOs | Pass measured |
+| **L3-O** | SJTU 4 m flexible cylinder moved harmonically through still water, KC 178 at U_R,max 4, 6.5 and 7.9, cross-flow VIV | measured A/D on the acceleration and deceleration paths at mid-span (Fu et al. 2014, Figs. 15–17); lock-in shares 17/34/50 % | A/D r.m.s. error: wake oscillator 0.088 / 0.177 / 0.132, generic set 0.138 / 0.339 / 0.345, Ulveseter et al. (2019) set 0.079 / 0.340 / 0.338; largest A/D at U_R,max 4: 0.280 / 0.472 / 0.124 vs 0.286; at 6.5 and 7.9 every set holds the lock-in while the flow slows: mean deceleration-acceleration gap 0.25–0.50 vs 0.09–0.12 measured | published VIV sets, none fitted to these tests; `VIV FRAME` Tf 0.2 s (sensitivity none, 0.1, 0.3 s) | Pass measured |
+| **L3-K** | Southampton untensioned catenary riser with high curvature and floor touchdown, two mass ratios, current of 0.2–1.4 m/s in both directions (13 speeds each), cross-flow VIV | measured mean top tension and its standard deviation, cross-flow spectral peak frequencies, inclination of the straight part (Chaplin & King 2018, Figs. 9, 10, 12, 13, 15) | frequency uniform along the span in positive current (26/26 runs generic set, 22 wake oscillator, 20 Ulveseter et al. 2019) at f d/U 0.138 / 0.17 / 0.121 vs 0.111 measured; light-riser tension in positive current r.m.s. 9.8% with drag amplification (generic set), 17.8–24.5% without; heavy-riser straight-part inclination 5.0° r.m.s. (implied C_d 2.55 vs 2.47); still-water top tension 81.2 vs 59.1 N (m* 1.84) | published VIV sets, none fitted to these tests; floor friction and damping assumed, with sensitivity runs | Pass measured |
| **L-fig** | Along-arc curvature overlay (CableDyn / OrcaFlex / MoorDyn-F ±4×) | 3-code committed record | CableDyn peak 0.11% from OrcaFlex | <0.5% | Pass |
| **L4-1** | Coupled platform + mooring | synthetic reference | bit-for-bit | — | Pass |
| **L4-1b** | VolturnUS-S coupled platform + power cable | OpenFAST v5.0.0 (CompMooring 5 vs 3) | platform DOFs <0.6% (3-seed DLC-1.1); fairlead and anchor <0.001% static | <3% platform | Pass |
@@ -300,8 +309,9 @@ initialisation.
### Physical experiments
-No line or load parameter is fitted to either experiment. Inputs, reduction
-scripts, results, and source provenance are in
+No line or load parameter is fitted to the measurements a case is compared with (L3-F
+identifies its structure from forced-oscillation tests of the same specimen, separate from
+the tow tests it predicts). Inputs, reduction scripts, results, and source provenance are in
[`validation/experiments`](https://github.com/SMI-Lab-Inha/CableDyn/tree/main/validation/experiments).
- **L3-H Holcombe static lazy-wave test**
@@ -318,7 +328,7 @@ scripts, results, and source provenance are in
over the full 30-condition period-radius matrix, cycle-maximum upper-end force
has RMSE 1.58 N, mean absolute percentage error 3.11%, Pearson correlation
0.993, and Lin concordance 0.989. Two phase-averaged measured histories had
- waveform RMSEs of 5.93% and 2.56% of their force ranges with 0.3.0 (not rerun for 0.4.0, 0.4.1 or 0.4.2).
+ waveform RMSEs of 5.93% and 2.56% of their force ranges with 0.3.0 (not rerun for 0.4.0, 0.4.1, 0.4.2 or 0.4.3).
Halving the mesh length and the time step changes the mean cycle maximum by at most
0.29% and 0.27%. The
0.3125 ms step resolves the segment axial modes that the snap loads excite (and the axial
@@ -326,6 +336,173 @@ scripts, results, and source provenance are in
the run taken as given bit for bit); at
0.625 ms the T = 1.25 s maxima are 1.2% higher (with 0.3.0, 6.5% with every step taken as
given), and with 0.3.0 at 1.25 ms they were 2–15% higher and varied from cycle to cycle.
+- **L3-C Delta Flume riser, still-water natural frequencies**
+ ([Chaplin et al., 2005](https://cabledyn.readthedocs.io/en/latest/references.html#ref-chaplin2005)):
+ the modal analysis of the 13.12 m pinned riser about its static state, at the five top
+ tensions of the paper's Table 2, gives the first seven frequencies 1.87% high on average
+ (mean absolute error 2.28%, largest 4.88%, the first mode of the lowest tension) over 34 of
+ the 35 measured values; the added-mass coefficient 1 is kept (1.1 would bring the mean to +0.62%).
+ The 35th, the second mode of series C, is measured at 1.423 Hz against CableDyn's 1.619 Hz;
+ its ratio to the first mode departs from that of every other series, and it is reported
+ separately. 128 elements and ten times the unpublished axial stiffness change no frequency by
+ more than 3e-6 and 1.2e-4.
+
+- **L3-D Delta Flume riser, VIV in a stepped current**
+ ([Chaplin et al., 2005a](https://cabledyn.readthedocs.io/en/latest/references.html#ref-chaplin2005);
+ [Chaplin et al., 2005b](https://cabledyn.readthedocs.io/en/latest/references.html#ref-chaplin2005b)):
+ the nine blind-trial cases, the lower 5.94 m of the L3-C riser in 0.16–0.95 m/s, with the top
+ spring in series and the measured mean top tension set statically. One generic set for all
+ cases: cross-flow lift 0.8 (f̂0 0.18 ± 0.08), in-line C_x 0.85, α 0.15, C_D 1.2, and the drag
+ amplification of Chaplin et al. (2005a, Eq. 4) on the in-line drag alone (`VIV AMPLITUDE` with
+ `VIV DAMPING 0 0 1`). Against the experimenters' processed results, read from the vector
+ graphics of their blind-trial presentation: the dominant cross-flow mode is right in 5 of 9
+ cases and within one in the rest; the largest mean in-line displacement is within ±17% in 7 of
+ 9 (+34% in case 2, −25% in case 9; the blind predictions under-predicted it by 20–40%);
+ the largest cross-flow amplitude is −45% to +4%, and the overall standard deviation of the
+ cross-flow curvature −39% to +26%. In cases 1–4 and 6–8, half the time step and 128 elements
+ leave the mode and change the mean in-line displacement and the cross-flow curvature by at
+ most 2.7%; the in-line curvature moves by up to 3.1%, except in case 6 (+12%) and case 8 (+19%
+ with 128 elements). Case 5 keeps its mode with the other metrics within 6.4% but its in-line
+ curvature moves by up to 25%; the peak amplitude of case 6 depends on the step and the mesh
+ (−11% at half the time step, kept over an 80 s run, and −13% with 128 elements); case 9
+ settles in mode 7 instead of 8 at half the time step and keeps mode 8 with 128 elements
+ (metrics within 6.1%).
+
+- **L3-W SJTU steel catenary riser, cross-flow VIV in uniform current**
+ ([Wang et al., 2014](https://cabledyn.readthedocs.io/en/latest/references.html#ref-wang2014);
+ [Thorsen et al., 2017](https://cabledyn.readthedocs.io/en/latest/references.html#ref-thorsen2017)):
+ the 23.71 m truncated catenary in a 0.2 m/s in-plane current, run with Thorsen et al.'s coefficient
+ set for this case (C_v 0.7, f̂0 0.18 ± 0.08, C_D 1.2, C_M 2). The dominant cross-flow strain
+ frequency 8.25 m from the lower end is 0.992 Hz against the measured 1.00 Hz (their model 1.02 Hz;
+ [Davies et al., 2026](https://cabledyn.readthedocs.io/en/latest/references.html#ref-davies2026),
+ 1.04 Hz). The largest r.m.s. strain is 7.3% above the measured largest (theirs 0.4% below) and the
+ mean over the 25 stations 3.6% above (theirs 3.0% below). The response has one r.m.s. peak more
+ along the span than the test, as theirs, so the station-by-station ratio scatters (r.m.s. log
+ error 0.338, theirs 0.360). 400 elements and half the time step change the largest r.m.s.
+ strain by 0.2% and 0.1%.
+
+- **L3-Wh SJTU steel catenary riser, heave-induced cross-flow VIV**
+ ([Wang et al., 2014](https://cabledyn.readthedocs.io/en/latest/references.html#ref-wang2014);
+ [Thorsen et al., 2017](https://cabledyn.readthedocs.io/en/latest/references.html#ref-thorsen2017)):
+ the L3-W riser in still water, its upper end moved along the measured top trajectory (two
+ sinusoids of 5.96 s fitted to their Fig. 19: x 0.049 m, z 0.130 m), with Thorsen et al.'s set
+ for this case (C_v 0.8), the strain band-passed from 4 times the motion frequency to 50 Hz as
+ Wang et al. process the measurement. Without a `VIV FRAME` row, the published model's phase
+ input, the dominant frequency 8.25 m from the lower end is 1.019 Hz (measured close to 1 Hz),
+ the largest r.m.s. strain 20.8% above the measured largest (theirs 5.6% above) and the
+ station mean 33% above (theirs 8.7%). The lower half of the span reads 1.71 times the measured
+ on average and the upper half 0.93 times; their model has the same pattern, 1.44 and 0.71.
+ Half the time step and 400 elements change the largest strain by −1.0% and −0.7% and the
+ station mean by −2.9% and −2.3%, at the same frequency. The heave period is about 6 VIV
+ periods, below the scale separation a `VIV FRAME` filter needs (about 30), and the result
+ depends on `Tf`: at 0.35–0.5 s the response stays at 1.01–1.02 Hz with the largest strain
+ 7–13% high, at 0.75–1 s it moves to 0.88 Hz with the largest strain 3–4% low and the upper half
+ 0.60–0.63 times the measured, and at 0.5 s half the time step moves it from the first branch
+ to the second. The default run reproduces the committed record byte for byte.
+
+- **L3-N NDP high-mode riser, cross-flow VIV in uniform flow**
+ ([Trim et al., 2005](https://cabledyn.readthedocs.io/en/latest/references.html#ref-trim2005);
+ [Thorsen et al., 2016](https://cabledyn.readthedocs.io/en/latest/references.html#ref-thorsen2016)):
+ the 38 m bare riser towed horizontally at the 22 uniform-flow speeds, 0.3–2.4 m/s, with the
+ rig's clump-weight tension as an axial spring in series (4 kN in still water, 3.5 kN/m from the
+ reported 4–6 kN range). Four coefficient sets on the same model, compared with the maximum
+ r.m.s. cross-flow strain of each test (Thorsen et al.'s Fig. 8, read from the vector figure), the
+ dominant frequency and the spatial-mean σ/D (Trim et al.'s Figs. 18 and 16, read by eye from
+ raster figures):
+ - the set Ulveseter et al. (2019) fitted to these tests matches every metric: strain r.m.s. log
+ error 0.178 (Thorsen et al.'s own fitted simulation 0.187), f D/U 0.145 against 0.143
+ measured, σ/D within 6% cross-flow and 3% in line, an implementation check of the
+ synchronisation, in-line and higher-harmonic forces;
+ - the cross-flow average Andersen et al. (2024b) fitted to the sheared-flow tests gives 0.186 at
+ f D/U 0.134, with σ/D 57% high;
+ - the generic set, blind, gives 0.277 with σ/D within 2%, at f D/U 0.192;
+ - Thorsen et al.'s own fitted curve and damping give 0.363 at f D/U 0.193; keeping Morison's
+ linear cross-flow damping moves the frequency to 0.153.
+
+ At single speeds the response converges at 1.0 m/s for four of the five sets (half the time
+ step and 400 elements move the strain by at most 0.8%; 18.5% for the fifth) but not at 2.4 m/s,
+ where the mix of neighbouring high modes moves the strain by up to 20%. The statistics over
+ the 22 speeds hold: the full sweep at half the time step gives r.m.s. log errors 0.280, 0.187,
+ 0.184 and 0.375 for the generic, Andersen, Ulveseter and Thorsen sets, f D/U within 0.001 and
+ σ/D within 1.4%.
+
+- **L3-F FLOTANT power-cable specimen, cross-flow and in-line VIV in tow tests**
+ ([de Wilde et al., 2021](https://cabledyn.readthedocs.io/en/latest/references.html#ref-dewilde2021)):
+ the 6.4 m OD 48 mm cable hanging from the carriage with its 200 kg clump weight, towed at the 40
+ speeds of 0.025–1.0 m/s, compared with the measured A/D_rms (σ/OD) at 1/2L, 3/4L and L, the
+ model's displacements processed as the report's accelerometer motions (tilt term, 3.5 rad/s
+ high-pass). The line follows the report's FEM tables node by node. The structure the tests
+ leave open is identified from the specimen's forced-oscillation RAOs, not from the tow data:
+ the cable's EI (1650 N m², where the tables' 3000 N m² needs an empirical factor to match the
+ resonance) and bending damping from the in-air RAOs (resonance at the measured 1.7 Hz, peaks
+ 7.4 and 7.2 against 8.7 and 5.9 at 5 and 10 mm), and in water a bending link chain and a
+ laterally restrained clump that reproduce the measured split of the first mode (peaks 1.2 and
+ 1.9 Hz against 1.3 and 1.8 Hz; r.m.s. log error 0.46 against 1.19 with MARIN's fixed clump).
+ Three published VIV sets, none fitted to these tests (r.m.s. log error of the cross-flow
+ A/D_rms over the three stations, Ur ≥ 3):
+ - the set Ulveseter et al. (2019) fitted to the NDP riser gives the first peak at mid-length,
+ 0.755 at Ur 5.30 against 0.776 at Ur 5.58, but responds from a lower speed (0.42 against
+ 0.18 at Ur 3.53), releases at Ur 7.06 against 5.88 and holds 0.64–0.71 above Ur 9 where the
+ test falls to 0.18–0.44: 0.731;
+ - the generic set is 38% low at the peak (0.483) and releases at the measured Ur: 0.594;
+ - the wake oscillator of Facchinetti et al. (2004) is 62% low (0.296): 1.208.
+
+ No set predicts the speed range of the lock-in. With MARIN's fixed clump or a free clump the
+ same set scores 0.721 and 0.692 but releases at Ur 8.83 and 9.12 and misses the in-water RAOs.
+ Half the time step, two elements per table element and 120 s runs change no A/D_rms by more
+ than 0.006 at five speeds; the default run reproduces the committed record byte for byte.
+
+- **L3-O SJTU flexible cylinder in oscillatory flow, cross-flow VIV hysteresis**
+ ([Fu et al., 2014](https://cabledyn.readthedocs.io/en/latest/references.html#ref-fu2014)):
+ the 4 m cylinder (D 24 mm, pretension 500 N) moved across its axis through still water, A_m
+ 0.68 m (KC 178) at periods 16.5, 10.2 and 8.45 s (U_R,max 4, 6.5 and 7.9), so the relative flow
+ reverses twice per cycle. The cross-flow A/D at mid-span is compared against the instantaneous
+ U_R on the acceleration and deceleration paths with the measured paths of Figs. 15–17 (read from
+ the raster figures; the traced gaps match the figures' annotations 0.15D and 0.2D), and the share
+ of each half-cycle above √2/2 of its peak with the article's lock-in shares. Three published sets,
+ none fitted to these tests, each with a `VIV FRAME` row (Tf 0.2 s), without which the wake
+ oscillator does not shed for a cylinder moving through still water. Every run converges through
+ the flow reversals. At U_R,max 4 the wake oscillator gives the measured largest A/D (0.280
+ against 0.286), the generic set is 65% high and the Ulveseter et al. (2019) set barely responds.
+ At U_R,max 6.5 and 7.9 every set holds the lock-in while the flow slows: the deceleration path
+ stays near its peak, the mean gap between the paths is 2–5 times the measured one and the largest
+ A/D 1.3–2.3 times the measured; the wake oscillator comes closest (A/D r.m.s. error 0.18 and
+ 0.13). Without the row the synchronisation sets respond less (the generic set 0.034 at U_R,max 4,
+ the best of any run) but keep the hold; with Tf 0.1 and 0.3 s their largest A/D moves by up to
+ 21%, the wake oscillator's by up to 11%. Half the time step and 80 elements change the largest A/D
+ by at most 0.1% (generic set, wake oscillator) and 4.1% (Ulveseter et al. set); the default run
+ reproduces the committed record byte for byte.
+- **L3-K Southampton untensioned catenary riser, cross-flow VIV with high curvature and
+ touchdown**
+ ([Chaplin & King, 2018](https://cabledyn.readthedocs.io/en/latest/references.html#ref-chaplin2018)):
+ the 5.36 m, 56 mm riser of very low bending stiffness (EI 1.3 N m²) pinned on the floor of a
+ 2 m flume and 0.2 m above the surface 4.30 m away, at both mass ratios (2.9 and 20.9 N/m
+ submerged) in current of 0.2–1.4 m/s in both directions, with floor contact (friction 0.5,
+ assumed) and 3% Rayleigh damping. The article measures one cross-flow frequency along the
+ whole riser in positive current, close to f d/U = 0.11 on the speed at the near-vertical top,
+ so that the local Strouhal number on the normal velocity runs from 0.11 to above 0.3. Three
+ published VIV sets, none fitted to these tests, and a run without VIV:
+ - all three give one frequency along the suspended span, the curved lower part included
+ (within 10% in 26 of 26 positive runs with the generic set, 22 with the wake oscillator of
+ Facchinetti et al. (2004), 20 with Ulveseter et al.'s (2019) set), at their own level:
+ f d/U 0.121 for Ulveseter et al.'s set (9% above the measured 0.111), 0.138 for the generic
+ set and 0.17 for the wake oscillator;
+ - in negative current the heavy riser's measured frequency stays at 1.05–1.16 Hz from 1.1 m/s;
+ Ulveseter et al.'s set levels off at 1.45–1.5 Hz (f d/(U sin ψ) 0.130 against 0.119), the
+ generic set gives 1.45–1.85 Hz and the wake oscillator 2.1–2.45 Hz;
+ - the mean top tension needs the drag amplification of the generic set (Chaplin et al. 2005,
+ Eq. 4): the light riser's tension in positive current within 9.8% r.m.s. and a rise to
+ 1.4 m/s of 88.8 N against 88.6 N measured (49.8 N without VIV, 60.1 and 51.4 N with the two
+ sets that keep C_d 1.2); the heavy riser's straight-line inclination in negative current
+ within 5.0° r.m.s., implying C_d 2.55 through the article's Eq. 9 against 2.47 measured.
+
+ With the article's length, span and weights the heavy riser's still-water top tension is
+ 81.2 N against 59.1 and 61.8 N measured (light 15.1 against 13.4 and 11.5 N), a geometry the
+ article's numbers do not close, so the tension is also compared as its increment from still
+ water. Half the time step and twice the elements change the mean tension by at most 5.3% and
+ 2.9%; without structural damping or floor friction the mean tension moves by up to 15% and
+ 40% and its standard deviation by up to +296% and +412%. The default run reproduces the
+ committed record byte for byte.
## L4 coupled OpenFAST
@@ -505,7 +682,7 @@ scripts, results, and source provenance are in
### Wall-clock time
-The measurements below were made on 2026-11-08 and 2026-11-09 (CableDyn 0.4.2) on one host (AMD Ryzen Threadripper PRO 7965WX,
+The measurements below were made on 2026-11-08 and 2026-11-09 (the 0.4.2 release driver and a GNU build of its source) on one host (AMD Ryzen Threadripper PRO 7965WX,
Windows 11 Pro) with one thread per code, as the median of three runs after one warm-up. They
come from [`validation/scripts/performance_records.py`](https://github.com/SMI-Lab-Inha/CableDyn/blob/main/validation/scripts/performance_records.py),
which also checks each timed model against its reference response. CableDyn is timed with the
@@ -895,7 +1072,7 @@ stop with a named error.
| Coupled finite-EI touchdown/contact | Pass verified | flat `WtrDpth` and equivalent constant structured bathymetry initialise and step with matching loads; friction and checkpoint restore are tested. The IEA-15 mixed example (its power cable on 248 elements, each at most half the bending length) has 149 grounded nodes and completes a 20 s aggregate trajectory at `dtM=0.025 s` with 2 m surge, 1 m heave, and 0.5 m/s host current, without fallback or stall recovery, at most 12 Newton iterations. A full-turbine run of the same model (one hour after a 200 s transient; TurbSim normal turbulence, 10.6 m/s, 17 % TI; JONSWAP Hs 8 m, Tp 12 s, aligned with the wind and the cable; AeroDyn with the rotor held at 7.55 rpm, no controller, rigid blades and tower; SeaState grid covering the lines) completes without recoveries or non-finite values. The cable's hang-off tension is 11.5 ± 1.1 kN (static 11.9 kN, maximum 17.9 kN). The 149 nodes grounded at the static state stay grounded, joined by one more once the platform has drifted (the touchdown moves 2.5 m toward the platform). The peak curvature is 0.156 1/m at the sag bend, 72 m from the hang-off, and 0.109 1/m at the touchdown. On the former 87-element mesh (10 m elements along the laid section) the peak was 0.160 1/m and the touchdown curvature 0.075 1/m, under-resolved by about 30 %. These curvatures were recorded before the `Curv` channels took the curvature recovered from nodal equilibrium: they are the geometric curvature of the centreline (the larger one-sided trace at a node), which `OutputRecovery element` reproduces. The chain-only twin of the run matches stock MoorDyn over 1200 s to 0.3 % in platform motion and fairlead tension statistics. The anchor tension of the laid cable stays at its static 1.23 kN (maximum 1.24 kN): the seabed friction of the 370 m laid section holds the tension changes at the touchdown. On the former mesh it read 1.39 kN (median) with wave-frequency stick-slip peaks up to 4.1 kN lasting under 1 s, which the resolved mesh does not show, and before the anchor-end correction of this release it locked at about 2.75 kN for the whole run. The run takes 27.1 min of wall time (18.8 min on the former mesh) |
| `WaterKin` from file | Pass verified | See [WaterKin and SeaState modes](#waterkin-and-seastate-modes) |
| Syrope polyester (`SYROPE:` syntax; [Falkenberg et al., 2017](https://cabledyn.readthedocs.io/en/latest/references.html#ref-falkenberg2017)) | Pass verified | MoorDyn-F/C `BA_s|BA_d` rate and force equations; analytic position/velocity tangents with finite-difference checks; projected, bracketed backward-Euler slow-state update with a strong-unloading boundary test; OWC running maximum; `SYROPE IC` `Tmax0/Tmean0` history with range/order checks; both states carried through every lifecycle stage and the coupled checkpoint. `BA_s` is kept separate from line axial damping (`BA`) and tested against double counting. The line takes the seabed, Morison loads, current, waves, host fluid and VIV of any `EI = 0` line: a taut 88.5 m polyester line in water whose fairlead sways 2 m matches MoorDyn-C v2.7.2 within 10.6 N over a 44.8 kN tension range (1.03 MN mean; t = 0 within 0.5 N), and its range grows 4.8 % without drag and added mass (`syrope_hydro`). Composite lines (a 400 m Syrope polyester section between chains, `syrope_composite`): every polyester element starts on its OWC to 2e-11 across its 1.005–1.012 MN tension range, a still run keeps the fairlead tension to the printed digits (one secant per section moved it by 1.4e-5 within 2 s), the chains keep their `BA` damping, a `SYROPE IC` history puts the section on the `Tmax0` working curve, a line split into two Syrope sections reaches the single section's tensions to 1e-8, and a tension above the OWC table stops with a named error. Finite-EI combinations stop with a named error |
-| Cross-flow VIV (LINE TYPES `Cl`) | Pass verified | `EI = 0` lines and finite-EI cables on the aggregate with the host's fluid field: an `EI = 0` riser and a cable (EI 1 N m²) in a 0.15 m/s host current lock in at A/D 0.6645 / 0.6646 and 0.292 Hz (MoorDyn-F 0.662 at 0.293 Hz; standalone 0.665); the phases, running mean squares and averaging time ride in the checkpoint state and the correction rewind: a rebuild from the checkpoint continues bit for bit, one without the VIV reload does not (`viv_coupled`). OpenFAST (IEA-15 UMaine mixed deck, `Cl` 0.8 on the lazy-wave cable, SeaState 0.5 m/s current, 60 s): `openfast -restart` at 30 s reproduces every later CableDyn and OpenFAST output row bit for bit |
+| Cross-flow VIV (LINE TYPES `Cl`) | Pass verified | `EI = 0` lines and finite-EI cables on the aggregate with the host's fluid field: an `EI = 0` riser and a cable (EI 1 N m²) in a 0.15 m/s host current lock in at A/D 0.6631 / 0.6625 and 0.292 Hz (MoorDyn-F 0.662 at 0.293 Hz; standalone 0.663); the phases, running mean squares and averaging time ride in the checkpoint state and the correction rewind: a rebuild from the checkpoint continues bit for bit, one without the VIV reload does not (`viv_coupled`). OpenFAST (IEA-15 UMaine mixed deck, `Cl` 0.8 on the lazy-wave cable, SeaState 0.5 m/s current, 60 s): `openfast -restart` at 30 s reproduces every later CableDyn and OpenFAST output row bit for bit |
**Standalone mixed aggregate.** `CableDyn_driver.exe` partitions and steps the
same aggregate used by OpenFAST. The IEA-15 three-chain + touchdown-cable deck
diff --git a/app/cabledyn.f90 b/app/cabledyn.f90
index 750a3fcf..16ddf99b 100644
--- a/app/cabledyn.f90
+++ b/app/cabledyn.f90
@@ -29,7 +29,7 @@ PROGRAM cabledyn
CD_AGG_NMovingPoints, CD_AGG_GetMovingPointMesh, &
CD_AGG_Step_Moving, CD_AGG_CalcOutput, CD_AGG_End, &
CD_AGG_NumChannels, CD_AGG_ChannelHeader, &
- CD_AGG_EvalChannel, CD_AGG_WriteStaticProfile, &
+ CD_AGG_EvalChannels, CD_AGG_WriteStaticProfile, &
CD_AGG_GetInitMetadata, CD_AGG_GetInitLine, &
CD_AGG_Range_Sample, CD_AGG_Range_Write, CD_AGG_OK, CD_AGG_BADINPUT, &
CD_AGG_UpdateStates_Moving, CD_AGG_MotionKinematics, &
@@ -854,22 +854,27 @@ SUBROUTINE write_mixed_row(unit, time, aggregate, stat, msg)
TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: aggregate
INTEGER, INTENT(OUT) :: stat
CHARACTER(*), INTENT(OUT) :: msg
- INTEGER :: i, ios
- REAL(wp) :: value
+ INTEGER :: i, ios, n_done, eval_stat
+ REAL(wp) :: values(CD_AGG_NumChannels(aggregate))
+ CHARACTER(LEN(msg)) :: eval_msg
! full-precision time column (the deck-driver writers use the same format)
WRITE (unit, '(ES25.16E3)', ADVANCE='NO', IOSTAT=ios) time
IF (ios /= 0) THEN
stat = CD_AGG_BADINPUT; msg = 'cannot write mixed output row'; RETURN
END IF
- DO i = 1, CD_AGG_NumChannels(aggregate)
- CALL CD_AGG_EvalChannel(aggregate, i, value, stat, msg)
- IF (stat /= CD_AGG_OK) RETURN
- WRITE (unit, CD_CHANNEL_FMT, ADVANCE='NO', IOSTAT=ios) CHAR(9), value
+ ! the row's channels in one evaluation (their shared line-wide values once); a failed channel
+ ! ends the row after the channels before it, as a channel-by-channel loop would
+ CALL CD_AGG_EvalChannels(aggregate, values, n_done, eval_stat, eval_msg)
+ DO i = 1, n_done
+ WRITE (unit, CD_CHANNEL_FMT, ADVANCE='NO', IOSTAT=ios) CHAR(9), values(i)
IF (ios /= 0) THEN
stat = CD_AGG_BADINPUT; msg = 'cannot write mixed output row'; RETURN
END IF
END DO
+ IF (eval_stat /= CD_AGG_OK) THEN
+ stat = eval_stat; msg = eval_msg; RETURN
+ END IF
WRITE (unit, '(A)', IOSTAT=ios) ''
IF (ios /= 0) THEN
stat = CD_AGG_BADINPUT; msg = 'cannot write mixed output row'; RETURN
diff --git a/doc/api_python.rst b/doc/api_python.rst
index ec38d944..b4e67c97 100644
--- a/doc/api_python.rst
+++ b/doc/api_python.rst
@@ -204,6 +204,8 @@ in each docstring and in :attr:`FatigueCurve.source`. :func:`channel_damage` and
.. autofunction:: cabledyn.cable_stress
+.. autofunction:: cabledyn.section_stress
+
.. autofunction:: cabledyn.damage_along_arc
.. autoclass:: cabledyn.DamageProfile
@@ -336,6 +338,19 @@ the solver's own curvature, tension, and angle channels, where written, are auth
.. autoclass:: cabledyn.TouchdownHistory
:members:
+.. autofunction:: cabledyn.viv_response
+
+.. autoclass:: cabledyn.VIVResponse
+ :members:
+
+.. autoclass:: cabledyn.ModalAmplitudes
+ :members:
+
+.. autofunction:: cabledyn.current_steps
+
+.. autoclass:: cabledyn.CurrentSteps
+ :members:
+
Deck editing and case generation
--------------------------------
diff --git a/doc/capabilities.rst b/doc/capabilities.rst
index eea4aa13..69277c22 100644
--- a/doc/capabilities.rst
+++ b/doc/capabilities.rst
@@ -114,6 +114,16 @@ Line and constitutive capability
``Coupled``/``Vessel`` rods, bodies other than Rigid6 and ``False alpha_force_blend``.
Modal analysis carries the twist angle of every node. Not modelled: seabed friction
against twist, anisotropic sections, self-contact of a loop (see :ref:`theory-torsion`)
+ * - Bending damping of finite-EI cables (``EI|Bb``, ``EI|-zeta|f``)
+ - Supported
+ - a bending Kelvin–Voigt damping on the curvature rate (stiffness-proportional in ``EI``;
+ a mode is damped in its bending share), on every dynamic route that carries the cable,
+ beside the axial (``BA``) and torsional (``GJ|K|Bt``) damping (:doc:`theory`)
+ * - Rayleigh damping of finite-EI cables (``EI|-zeta|f1|f2``)
+ - Supported
+ - the bending damping plus a mass-proportional transverse damping ``alpha m`` on the
+ velocity normal to the tangent, holding a damping ratio at two frequencies; absolute
+ velocity, so rigid transverse and pendulum motion is damped too (:doc:`theory`)
* - Hockling loops, nonlinear cross-section laws
- Not provided
- the buckling onset and the post-buckled shape are computed, but a loop that closes on
@@ -123,6 +133,12 @@ Line and constitutive capability
- Supported
- lumped at nodes of a finite-EI cable, standalone and coupled, also on a line restrained in
torsion (they add no polar inertia to its twist)
+ * - Free end of a finite-EI cable (a ``Free`` End B)
+ - Supported with limits
+ - a free-hanging cable or riser with a clump or a bare end, its static rest position solved
+ before the march, on a standalone deck of finite-EI lines without bodies, rods or
+ Connect points, from a Coupled/Vessel End A; host-driven decks refuse it
+ (:ref:`theory-free-cable-end`)
* - Bend stiffeners (``STIFFENERS``)
- Supported with limits
- tapered linear-elastic sleeve over a finite-EI line end, adding bending stiffness, mass,
@@ -138,8 +154,49 @@ Line and constitutive capability
- Standalone and coupled
- MoorDyn v2's synchronisation model on ``EI = 0`` lines and, as a distributed lift, on
finite-EI cables of the Hermite and multibody marches (:ref:`theory-viv`), with the
- host's fluid field on the coupled routes and its state in the checkpoint; in-line VIV is
- not provided
+ 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`), 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``
+ lines and finite-EI cables wherever the cross-flow lift runs, seeded and repeatable
+ (:ref:`theory-viv-stochastic`), its state in the checkpoint
+ * - In-line VIV (``VIV`` section ``ClX``, ``alpha``)
+ - Standalone and coupled
+ - the in-line shedding force of Ulveseter et al. (2018) at twice the cross-flow frequency, and
+ the optional higher-harmonic force of Ulveseter et al. (2019) (``Chh``), on
+ ``EI = 0`` lines and finite-EI cables wherever the cross-flow lift runs
+ (:ref:`theory-viv-inline`), its state in the checkpoint
+ * - Wake-oscillator VIV (``WAKE OSCILLATOR`` section ``CL0``, ``St``, ``eps``, ``A``)
+ - Standalone and coupled
+ - the van der Pol wake oscillator of Facchinetti et al. (2004) with acceleration coupling,
+ on ``EI = 0`` lines and along finite-EI cables in place of the synchronisation model; a
+ ``VIV FRAME`` row (``Tf``) takes its frequency from the flow relative to the cable's
+ filtered motion (a towed or floater-driven cable)
+ (:ref:`theory-viv-wake`), its state in the checkpoint
+ * - Amplitude-dependent VIV coefficients (``VIV AMPLITUDE`` section ``AD``, ``Cv``, ``CdAmp``)
+ - Standalone and coupled
+ - a table over the cross-flow amplitude of the synchronisation coefficient and a drag
+ factor, read at the amplitude estimate of Thorsen et al. (2016) (``VIVAmp`` channel), on
+ ``EI = 0`` lines and finite-EI cables (:ref:`theory-viv-amplitude`), its state in the
+ checkpoint; a ``VIV FRAME`` row (``Tf``) takes the estimate, and the ``VIV DAMPING``
+ axes, relative to the cable's filtered motion (a towed or floater-driven cable,
+ :ref:`theory-viv-frame`)
+ * - VIV diameter (``VIV DIAMETER`` section ``Dviv``)
+ - Standalone and coupled
+ - a diameter of the VIV model apart from the hydrodynamic one, for buoyancy-module zones and
+ other sections shedding at a larger outer diameter (:ref:`theory-viv-diameter`)
+ * - Cross-flow damping (``VIV DAMPING`` section ``a``, ``b``, ``c``)
+ - Standalone and coupled
+ - the drag split into its in-line and cross-flow parts about the ambient flow, the
+ cross-flow part ``C_dy = a + b y0/D`` of Thorsen et al. (2016) read at the amplitude
+ estimate plus a Morison-form term ``c``; ``0 0 1`` keeps Morison's drag and lets the
+ ``VIV AMPLITUDE`` drag factor act on the in-line part alone; finite-EI cables
+ (:ref:`theory-viv-cf-damping`); with a ``VIV FRAME`` row about the flow relative to the
+ cable's filtered motion (:ref:`theory-viv-frame`)
Loads and environment
---------------------
@@ -192,6 +249,11 @@ Loads and environment
- Standalone only
- a 6-DOF vessel record, or the RAO response to the deck waves, moves every
``Coupled``/``Vessel`` point of a line deck; see :doc:`options`
+ * - Load power channels (``VIVPow``, ``DragPow``, ``DampPow``)
+ - Standalone and coupled
+ - the power of the VIV loads, the drag and the structural damping on a line, in total and per
+ unit length about a node, at every output time: the energy ledger of a VIV response; see
+ :doc:`outputs`
* - Range graphs (``r`` line output flag, ``RangeStart``)
- Standalone and OpenFAST
- minimum, maximum, and mean along each line over the run, from the committed steps; a run
diff --git a/doc/capi.rst b/doc/capi.rst
index 7c7593dd..1f1e7d51 100644
--- a/doc/capi.rst
+++ b/doc/capi.rst
@@ -122,12 +122,12 @@ files directly, as shown below.
- Library files
- Header
* - Linux
- - ``lib/libcabledyn.so.0.4.2``, the soname link ``libcabledyn.so.1``, and the development
+ - ``lib/libcabledyn.so.0.4.3``, the soname link ``libcabledyn.so.1``, and the development
link ``libcabledyn.so``. ``lib`` is the platform ``CMAKE_INSTALL_LIBDIR``, which can be
``lib64`` or a multiarch directory.
- ``include/CableDyn_CAPI.h``
* - macOS
- - ``lib/libcabledyn.0.4.2.dylib``, ``lib/libcabledyn.1.dylib``, ``lib/libcabledyn.dylib``
+ - ``lib/libcabledyn.0.4.3.dylib``, ``lib/libcabledyn.1.dylib``, ``lib/libcabledyn.dylib``
- ``include/CableDyn_CAPI.h``
* - Windows, GNU toolchain
- ``bin/libcabledyn.dll`` and the import library ``lib/libcabledyn.dll.a``. The GNU
@@ -257,7 +257,7 @@ ABI and versioning
- the same four numbers, reported by the loaded library
* - ``CableDyn_GetVersionString``
- runtime
- - ``"CableDyn 0.4.2 C-ABI 1"``
+ - ``"CableDyn 0.4.3 C-ABI 1"``
* - shared-library ``SOVERSION``
- 1
- soname ``libcabledyn.so.1`` or install name ``libcabledyn.1.dylib``. The Windows DLL
@@ -830,7 +830,7 @@ Version queries
- ``char *``
- ``version_len``
- yes: no-op
- - receives ``"CableDyn 0.4.2 C-ABI 1"``, truncated to ``version_len - 1`` characters and
+ - receives ``"CableDyn 0.4.3 C-ABI 1"``, truncated to ``version_len - 1`` characters and
``NUL``-terminated
* - ``version_len``
- in
diff --git a/doc/citing.rst b/doc/citing.rst
index de9623bd..cc88f09d 100644
--- a/doc/citing.rst
+++ b/doc/citing.rst
@@ -53,7 +53,7 @@ software]. https://github.com/SMI-Lab-Inha/CableDyn
}
When results depend on a particular release, quote the version reported in the solver banner
-(``CableDyn v0.4.2``) together with the options recorded for the run.
+(``CableDyn v0.4.3``) together with the options recorded for the run.
Relation to the journal article
-------------------------------
diff --git a/doc/cli.rst b/doc/cli.rst
index 9abd9670..eb826da5 100644
--- a/doc/cli.rst
+++ b/doc/cli.rst
@@ -1016,8 +1016,8 @@ native reader's rules.
- ``LINE TYPES`` row ``NAME``; fields ``name``, ``diam``, ``mass``, ``ea``, ``ba``,
``ei`` followed by ``cdn``, ``cdt``, ``can``, ``cat`` (CableDyn columns), ``cd``,
``ca``, ``cdax``, ``caax`` (MoorDyn-style columns), or ``gas``, ``gj``, ``irt``,
- ``irn``, ``cdn``, ``cdt``, ``can``, ``cat`` (14-column rows); an 11- or 13-column row
- adds ``cl`` or ``cl``, ``df``, ``cf`` (VIV).
+ ``irn``, ``cdn``, ``cdt``, ``can``, ``cat`` (14-column rows); an 11- or 13-column row, or
+ a 15- or 17-column one, adds ``cl`` or ``cl``, ``df``, ``cf`` (VIV).
* - ``section.LINE.OCCURRENCE.FIELD``
- The ``OCCURRENCE``-th section (1-based, End A to End B) of line ``LINE``; fields
``lineid``, ``linetype``, ``length``, ``numsegs``. A 7-column ``LINES`` row counts as a
@@ -1125,7 +1125,9 @@ remaining cases.
* - ``--jobs``
- int
- ``1``
- - Number of native processes run concurrently; must be positive.
+ - Number of native processes run concurrently; must be positive. Above 1, each process
+ runs with ``OMP_NUM_THREADS=1`` unless the environment sets it (measured batch scaling
+ and thread settings: :doc:`python`, Batch execution and study records).
* - ``--timeout``
- float, s
- none
diff --git a/doc/concepts.rst b/doc/concepts.rst
index 0f9e57c4..6038ea98 100644
--- a/doc/concepts.rst
+++ b/doc/concepts.rst
@@ -80,9 +80,10 @@ A ``LINE TYPES`` row is the reusable material a section refers to by name: diame
metre, axial stiffness ``EA``, axial damping ``BA``, bending stiffness ``EI``, and the four Morison
coefficients (``Cd_n``, ``Cd_t``, ``Ca_n``, ``Ca_t``). ``EI`` is the switch between the two solver paths
(next section). Axial response can be linear ``EA`` or a stateful constitutive model
-(viscoelastic, Syrope) — see :doc:`theory`. An ``EI = 0`` row may end with MoorDyn's cross-flow
+(viscoelastic, Syrope) — see :doc:`theory`. A 10-column row may end with MoorDyn's cross-flow
VIV columns ``Cl`` or ``Cl dF cF`` (lift coefficient and synchronisation band; see
-:ref:`theory-viv`).
+:ref:`theory-viv`), and a ``VIV`` section row adds the in-line force of a type
+(:ref:`theory-viv-inline`).
Two solver paths, selected by ``EI``
------------------------------------
diff --git a/doc/coupling_boundary.md b/doc/coupling_boundary.md
index 4caf90cf..5c441a73 100644
--- a/doc/coupling_boundary.md
+++ b/doc/coupling_boundary.md
@@ -117,7 +117,7 @@ Rules shared by every entry point:
The interface ships as the versioned shared library `libcabledyn` (`cabledyn.dll` in an Intel
Fortran and MSVC build; CMake target `cabledyn_shared`) with the installed header; it reports
-CableDyn 0.4.2 and C ABI version 1, minor extension 4. The Python package uses the same library.
+CableDyn 0.4.3 and C ABI version 1, minor extension 4. The Python package uses the same library.
### Concurrency
diff --git a/doc/driver_format.md b/doc/driver_format.md
index dabaf1f0..c7131b8b 100644
--- a/doc/driver_format.md
+++ b/doc/driver_format.md
@@ -133,8 +133,9 @@ except that `SYROPE IC` must come **after** `LINES`, because its rows name lines
exist. A conventional layout is:
LINE TYPES → BODIES → EXTERNAL LOADS → ROD TYPES → RODS → POINTS → TURBINES → LINES → SYROPE IC →
-SECTIONS → END CONNECTIONS / EQUIVALENT BUOYANCY / ATTACHMENTS / STIFFENERS / FAILURE / CONTROL →
-OPTIONS → OUTPUTS
+SECTIONS → END CONNECTIONS / EQUIVALENT BUOYANCY / ATTACHMENTS / STIFFENERS / VIV / WAKE OSCILLATOR /
+VIV AMPLITUDE / VIV DIAMETER / VIV DAMPING / VIV FRAME / VIV STOCHASTIC / FAILURE / CONTROL → OPTIONS →
+OUTPUTS
Within LINE TYPES, the header row must precede the data rows because it selects their column
order.
@@ -210,6 +211,13 @@ are collapsed. It must match one of the spellings below; any other name fails wi
| EQUIVALENT BUOYANCY | `EQUIVALENT BUOYANCY`, `EQUIVALENT SECTIONS`, `BUOYANCY SECTIONS` |
| ATTACHMENTS | `ATTACHMENTS`, `LINE ATTACHMENTS`, `CLUMPS` |
| STIFFENERS | `STIFFENERS`, `STIFFENER`, `BEND STIFFENERS`, `BEND STIFFENER` |
+| VIV | `VIV`, `VORTEX-INDUCED VIBRATION`, `VORTEX INDUCED VIBRATION` |
+| WAKE OSCILLATOR | `WAKE OSCILLATOR`, `WAKE OSCILLATORS`, `WAKE` |
+| VIV AMPLITUDE | `VIV AMPLITUDE`, `VIV AMPLITUDES` |
+| VIV DIAMETER | `VIV DIAMETER`, `VIV DIAMETERS` |
+| VIV DAMPING | `VIV DAMPING` |
+| VIV FRAME | `VIV FRAME`, `VIV FRAMES` |
+| VIV STOCHASTIC | `VIV STOCHASTIC` |
| FAILURE | `FAILURE`, `FAILURES` |
| CONTROL | `CONTROL`, `CONTROLS` |
| TURBINES | `TURBINES`, `TURBINE` |
@@ -238,7 +246,7 @@ Inside OUTPUTS, a row whose first token is `END` also closes the channel list.
| `MassDenInAir` | dry mass per unstretched metre [kg/m] | submerged weight = (m − ρ_w·πd²/4)·g; its magnitude at most 1e6 where used |
| `EA` | axial stiffness [N] | linear (T = EA·ε); at least 1e-3 and at most 1e15 where used; see the viscoelastic and Syrope forms below |
| `BA/-zeta` | axial damping: ≥ 0 is BA [N·s], < 0 is −ζ (damping ratio): by default (MoorDyn's convention) of each segment, BA = ζ L0 √(EA m) per element, which damps the line's first axial mode at about ζ π/(2N) on N elements and so depends on the mesh (a run notes the ratio); under `mode1 axialDampingRatio` of the line's first axial mode, on any mesh (see the OPTIONS table) | active in EI = 0 and finite-EI dynamics; ignored in a static-only run |
-| `EI` | bending stiffness [N·m²] | finite and ≥ 0; see [EI routing](#ei-routing) |
+| `EI` | bending stiffness [N·m²]; `EI|Bb` or `EI|-zeta|f` adds bending damping, `EI|-zeta|f1|f2` Rayleigh damping (below) | finite and ≥ 0; see [EI routing](#ei-routing) |
| `Cd_n`, `Cd_t` | normal / tangential drag coefficients | used by EI = 0 dynamic current and Airy-wave runs |
| `Ca_n`, `Ca_t` | normal / tangential added-mass coefficients | used by EI = 0 dynamic Froude–Krylov and added-mass runs |
@@ -278,6 +286,41 @@ cable or wire rope (`T = EA ε + K τ`, `M = GJ τ + K ε`; see
active line control changes keeps its `ζ`). It needs a finite-EI type; `GJ|0|Bt` is damping
without coupling.
+**Bending damping.** The `EI` column may be written `EI|Bb`, with `Bb` [N·m²·s] the bending
+Kelvin–Voigt damping of a finite-EI cable: a damping moment `Bb` times the rate of the curvature
+vector, taken in the frame carried with the cable's tangent (see [Bending damping](theory.rst)). It
+is stiffness-proportional: a bending mode of frequency `ω` whose strain energy is all bending has
+the damping ratio `ω Bb/(2 EI)`, and a mode that tension also stiffens is damped only in its
+bending share, `ω Bb/(2 EI) · EI k²/(EI k² + T)` for a uniform cable of wavenumber `k` under
+tension `T`. `EI|-zeta|f` gives it as the damping ratio `0 < ζ < 1` of a pure bending mode of
+frequency `f` [Hz], `Bb = ζ EI/(π f)`, set once per line type (it does not depend on the mesh).
+`EI|0` is the plain `EI`. It needs `EI > 0` and acts in the dynamics only (a static solve has no
+rates).
+
+**Rayleigh damping.** `EI|-zeta|f1|f2` gives the ratio `0 < ζ < 1` at two frequencies `f1` and `f2`
+[Hz]: beside the bending damping `Bb = ζ EI/(π (f1 + f2))` it adds a mass-proportional transverse
+damping `α = 4π ζ f1 f2/(f1 + f2)` [1/s], the force `α m` (`m` the line's mass per metre) on the
+velocity normal to the cable's tangent (see [Mass-proportional damping](theory.rst)). A mode then
+has `ζ(ω) = α/(2ω) + ω Bb/(2 EI) · EI k²/(EI k² + T)`: `ζ` at `f1` and `f2` for a mode whose
+stiffness is all bending, less between them and more outside. In water the `α` share falls with
+the added mass, `m/(m + m_a)`. The velocity is absolute, so the term also damps the rigid
+transverse motion and pendulum swing of a span, increasingly below `f1` (`α/(2ω)`): set `f1` at
+the lowest frequency of interest. It needs `EI > 0`, is set once per line type and acts in the
+dynamics only.
+
+**Cross-flow VIV columns (MoorDyn v2).** A 10-column row may end with `Cl` (11 columns) or
+`Cl dF cF` (13 columns), and a 14-column row likewise (15 or 17 columns, so a line restrained in
+torsion can carry VIV): the lift coefficient of the vortex-shedding synchronisation model and
+the half-range and centre of its band in non-dimensional frequency (MoorDyn's `dF = 0.08` and
+`cF = 0.18` when only `Cl` is given). `Cl = 0` is no VIV; `Cl > 0` needs `cF > 0` and
+`0 <= dF < cF`, and the line's drag in water. It acts in the dynamics on `EI = 0` lines and
+finite-EI cables (see [Cross-flow VIV](theory.rst)). The in-line force of a type is a
+[VIV](#viv-optional) section row; a [WAKE OSCILLATOR](#wake-oscillator-optional) row replaces the
+lift by a wake oscillator, a [VIV AMPLITUDE](#viv-amplitude-optional) table makes `Cl` (and
+`Cd`) depend on the cross-flow amplitude, a [VIV DIAMETER](#viv-diameter-optional) row gives
+the VIV a diameter of its own, and a [VIV DAMPING](#viv-damping-optional-finite-ei-lines) row splits
+the drag into an in-line and a cross-flow part with its own law.
+
**Viscoelastic axial stiffness (MoorDyn `ElasticMod`).** The EA and BA columns accept
bar-separated parts:
@@ -698,7 +741,7 @@ A POINTS row has 9 columns, `ID Type X Y Z Mass Vol CdA Ca`, or the short 5-colu
| `Body` | line end on body N; (X,Y,Z) is the attachment offset in the body frame | X,Y,Z offset; the body supplies Mass/Vol/CdA/Ca |
| `RodA` / `RodB` | line end on rod N End A / End B; coordinates come from the `RODS` row | X,Y,Z placeholders; zero Mass/Vol/CdA/Ca |
| `Connect` | free internal point where ≥ 2 lines meet; its static position is solved from force balance (lines, weight/buoyancy, current drag) starting at the deck seed, and the march starts there | X,Y,Z seed; Mass, Vol, CdA, Ca ≥ 0 |
-| `Free` | free line end (clump or float terminal); a one-line `Connect`, solved the same way | X,Y,Z seed; Mass, Vol, CdA, Ca ≥ 0 |
+| `Free` | free line end (clump or float terminal); a one-line `Connect`, solved the same way; as the End B of a finite-EI line, that line's free end ([below](#free-cable-end)) | X,Y,Z seed; Mass, Vol, CdA, Ca ≥ 0 |
| `Turbine` / `T` | FAST.Farm coupled point on turbine J (turbine-local coordinates) | X,Y,Z; zero Mass/Vol/CdA/Ca |
For dynamic `Connect`/`Free` points, `Mass` is inertial mass and `(rhoW·Vol − Mass)·g` is a
@@ -713,6 +756,30 @@ of its BODY `Mass`/`Vol` (see the theory manual, Seabed contact).
standalone driver. Non-zero `Mass`/`Vol`/`CdA`/`Ca` on `Fixed`, `Coupled`, `Vessel`, `Body`,
`RodA/B`, or `Turbine` points is rejected.
+(free-cable-end)=
+**A free finite-EI cable end.** A `Free` point that ends exactly one finite-EI line, as its End B
+with a `Coupled` or `Vessel` End A (a still hang-off is a `Coupled` point without motion), is that
+line's free end on a standalone deck whose lines are all finite-EI and that has no BODIES,
+RODS or other `Connect`/`Free` point (a free-hanging cable or riser with a clump or a bare end).
+The point's `Mass`, `Vol`, `CdA` and `Ca` act on the line's End B node as an
+[ATTACHMENTS](#attachments-optional-finite-ei-lines) row at the line's full arc length (weight
+and buoyancy, added mass, and drag against current and waves), with the point's isotropic drag
+`½ rhoW CdA ‖w‖ w` on the whole relative velocity rather than the attachment's normal/axial split. The static equilibrium is solved
+with the end first held on the chord from End A towards the deck position, at the line's length
+stretched by its hanging weight, then released, so the run starts at the end's rest position
+(the theory manual, Free cable ends); the dynamics leave the end's position free. `Pointp…`
+channels read the line's End B node, and the End B force (`AnchTen`, `Point
F…`) is the line load
+the point balances, without the point's own loads (a clump at rest reads its submerged weight). The line must be pinned in bending at both ends (no
+non-pinned `END CONNECTIONS` row), with at most one end restrained in torsion, which is then not
+solved (a free end carries no moment or torque; the initialisation note says why), and the point
+and the line must be net heavy (the end hangs). A deck in which any `Free` point is not such an end
+(a clamped or buoyant end, a second `Free` point, a `Connect` point), and a host-driven deck
+(OpenFAST, the C API) or a `bathymetryFile` deck, is left as it was: the routes that take `Free`
+points run it or refuse a finite-EI cable on a `Free` point by name. On a flat seabed a seed below
+the seabed is placed on it at the same stretched length; an end that comes to rest on the seabed
+with a net-heavy point is refused by name (the point has no seabed contact of its own on a
+finite-EI line), while a bare end rests on the line's own contact.
+
`Turbine` points (J ≥ 1) need the turbine reference positions from one of two sources: the
OpenFAST/FAST.Farm aggregate route, where the host supplies them, or a
[TURBINES](#turbines-standalone-farm-decks) section, with which the standalone driver runs the
@@ -760,6 +827,8 @@ rod end, and `Free`/`Connect`-to-`Coupled` lines are left as written.
fails with `LINE End A fairlead (NodeA) must not be below End B anchor (NodeB)`. The exceptions
are a FAST.Farm shared line with both ends on `Turbine` points and a finite-EI line whose End
B is also a `Coupled`/`Vessel` point (a line between two moving points, driven at both ends).
+- A finite-EI line may end on a `Free` point as its End B on a standalone deck of finite-EI lines
+ (its [free end](#free-cable-end)); that point does not count as a dynamic point.
- In a deck with dynamic points, line ends may be `Fixed`, `Coupled`, `Vessel`, `Connect`, `Free`,
`Body`, or `RodA/B`.
@@ -1125,6 +1194,334 @@ Behaviour:
`NodeA`) the `End` column follows the written row, so the stiffener stays on the same physical
end. Stiffeners run wherever the cubic-Hermite cable does, standalone and coupled.
+### VIV (optional)
+
+In-line vortex-induced vibration of a line type: a second vortex-shedding force along the
+relative flow, the direction of the drag, at twice the cross-flow frequency (Ulveseter et al.
+2018; see [In-line VIV](theory.rst)). One row per line type, which must carry the cross-flow lift
+(`Cl > 0` in LINE TYPES), since the in-line phase runs at twice the cross-flow one.
+
+```text
+--------------------- VIV ----------------------------------------------
+TypeName ClX alpha Chh
+(-) (-) (-) (-)
+cable 0.85 0.15 0.5
+```
+
+| Column | Meaning |
+|--------|---------|
+| `TypeName` | an existing LINE TYPES name (case-insensitive), at most one row each |
+| `ClX` | in-line shedding coefficient `C_x` >= 0, at most 1e15; `0` is no in-line VIV |
+| `alpha` | optional frequency band of the in-line phase about twice the cross-flow one, `0 <= alpha < 1` (default 0.15) |
+| `Chh` | optional higher-harmonic coefficient `C_hh` >= 0, at most 1e15 (default 0, none); `Chh > 0` needs `ClX > 0` |
+
+Behaviour:
+
+- Per unit length the force is `1/2 rho D ClX cos(phi_x) U v_n`, with `v_n` the relative normal
+ flow and `U` its speed; its phase follows `dphi_x/dt = 2 (dphi/dt) [1 + alpha sin(phi_xd - phi_x)]`,
+ `phi` the cross-flow phase and `phi_xd` the phase of the in-line motion. Ulveseter et al. take
+ `ClX = 0.85` and `alpha = 0.15` with `Cl = 0.65`.
+- `Chh` adds the higher-harmonic force of Ulveseter et al. (2019), the lift's form
+ `1/2 rho D Chh cos(phi + phi_x) U (t x v_n)` at the sum of the two phases: across the flow at
+ three times the cross-flow frequency (and once and five times, through the in-line motion),
+ along it at twice and four times. It needs no state of its own. Ulveseter et al. use `Chh`
+ from 0 to 1.5.
+- The Outputs flag `V` file carries the in-line force with the lift, and the phase is part of
+ the step-recovery, snapshot and checkpoint state. A row with `ClX = 0` leaves the run exactly as
+ without it.
+- It acts wherever the cross-flow lift does: on `EI = 0` lines (a node force over the node's
+ half elements, as the lift) and on finite-EI cables (integrated with the lift), standalone and
+ coupled. A row fails if it is not `TypeName ClX [alpha [Chh]]`,
+ names an undefined or already named type, or holds a value out of range; `ClX > 0` fails
+ on a type without the cross-flow lift, and `Chh > 0` with `ClX = 0`.
+- See `examples/viv_taut_cable_inline.dat`.
+
+**Published coefficient sets.** The synchronisation band of the LINE TYPES columns is the
+`f0 +/- df` of the papers (`cF` = `f0`, `dF` = `df`), and their Morison inertia coefficient
+`C_M` is `1 + Ca`. Two published sets, as LINE TYPES and VIV columns:
+
+| Source | `Cd` | `Ca` | `Cl` | `dF` | `cF` | `ClX` | `alpha` | `Chh` |
+|--------|------|------|------|------|------|-------|---------|-------|
+| Ulveseter et al. (2018), Table 3: a 10 m riser model in current and in current and waves | 1.2 | 1.0 | 0.65 | 0.08 | 0.18 | 0.85 | 0.15 | 0 |
+| Ulveseter et al. (2019), Table 1 and Section 4: the NDP high-mode riser in uniform current | 1.2 | 1.0 | 0.85 | 0.064 | 0.144 | 0.75 | 0.15 | 1.5 |
+
+Each was fitted to its experiments by the authors and is a starting point, not a universal set;
+MoorDyn's band defaults (`dF` 0.08, `cF` 0.18) are those of the first.
+
+### WAKE OSCILLATOR (optional)
+
+Wake-oscillator vortex-induced vibration of a line type, the model of Facchinetti et al. (2004):
+a van der Pol oscillator per node stands for the near wake and drives the cross-flow lift, coupled
+to the cable's cross-flow acceleration (see [Wake oscillator](theory.rst)). It replaces the
+synchronisation model of the LINE TYPES `Cl` column for that type, so the type keeps `Cl = 0`, and
+it acts on finite-EI cables and `EI = 0` lines alike.
+
+```text
+--------------------- WAKE OSCILLATOR ----------------------------------
+TypeName CL0 St eps A
+(-) (-) (-) (-) (-)
+cable 0.3 0.2 0.3 12
+```
+
+| Column | Meaning |
+|--------|---------|
+| `TypeName` | an existing LINE TYPES name (case-insensitive), at most one row each |
+| `CL0` | reference lift coefficient `C_L0` >= 0 of a fixed cylinder, at most 1e15; `0` is off |
+| `St` | optional Strouhal number > 0 of the wake frequency `2 pi St U/D` (default 0.2) |
+| `eps` | optional van der Pol parameter > 0 (default 0.3) |
+| `A` | optional acceleration coupling >= 0 (default 12; `0` uncouples the wake from the cable) |
+
+Behaviour:
+
+- Per unit length the lift is `1/4 rho D CL0 q U^2` across the relative flow, the direction of the
+ `Cl` lift (`U` the relative normal flow speed), with `q'' + eps om (q^2 - 1) q' + om^2 q = (A/D) y''`
+ at each node, `om = 2 pi St U_a/D` with `U_a` the ambient flow speed normal to the line and `y''`
+ the node's cross-flow acceleration. The defaults are the values Facchinetti et al. fix
+ from forced-wake data. The cross-flow damping of the fluid is the Morison drag of the type's
+ `Cd`, which the paper's `gamma = Cd/(4 pi St)` linearises.
+- `q` starts on its limit cycle at the node's VIV phase seed, `q = 2 cos(phi_0)` (`VIVphaseSeed`),
+ and is part of the step-recovery, snapshot and checkpoint state. The Outputs flag `V` file and
+ `VIVPow` carry the wake lift. A row with `CL0 = 0` leaves the run exactly as without it.
+- A row fails if it is not `TypeName CL0 [St [eps [A]]]`, names an undefined or already named
+ type, or holds a value out of range; `CL0 > 0` fails on a type with `Cl > 0`. A line whose types
+ mix the two models fails.
+
+### VIV AMPLITUDE (optional)
+
+Amplitude-dependent coefficients of the synchronisation model of a line type (Thorsen et al.
+2016): a table over the cross-flow amplitude ratio A/D of the coefficient `Cv` that replaces the
+type's LINE TYPES `Cl`, and of a factor `CdAmp` of its normal drag coefficient `Cd` (see
+[Amplitude-dependent coefficients](theory.rst)). The rows of one type follow each other in
+increasing A/D.
+
+```text
+--------------------- VIV AMPLITUDE ------------------------------------
+TypeName AD Cv CdAmp
+(-) (-) (-) (-)
+riser 0.0 0.8 1.0
+riser 0.3 0.9 1.5
+riser 0.6 0.0 2.0
+```
+
+| Column | Meaning |
+|--------|---------|
+| `TypeName` | an existing LINE TYPES name (case-insensitive) whose `Cl > 0` |
+| `AD` | amplitude ratio A/D >= 0 of the row, strictly increasing over the type's rows |
+| `Cv` | cross-flow coefficient >= 0 at that amplitude, in place of `Cl` |
+| `CdAmp` | optional factor > 0 of the type's normal drag coefficient at that amplitude (default 1) |
+
+Behaviour:
+
+- Each node estimates its cross-flow amplitude as Thorsen et al. do (their Eq. 8 and 9): half the
+ travel of the node across the ambient flow between two zero crossings of its cross-flow
+ velocity, smoothed by a tenth of the difference at every time step (with a
+ [VIV FRAME](#viv-frame-optional) row, the flow and the velocity relative to the cable's filtered
+ motion). An element takes the mean of
+ its free nodes over its diameter as A/D (the one free node next to a fixed end or anchor), and
+ from its table `Cv` (for the lift) and `CdAmp`
+ (times `Cd`, for the normal Morison drag), linear between rows and held beyond the first and
+ last. The coefficients of a step use the estimate of the committed state. The estimate starts
+ at 0, and the static equilibrium takes the type's own `Cd`, so a table whose `CdAmp` at A/D 0
+ is not 1 starts the run off that equilibrium.
+- `VIVAmpN` (OUTPUTS) is the smoothed amplitude of node J [m].
+- A table whose `Cv` falls to zero above some A/D limits the response there (Thorsen et al. fit
+ such a curve to riser tests, their Fig. 7). `CdAmp` gives the drag amplification of a vibrating
+ cylinder, for example Chaplin et al. (2005, Eq. 4), `Cd/Cd0 = 1 + 2.3 s + 1.7 s^2` with the
+ r.m.s. cross-flow displacement `s = (A/D)/sqrt(2)` of a harmonic response.
+- The estimate assumes a narrow-band response, as theirs does. With the in-line VIV of a `VIV`
+ section row, `ClX` and `Chh` stay constant. The estimate is part of the step-recovery, snapshot
+ and checkpoint state. A table with `Cv = Cl` and `CdAmp = 1` throughout runs as the type
+ without it.
+- It acts on `EI = 0` lines and finite-EI cables, standalone and coupled. A row fails if it is not
+ `TypeName AD Cv [CdAmp]`, names an undefined type or one without the synchronisation lift
+ (`Cl = 0`, as a wake-oscillator type), holds a value out of range, does not increase in `AD`,
+ or has other columns than the type's earlier rows; a type takes 2 to 32 rows.
+
+### VIV DIAMETER (optional)
+
+The diameter of the VIV model of a line type, apart from the hydrodynamic diameter `Diam` that
+its drag, added mass and buoyancy keep (see [VIV diameter](theory.rst)).
+
+```text
+--------------------- VIV DIAMETER -------------------------------------
+TypeName Dviv
+(-) (m)
+zone 0.9
+```
+
+| Column | Meaning |
+|--------|---------|
+| `TypeName` | an existing LINE TYPES name (case-insensitive) with VIV (`Cl > 0`, or a WAKE OSCILLATOR row), at most one row each |
+| `Dviv` | diameter > 0 of its VIV model [m], at most 1e15 |
+
+Behaviour:
+
+- The VIV of the type takes `Dviv` wherever it takes the diameter: the shedding frequency
+ `cF U/Dviv` and its band (or the wake frequency `2 pi St U/Dviv` and the coupling `A/Dviv`), the
+ lift, in-line and higher-harmonic forces `1/2 rho Dviv C U^2`, and the amplitude ratio of a
+ [VIV AMPLITUDE](#viv-amplitude-optional) table. The drag, added mass, buoyancy and seabed
+ contact keep `Diam`; so do the stiffener and attachment loads.
+- A buoyancy-module zone of a cable whose modules are ATTACHMENTS rows can be given its own VIV:
+ split the line into SECTIONS at the zone, give the zone a copy of the cable's line type with
+ `Dviv` the module diameter and its own `Cl`, `dF` and `cF` (or `Cl 0` for no VIV there), and
+ keep the modules' mass, volume and drag in ATTACHMENTS. CableDyn models no shedding
+ interaction between modules and bare cable; the coefficients of such a zone are the user's
+ choice.
+- A row with `Dviv` equal to `Diam` runs as the type without it. It acts on `EI = 0` lines and
+ finite-EI cables, standalone and coupled. A row fails if it is not `TypeName Dviv`, names an
+ undefined or already named type or one without VIV, or holds a value out of range.
+
+### VIV FRAME (optional)
+
+The flow frame of the VIV model of a line type: the frame the model takes the cable's motion and
+the free stream in, the earth and the ambient flow by default. A cable moved through the water by
+a tow or by its floater sees no ambient flow, so its wake oscillator never shed, and its
+synchronisation phase saw no cross-flow velocity and its amplitude estimate stayed at zero; with a
+filter time `Tf` the frame moves with the cable's own slow motion (see
+[Wake oscillator](theory.rst) and [Flow frame of the synchronisation model](theory.rst)).
+
+```text
+--------------------- VIV FRAME ----------------------------------------
+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; with `Method cycle` the window, one period of the VIV response |
+| `Method` | optional: `filter` (the default) or `cycle` (synchronisation model only, `Tf > 0`) |
+
+Behaviour:
+
+- The node's velocity is low-pass filtered over `Tf` (first order, started at the node's initial
+ velocity). The slow motion then counts as flow; the cable's own VIV velocity, much faster than
+ `Tf`, does not.
+- On a wake-oscillator type the wake frequency `2 pi St U_a/D` takes `U_a` = the speed normal to
+ the line of the ambient flow less the filtered velocity.
+- On a synchronisation type (LINE TYPES `Cl > 0`) the cross-flow and in-line phases take the
+ node's velocity less the filtered velocity, along the axes of the relative flow, so the shedding
+ speed stays the relative normal speed; with a VIV AMPLITUDE table the amplitude estimate takes
+ that velocity across the ambient flow less the filtered velocity, and with it the table's `Cv`
+ and `CdAmp`; on a finite-EI cable with VIV DAMPING the split takes its in-line and cross-flow
+ axes, and its blend to Morison's drag, from that flow. The lift and drag act on the relative
+ velocity, unchanged.
+- Take `Tf` several VIV periods long and short against the motion: the filter scales the VIV
+ velocity at `omega` by `omega Tf/sqrt(1 + (omega Tf)^2)` (0.9985 at 0.29 Hz with `Tf` 10 s) and
+ lags a motion at `omega_m` by `atan(omega_m Tf)`. A taut cable towed at 0.15 m/s through still
+ water (VIV at 0.28 Hz) with `Tf` 10 s locks in as the same cable held in a 0.15 m/s current:
+ with the wake oscillator A/D within 0.6 % and frequency within 0.001 Hz, where the ambient flow
+ gave it no lock-in; with the synchronisation model A/D within 0.02 % of the held cable with the
+ same row (within 0.25 % without the row), with or without a VIV AMPLITUDE table and VIV DAMPING. On a
+ held cable in a current `Tf` changes A/D by 0.03 % (wake oscillator) and at most 0.24 %
+ (synchronisation model).
+- The two conditions hold together only for a motion much slower than the VIV. Keeping about
+ 95 % of the VIV velocity (`omega Tf >= 3`) while leaving at most 10 % of the motion's velocity
+ 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 [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)
+
+The stochastic synchronisation of Ulveseter et al. (2017): the centre `cF` of a line type's
+synchronisation band becomes a slowly varying random process, so the response can wander between
+modes as in long risers in shear (see [Stochastic band centre](theory.rst)).
+
+```text
+--------------------- VIV STOCHASTIC -----------------------------------
+TypeName sigma c Nf seed
+riser 0.016 0.07 100 1
+```
+
+| Column | Meaning |
+|--------|---------|
+| `TypeName` | an existing LINE TYPES name (case-insensitive) with `Cl > 0` and no WAKE OSCILLATOR row, at most one row each |
+| `sigma` | standard deviation of the band centre, 0 to 1e3 (0: the constant `cF`) |
+| `c` | top of the centre's flat spectrum as a fraction of `cF`, 0 < `c` <= 1 |
+| `Nf` | number of frequency components, an integer from 1 to 1000 (optional, default 100) |
+| `seed` | seed of the components' start phases, an integer from 0 to 2147483646 (optional, default 0) |
+
+Behaviour:
+
+- At a lifting node the centre is `cF + sum_i a sin(p_i + 2 pi f_i theta)`, `theta` the
+ integral of `U/D` over time (`U` the shedding speed of the phase rate), with `Nf` components
+ at the mid-points `f_i = (i - 1/2) c cF/Nf` of a flat spectrum over `(0, c cF]` and amplitude
+ `a = sigma sqrt(2/Nf)`, so its standard deviation is `sigma`. Each component advances at its
+ non-dimensional frequency times `U/D`, as the shedding phase does, so the centre is slow
+ against the VIV for `c` well below 1 (Ulveseter et al. take `c` 0.07). The band half-width `dF`
+ stays constant.
+- The start phases are uniform in `[0, 2 pi)`, drawn for each node from the seed, the node and
+ the line, so the nodes are independent (no spanwise correlation, as in the article), a run
+ repeats its realisation and two lines of one type differ. A different seed is another
+ realisation; report statistics over several.
+- `theta` is part of the step-recovery, snapshot and checkpoint state (one value per node). A
+ row with `sigma = 0` leaves the run exactly as without it. It acts on `EI = 0` lines and
+ finite-EI cables, standalone and coupled, with or without in-line VIV.
+- A row fails if it is not `TypeName sigma c [Nf [seed]]`, names an undefined or already named
+ type, one without `Cl > 0` or one with a WAKE OSCILLATOR row, or holds a value out of range.
+
+### VIV DAMPING (optional, finite-EI lines)
+
+Splits the normal Morison drag of a line type into an in-line and a cross-flow part in the frame
+of the ambient flow, and gives the cross-flow part its own law: the quadratic damping of
+Thorsen et al. (2016) and, optionally, a Morison-form term (see
+[Cross-flow damping](theory.rst)).
+
+```text
+--------------------- VIV DAMPING --------------------------------------
+TypeName a b c
+(-) (-) (-) (-)
+riser 0 0 1
+```
+
+| Column | Meaning |
+|--------|---------|
+| `TypeName` | an existing LINE TYPES name (case-insensitive) with a [VIV AMPLITUDE](#viv-amplitude-optional) table, at most one row each |
+| `a`, `b` | the cross-flow damping coefficient `C_dy = a + b y0/D` >= 0, `y0/D` the type's amplitude estimate; Thorsen et al. (2016, Eq. 1) give `0.31 0.89` |
+| `c` | optional factor >= 0 of a Morison-form cross-flow term `c Cdn \|w\| w_y`, `Cdn` the type's own (unamplified) normal drag coefficient (default 0) |
+
+Behaviour:
+
+- At each point of the line, with `e_x` along the ambient flow normal to the line and `e_y`
+ across it, the relative normal velocity `w` splits into `w_x` and `w_y`. The normal drag per
+ unit length becomes `1/2 rho D [Cdn CdAmp |w| w_x e_x + (C_dy |w_y| + c Cdn |w|) w_y e_y]`:
+ Morison's in-line part, with the drag factor `CdAmp` of the type's amplitude table, and the
+ cross-flow law of the row. Where the ambient normal flow falls below 0.01 m/s the axes are
+ undefined and the drag blends smoothly back to Morison's. With a [VIV FRAME](#viv-frame-optional)
+ row the axes and the blend take the ambient flow relative to the cable's filtered motion.
+- **`0 0 1` amplifies the in-line drag alone.** With an amplitude table's `CdAmp` (for example
+ Chaplin et al. 2005, Eq. 4), the mean in-line drag of a vibrating cable rises while its
+ cross-flow drag stays Morison's. The factor multiplies the whole in-line drag term, so the
+ in-line damping rises with it. A `CdAmp` without this row multiplies the whole normal drag,
+ the cross-flow damping included.
+- **`0.31 0.89` is the published cross-flow-only model** of Thorsen et al. (2016), fitted to
+ still-water decay tests for `y0/D` up to about 0.6. It removes the linear part of Morison's
+ cross-flow damping (`1/2 rho D Cdn U y'`), so use it without in-line VIV: with a `VIV` section
+ row the in-line force turns with the relative flow and can drive a low-frequency cross-flow
+ motion that nothing damps.
+- `0 0 1` with `CdAmp` 1 is Morison's drag (to round-off). The split acts in the dynamics; the
+ static solve keeps Morison's drag, which is the same at rest. `DragPow` reports the split drag.
+- Finite-EI cables only, standalone and coupled; an `EI = 0` line with the row is refused by name.
+ A row fails if it is not `TypeName a b [c]`, names an undefined or already named type or one
+ without an amplitude table, or holds a value out of range.
+
### FAILURE (optional, EI = 0 decks)
A FAILURE row detaches line ends from a point during a dynamic run, with MoorDyn's trigger rules.
@@ -1595,6 +1992,11 @@ bending moment. None of these channels is mandatory.
| `TorqN` | line L torque at node J (uniform along the line in statics); positive for a right-handed twist of End B relative to End A about the End A → End B tangent. Only on a line solved in torsion (restrained at both ends, or at one end with the other free) | N·m |
| `TwistN` | line L material twist accumulated from End A to node J, `M × Σ L/GJ` (less `(K/GJ)(l − L)` under coupling) over the elements in between; 0 at End A, without the end-spring windup. Only on a line solved in torsion | deg |
| `Twist` | line L total twist `Phi − Theta = M C`, end-spring windup included; on a line free at one end the twist of its elements, the free end's turn. Only on a line solved in torsion | deg |
+| `VIVPow` | line L power of the VIV loads (cross-flow lift, and the in-line force of a `VIV` section row) at the committed state, positive into the line ([Outputs](outputs.rst)); 0 in static runs | W |
+| `DragPow` | line L power of the Morison drag (and, on a finite-EI line, its ATTACHMENTS' drag) | W |
+| `DampPow` | line L power of the structural damping (`BA`, and `EI|Bb` and the mass-proportional part of `EI|-zeta|f1|f2` on a finite-EI line); never positive | W |
+| `VIVPowN`, `DragPowN`, `DampPowN` | the same per unit unstretched length about node J (node J's share: half of each of its elements' power and its own node loads', over half their unstretched length) | W/m |
+| `VIVAmpN` | line L smoothed cross-flow amplitude estimate at node J (Thorsen et al. 2016, Eq. 9), which a [VIV AMPLITUDE](#viv-amplitude-optional) table reads; only on a line with such a table; 0 at a node without VIV | m |
- ``/`` are deck LINE/POINT **ids**, not array positions. A channel that matches no
supported form, names an unknown id, or carries trailing text (for example `Point2px_raw`) is a
diff --git a/doc/examples.rst b/doc/examples.rst
index 994bcd4d..7967f217 100644
--- a/doc/examples.rst
+++ b/doc/examples.rst
@@ -265,6 +265,12 @@ Dynamic environment
:ref:`theory-viv`
- cable, dynamic
- ~2 s
+ * - ``viv_taut_cable_inline.dat``
+ - in-line VIV (the ``VIV`` section, ``ClX`` and ``alpha``): the same line as a finite-EI
+ cable; the quarter span moves in line at twice the cross-flow frequency, A/D 0.19 against
+ 0.03 with the cross-flow lift alone — :ref:`theory-viv`
+ - cable, dynamic
+ - ~2 s
Points, buoys, bodies, and rods
-------------------------------
diff --git a/doc/index.rst b/doc/index.rst
index 81e9d1f7..1646dcc0 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -14,12 +14,12 @@ with MoorDyn-C, MoorDyn-F, and OrcaFlex on common reference cases.
.. admonition:: Release status
:class: note
- CableDyn ``v0.4.2`` is the current stable release. It is on PyPI with wheels that carry the
- solver (``pip install cabledyn``). It makes the modal analysis of long lines and the
- finite-EI dynamic step faster, holds the finite-EI static solve to its tolerance on graded
- meshes, in cross currents, with attachments, ``Rigid`` ends and as-laid friction, gives a
- mesh-independent axial damping ratio (``axialDampingRatio mode1``), and runs every shipped
- example deck in its test suite.
+ CableDyn ``v0.4.3`` is the current stable release. It is on PyPI with wheels that carry the
+ solver (``pip install cabledyn``). It adds in-line, higher-harmonic and wake-oscillator VIV,
+ amplitude-dependent VIV coefficients and cross-flow damping, a VIV frame for cables moved
+ through the water, and bending and Rayleigh damping of finite-EI cables, each validated
+ against published riser and power-cable tests; it makes the coupled outputs of a cable
+ restrained in torsion several times cheaper, and lets a finite-EI line end on a free point.
Every comparative-accuracy statement is linked to a passing benchmark in :doc:`validation`.
The project remains below ``1.0.0``, so public APIs may evolve between minor releases.
@@ -55,8 +55,8 @@ Download to first result in five minutes
----------------------------------------
#. Download ``CableDyn_driver.exe``, ``SHA256SUMS.txt``, and **Source code (zip)** (for the
- ``examples`` folder) from the `v0.4.2 release
- `_ and verify the checksum —
+ ``examples`` folder) from the `v0.4.3 release
+ `_ and verify the checksum —
:doc:`installation`. No installer and no runtime DLLs.
#. Put ``CableDyn_driver.exe`` in a working folder, unzip the source archive, and copy its
``examples`` folder next to the executable.
diff --git a/doc/installation.rst b/doc/installation.rst
index 65f1395c..55a0a069 100644
--- a/doc/installation.rst
+++ b/doc/installation.rst
@@ -6,8 +6,8 @@ Installation
There are two ways to get CableDyn:
* **Windows release (recommended for users).** Two single-file executables and a Python wheel,
- attached to the `v0.4.2 GitHub release
- `_. No installer, no compiler,
+ attached to the `v0.4.3 GitHub release
+ `_. No installer, no compiler,
and no runtime DLLs. Start here if you want a first result in five minutes.
* **Build from source** (Windows, Linux, macOS). Needed for the C/Python in-process API, for
development, and on every platform other than Windows x64.
@@ -35,11 +35,11 @@ What is on the release page
- OpenFAST v5.0.0 (maintained by NLR, the National Laboratory of the Rockies, formerly
NREL) with CableDyn built in as ``CompMooring = 5``; stock MoorDyn
(``CompMooring = 3``) is still available in the same binary (:doc:`openfast`). It names
- itself ``OpenFAST-v5.0.0-CableDyn-0.4.2`` (``openfast.exe -v`` and the start of every run).
- * - ``cabledyn-0.4.2-py3-none-any.whl``
+ itself ``OpenFAST-v5.0.0-CableDyn-0.4.3`` (``openfast.exe -v`` and the start of every run).
+ * - ``cabledyn-0.4.3-py3-none-any.whl``
- the pure-Python package: deck editing, case generation, driver automation, result
readers, fatigue and spectral post-processing (:doc:`python`)
- * - ``cabledyn-0.4.2.tar.gz``
+ * - ``cabledyn-0.4.3.tar.gz``
- the Python source distribution (same package as the wheel)
* - ``SHA256SUMS.txt``
- SHA-256 checksums of the four files above
@@ -65,7 +65,7 @@ Download and verify
~~~~~~~~~~~~~~~~~~~
1. Create a folder, for example ``C:\CableDyn``, and download into it ``CableDyn_driver.exe``,
- ``openfast.exe`` (only if you will couple with OpenFAST), ``cabledyn-0.4.2-py3-none-any.whl``
+ ``openfast.exe`` (only if you will couple with OpenFAST), ``cabledyn-0.4.3-py3-none-any.whl``
(only if you will use Python), ``SHA256SUMS.txt``, and ``Source code (zip)``.
2. Verify every downloaded asset against ``SHA256SUMS.txt`` in PowerShell:
@@ -85,8 +85,8 @@ Download and verify
OK CableDyn_driver.exe
OK openfast.exe
- OK cabledyn-0.4.2-py3-none-any.whl
- not downloaded cabledyn-0.4.2.tar.gz
+ OK cabledyn-0.4.3-py3-none-any.whl
+ not downloaded cabledyn-0.4.3.tar.gz
``not downloaded`` only reports an asset you chose to skip.
@@ -95,7 +95,7 @@ Download and verify
``(Get-FileHash .\CableDyn_driver.exe -Algorithm SHA256).Hash`` with its line in
``SHA256SUMS.txt`` (the comparison is case-insensitive).
-3. Unzip ``Source code (zip)``. It expands to a folder such as ``CableDyn-0.4.2``; copy (or move)
+3. Unzip ``Source code (zip)``. It expands to a folder such as ``CableDyn-0.4.3``; copy (or move)
its ``examples`` folder into ``C:\CableDyn`` so the layout is::
C:\CableDyn\
@@ -121,7 +121,7 @@ Check that it runs
.. code-block:: text
===================================================================
- CableDyn v0.4.2
+ CableDyn v0.4.3
Geometrically exact finite-element statics and dynamics of
mooring lines and dynamic power cables for floating offshore wind
-------------------------------------------------------------------
@@ -177,8 +177,8 @@ the CableDyn shared library and the standalone driver, so the package runs decks
release executables. On another platform pip builds from the source distribution, which needs a
Fortran compiler and LAPACK.
-The pure Python wheel on the release page (``cabledyn-0.4.2-py3-none-any.whl``) carries no
-solver; install it with ``py -m pip install .\cabledyn-0.4.2-py3-none-any.whl``. The package
+The pure Python wheel on the release page (``cabledyn-0.4.3-py3-none-any.whl``) carries no
+solver; install it with ``py -m pip install .\cabledyn-0.4.3-py3-none-any.whl``. The package
finds the driver in this order:
#. an explicit path, ``CableDynDriver(r"C:\CableDyn\CableDyn_driver.exe")`` or
@@ -273,7 +273,7 @@ The script downloads the LAPACK source from its release tag and verifies its SHA
integration to OpenFAST itself (do not pre-apply it), builds
both executables, rejects any non-system DLL import, runs a standalone and a coupled
``CompMooring = 5`` / ``CompMooring = 3`` smoke case with a system-only ``PATH``, and writes
-``SHA256SUMS.txt`` into ``build-static-release\dist``. The v0.4.2 assets were built from
+``SHA256SUMS.txt`` into ``build-static-release\dist``. The v0.4.3 assets were built from
OpenFAST revision ``2895884d2be01862173c88d70f86b358d2f1a50a`` and smoke-tested against
``r-test`` revision ``dd5feaaaa500ba7283140107806300d551cff0a7``.
diff --git a/doc/openfast.rst b/doc/openfast.rst
index d944fefe..780e37cd 100644
--- a/doc/openfast.rst
+++ b/doc/openfast.rst
@@ -223,7 +223,7 @@ Run and confirm
Before trusting a run, confirm in the console:
-#. ``Running CableDyn (v0.4.2, ...)`` and ``Parsing CableDyn input file: ``;
+#. ``Running CableDyn (v0.4.3, ...)`` and ``Parsing CableDyn input file: ``;
#. the ``dtM`` line and the model inventory (``Created CableDyn model: ... line object(s)``);
#. for every line, the converged fairlead effective tension, force vector, inclination,
declination, and azimuth at the static equilibrium — printed unconditionally, whether or not
diff --git a/doc/options.rst b/doc/options.rst
index e259ba35..915adc9f 100644
--- a/doc/options.rst
+++ b/doc/options.rst
@@ -573,6 +573,16 @@ Finite-EI cable controls
(see :doc:`openfast`)
- OpenFAST
- ``False predictLoads``
+ * - ``CDOutDt`` / ``cd_out_dt``
+ - real, s
+ - ``0``
+ - finite, >= 0, and a whole multiple of the CableDyn step (``dtM``, or ``DT`` when the deck
+ omits ``dtM``; the run stops at initialisation otherwise): the ``.CD.out`` record takes a
+ row at every whole multiple of it, which also skips the channel evaluation those rows
+ make. ``0`` writes a row after every committed step. The channels OpenFAST writes follow
+ its ``DT_Out`` either way (see :doc:`outputs`)
+ - OpenFAST and FAST.Farm
+ - ``0.1 CDOutDt``
Ambient fluid and prescribed motion
-----------------------------------
diff --git a/doc/outputs.rst b/doc/outputs.rst
index 1fd0325e..1b9cdef9 100644
--- a/doc/outputs.rst
+++ b/doc/outputs.rst
@@ -340,7 +340,8 @@ write. Any other letter is a parse error. Mixed ``EI = 0`` + finite-EI decks rej
flag ``V``; a static run carries no lift and writes no file). On an ``EI = 0`` line the
end nodes carry none, as in MoorDyn; on a finite-EI line each element's lift is lumped to
its two nodes (the translational part of its consistent load), so the end nodes carry
- the lift of their half-elements. Zero on a line without VIV (``Cl = 0``)
+ the lift of their half-elements. On both, a type with in-line VIV (the ``VIV`` section)
+ adds its in-line force. Zero on a line without VIV (``Cl = 0``)
* - ``r``
- ``.Line.range.out``
- range graph: minimum, maximum and mean over the run of the node tension, curvature, bend
@@ -863,6 +864,70 @@ lowest value differs from the converged one by 0.6 m. Elements no longer than ab
:math:`\sqrt{EI/T}` at touchdown keep the node tension there within about 1.5 % of the
converged value through the motion, and a tenth within 0.5 %.
+Load power channels
+~~~~~~~~~~~~~~~~~~~
+
+The power three loads deliver to a line at every output time, for an energy ledger of its
+motion: the work the VIV loads put in against what the drag and the structural damping take out,
+along the line and over the run. Each is the load times the velocity it acts through at the
+committed state, positive when the load puts energy into the line:
+
+.. list-table::
+ :header-rows: 1
+ :widths: 24 56 20
+
+ * - Channel
+ - Meaning
+ - Unit
+ * - ``VIVPow``
+ - power of the VIV loads on line ``L``: the cross-flow lift (:ref:`theory-viv`) and, on a
+ type with a ``VIV`` section row, the in-line force (:ref:`theory-viv-inline`); zero on a
+ line without VIV
+ - W
+ * - ``DragPow``
+ - power of the Morison drag on the line (current, waves and a host's fluid field) and, on a
+ finite-EI line, of its ATTACHMENTS' drag; zero without drag
+ - W
+ * - ``DampPow``
+ - power of the structural damping: the axial dashpot ``BA`` and, on a finite-EI line, the
+ bending dashpot (``EI|Bb``) and the mass-proportional damping (``EI|-zeta|f1|f2``); never
+ positive
+ - W
+ * - ``VIVPowN``, ``DragPowN``, ``DampPowN``
+ - the same per unit unstretched length about node ``J``
+ - W/m
+
+The power of a load on an element is :math:`\mathbf{f}_e\cdot\dot{\mathbf{q}}_e`, its nodal
+(finite-EI: generalised) load on the element's degrees of freedom times their velocities, which
+is the exact rate of work of the load the solver applies; a node load (the lift of an
+``EI = 0`` line, an attachment's drag) delivers :math:`\mathbf{f}\cdot\mathbf{v}` at its node.
+A node takes half the power of each of its elements and the power of its own node loads, so the
+line total ```` is the sum over its nodes, and ``N`` is node ``J``'s share
+over half the unstretched length of its elements (W per metre of unstretched line; on a refined
+line, at the deck node's node of the final mesh). An element's damping power is never positive,
+so neither is a node's.
+
+The three are the non-conservative loads of a VIV study, not all of them: the work of the end
+supports and points, the seabed contact, damping and friction, the added mass and Froude-Krylov
+loads, a body's or point's own drag, the torsional damping ``Bt`` and the internal damping of the
+viscoelastic and Syrope laws is not in them. Where those do no net work, the energy the line holds
+only oscillates in a steady response, so the means balance:
+:math:`\overline{P}_\text{VIV} + \overline{P}_\text{drag} + \overline{P}_\text{damp} \approx 0`.
+On the locked-in taut line of ``viv_taut_cable_inline.dat`` (pinned ends, steady current) the VIV
+loads put in 8.45 W over 60-90 s, the drag takes out 8.48 W and the axial damping 0.002 W: the
+three balance within 0.5 % of the VIV power, the line's loss of energy over the window as its
+response settles, and as an ``EI = 0`` line the same. Integrating a channel over the output times gives the work of its
+load, :math:`W = \int P\,dt`; a static run reports 0.
+
+VIV amplitude channel
+~~~~~~~~~~~~~~~~~~~~~
+
+``VIVAmpN`` [m] is the smoothed cross-flow amplitude estimate of node ``J`` of line ``L``,
+the amplitude at which a ``VIV AMPLITUDE`` table reads the coefficients of the node's elements
+(:ref:`theory-viv-amplitude`): half the node's travel across the ambient flow between two zero
+crossings of its cross-flow velocity, smoothed over about ten time steps. It is requested only on
+a line with such a table, and is 0 at a node without VIV and in a static run.
+
Point channels
~~~~~~~~~~~~~~
@@ -1071,8 +1136,9 @@ output root:
digits, three-digit exponent), TAB-separated.
The first data row is the static initialisation at ``t = 0``; every further row is written after
-each committed CableDyn step, at every ``dtM`` boundary. It is independent of OpenFAST's ``DT_Out``
-and never repeats held values between
+each committed CableDyn step, at every ``dtM`` boundary, or, with ``OPTIONS CDOutDt`` (a whole
+multiple of the CableDyn step), at every multiple of ``CDOutDt``. It is independent of OpenFAST's
+``DT_Out`` and never repeats held values between
CableDyn steps. If OpenFAST retries a step, at any ``dtM``, the provisional row is replaced rather
than duplicated, and a restore of an operating point (``CalcSteady``) keeps the rows of the run;
the file is flushed after every row, so it is readable during a run and intact after a crash.
diff --git a/doc/python.rst b/doc/python.rst
index 8517c5fa..dd740aee 100644
--- a/doc/python.rst
+++ b/doc/python.rst
@@ -714,6 +714,71 @@ cases may run as separate native processes with ``jobs > 1``. Results are always
written in the original manifest order, not completion order. This is process-level concurrency;
it does not change CableDyn's numerical settings or make one solver instance multithreaded.
+With ``jobs > 1`` and no ``OMP_NUM_THREADS`` in the environment, every case runs with
+``OMP_NUM_THREADS=1``, and ``study.json`` records the value the cases ran with
+(``omp_num_threads``; ``null`` when the environment was passed on without one). A set
+``OMP_NUM_THREADS`` is passed on unchanged. The OpenMP regions of a GNU build (the tangent kernels
+of a finite-EI cable of 32 elements or more, up to four threads, and the lines of a multi-line
+system) pay off in a single run only, and many processes that each start a team oversubscribe the
+cores. Measured on a 24-core, 48-thread workstation (gfortran Release build; the static Windows
+release has no OpenMP):
+
+.. list-table:: Batch wall time, 96 finite-EI VIV cases (100 elements, 2000 steps, 1.8 s each)
+ :header-rows: 1
+
+ * - ``jobs``
+ - wall, ``OMP_NUM_THREADS=1``
+ - speed-up
+ - mean case time
+ - wall, OpenMP default
+ * - 1
+ - 177.4 s
+ - 1.0
+ - 1.84 s
+ - 181.2 s
+ * - 2
+ - 91.2 s
+ - 1.9
+ - 1.89 s
+ - 91.5 s
+ * - 4
+ - 48.2 s
+ - 3.7
+ - 1.97 s
+ - 49.4 s
+ * - 8
+ - 27.1 s
+ - 6.5
+ - 2.18 s
+ - 28.7 s
+ * - 16
+ - 16.7 s
+ - 10.6
+ - 2.62 s
+ - 16.9 s
+ * - 24
+ - 13.4 s
+ - 13.3
+ - 3.15 s
+ - 14.1 s
+ * - 48
+ - 11.8 s
+ - 15.1
+ - 5.45 s
+ - 11.9 s
+
+A case slows down as more run beside it (1.84 s alone, 3.15 s beside 23 others: shared memory
+bandwidth and a lower all-core clock), so the batch gains less than ``jobs``; the second hardware
+thread of each core adds 13 %. The VIV cases spend almost no time in OpenMP regions (a single run
+takes 1.79 s with one thread and 1.76 s with the default), so the default costs them at most 5 %.
+On a deck that uses them, the 1024-element lazy-wave cable of
+``examples/lazy_wave_vessel_rao.dat``, a single run takes 11.4 s with one thread, 10.6 s with four
+and 12.5 s with the default, and a batch of 24 such runs with ``jobs=24`` takes 16.7 s with one
+thread per process, 17.9 s with four and 19.1 s with the default. Set ``jobs`` to the number of
+physical cores (24 here), or to the number of hardware threads for the last 10-15 %, and leave
+``OMP_NUM_THREADS`` unset for a batch; for a single long run of a large finite-EI cable,
+``OMP_NUM_THREADS=4`` is the fastest setting.
+
One failed case does not cancel the remaining cases. The final status distinguishes:
* ``completed`` — native exit zero, which the driver reserves for a converged analysis;
diff --git a/doc/python_postprocessing.rst b/doc/python_postprocessing.rst
index 862b731f..2a172a64 100644
--- a/doc/python_postprocessing.rst
+++ b/doc/python_postprocessing.rst
@@ -7,7 +7,7 @@ The ``cabledyn`` package reads the output of the tools a CableDyn study is usual
against, and applies the same typed tables, statistics, fatigue, spectra, plots, and exports to
them (:doc:`python`). This page covers the readers, run-to-run comparison, resampling and
filtering, extreme-value statistics, line geometry, fatigue damage, range graphs, design checks,
-touchdown histories, and parameter grids. All of them need NumPy only; plots need matplotlib.
+touchdown histories, VIV responses, and parameter grids. All of them need NumPy only; plots need matplotlib.
Reading OpenFAST, MoorDyn, and coupled runs
-------------------------------------------
@@ -289,6 +289,24 @@ not follow the rotation of the bending plane.
print(profile.critical_node, profile.maximum_damage)
profile.plot()
+On a finite-EI line, ``quantity="section"`` follows the bending plane. It recovers the stress at
+``points`` points around the section (16 by default) with :func:`cabledyn.section_stress`, from
+``TenN`` and the curvature vector on the section axes, ``CurvXN`` and
+``CurvYN`` (:doc:`outputs`): ``T/A - E r (kappa_x cos theta + kappa_y sin theta)`` at the
+angle ``theta`` from the section's x axis. It counts each point and keeps the largest damage, with
+its angle in ``critical_angle``. This is the recovery for biaxial bending, combined cross-flow and
+in-line VIV among them: a section whose curvature vector turns at a constant magnitude (a
+whirling orbit) has no cycles in ``Curv`` and so no damage under ``"stress"``, while each point
+around it passes through ``+/- E kappa r`` once a revolution.
+
+.. code-block:: python
+
+ profile = damage_along_arc(
+ history, 1, armour, quantity="section", points=16,
+ area=2.4e-3, modulus=2.07e11, radius=0.09, arc_length=result.read_static(),
+ )
+ print(profile.critical_node, profile.critical_angle[profile.node_ids.index(profile.critical_node)])
+
Lifetime damage over sea states
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -421,6 +439,88 @@ that node, for the anchor uplift check.
tdp.plot("arc_length")
tdp.export("results/line1_tdp.csv")
+VIV response
+------------
+
+:func:`cabledyn.viv_response` resolves the motion of a line's nodes about their mean positions
+over a window into the local flow frame of each node, from a CableDyn ``.Line.p.out`` file, a
+MoorDyn-F line file with node positions, or the ``LNpx``/``py``/``pz`` channels of a main
+output. The frame follows the mean shape: the tangent ``t`` from End A towards End B, the in-line
+axis along the part of the given flow velocity normal to the tangent, and the cross-flow axis
+``t x`` in-line, so that (in-line, cross-flow, ``t``) is right-handed. A node whose tangent lies
+along the flow has no frame and reports ``nan``. The :class:`~cabledyn.VIVResponse` holds the
+in-line and cross-flow displacement of every node at every sample and gives:
+
+* ``rms_over_diameter`` and ``amplitude_over_diameter`` (half the peak-to-peak displacement) along
+ the line, for either direction;
+* ``frequencies`` (each node's) and ``frequency`` (the line's), the peak of the Hann-windowed
+ periodogram refined by a parabola through its neighbours, and ``nondimensional_frequency``
+ ``f D/U_n`` with ``U_n`` the flow speed normal to the tangent, the quantity the synchronisation
+ band ``cF +/- dF`` of :ref:`theory-viv` bounds (its reciprocal is the reduced velocity);
+* ``modal_amplitudes``, the least-squares weights at every sample of the shapes
+ ``sin(n pi s/S)`` of a taut line with fixed ends (``s`` the mean chord length from End A, ``S``
+ the line's), or of shapes you give (for example a component of the run's mode shapes,
+ :doc:`outputs`), with their RMS, the dominant mode and the share of the motion they leave
+ unexplained. The sines need the whole line, so they take a per-line file; on the nodes a main
+ output holds, give the shapes;
+* ``complex_shape``, the node Fourier coefficients at one frequency, and from it
+ ``travelling_wave_index``, the ratio of the smaller to the larger singular value of its real and
+ imaginary parts (the travelling index of the complex orthogonal decomposition of
+ :ref:`Feeny 2008 `): 0 for a standing wave, 1 for a wave of constant amplitude
+ travelling over whole wavelengths;
+* ``orbit`` (a node's in-line and cross-flow displacement) and ``phase_difference``, the in-line
+ phase at twice the cross-flow frequency less twice the cross-flow phase, which sets the shape
+ and direction of a figure-of-eight orbit.
+
+A node is named by its CableDyn number (1 = End A; ``node_numbers``): the ``J`` of the
+``LNp`` channels of a main output, which may hold only some nodes, and ``1 .. N`` for a
+per-line file. The CSV export writes the same numbers.
+
+The frequency measures need uniform sampling. On the in-line VIV example
+``viv_taut_cable_inline.dat``, run with the line output flag ``p``, over 60-90 s the mid-span cross-flow amplitude is A/D 0.82 at
+0.295 Hz (``f D/U_n`` 0.20), the quarter-span in-line amplitude 0.19 at 0.57 Hz, the cross-flow
+response is mode 1 and the in-line mode 2, and the travelling-wave index of the cross-flow motion
+is 0.04, a standing wave between the pinned ends.
+
+.. code-block:: python
+
+ from cabledyn import viv_response
+
+ viv = viv_response(result.read_line_positions(1), flow=(0.0, 0.15, 0.0), diameter=0.1,
+ start=60.0)
+ print(viv.frequency("cross_flow"), viv.nondimensional_frequency()[25])
+ print(viv.modal_amplitudes("cross_flow").dominant_mode)
+ print(viv.travelling_wave_index("cross_flow"))
+ viv.plot_envelope()
+ viv.plot_orbit(13)
+ viv.export("results/line1_viv.csv")
+
+A stepped-current study holds the current at a sequence of speeds in one run, so each step
+starts from the state the previous one left: the response follows a branch as the current goes
+up and comes back down, where separate runs would each start from rest.
+:func:`cabledyn.current_steps` builds the schedule (each speed held ``hold`` seconds, ramped
+linearly over ``ramp`` seconds to the next, along one direction); its ``write`` puts the deck's
+MoorDyn-C ``Currents 2`` file ``current_profile_dynamic.txt`` (:doc:`options`) in the deck
+folder, its ``duration`` is the ``TMax`` to give, and its ``responses`` returns the
+:func:`~cabledyn.viv_response` of every hold from ``settle`` seconds into it. The file's
+smallest time interval is the ramp, the step the current table is resampled to, so a hold must
+be a whole number of ramps; the static start takes the first speed. The file holds the last
+speed for two ramps past ``duration``, because the resampled table returns to its first sample
+over its last interval; the run therefore keeps the last speed up to ``TMax``.
+
+.. code-block:: python
+
+ from cabledyn import current_steps
+
+ speeds = [0.10, 0.14, 0.18, 0.22, 0.26, 0.22, 0.18, 0.14, 0.10]
+ steps = current_steps(speeds, hold=60.0, ramp=5.0, direction=(0.0, 1.0, 0.0))
+ steps.write("cases/stepped") # next to the deck, which sets "2 Currents" and TMax
+ print(steps.duration)
+ # ... run the deck, then:
+ for speed, viv in zip(steps.speeds, steps.responses(
+ result.read_line_positions(1), diameter=0.1, settle=30.0)):
+ print(speed, viv.amplitude_over_diameter("cross_flow").max(), viv.frequency("cross_flow"))
+
Parameter grids
---------------
diff --git a/doc/quickstart.rst b/doc/quickstart.rst
index 7dbe3dca..89c3a6ae 100644
--- a/doc/quickstart.rst
+++ b/doc/quickstart.rst
@@ -18,7 +18,7 @@ and the ``examples`` folder (from the release's **Source code (zip)**) side by s
.. code-block:: powershell
Set-Location C:\CableDyn
- .\CableDyn_driver.exe --version # prints the v0.4.2 banner, exit code 0
+ .\CableDyn_driver.exe --version # prints the v0.4.3 banner, exit code 0
2. Solve a mooring line
-----------------------
@@ -38,7 +38,7 @@ The run takes well under a second:
.. code-block:: text
===================================================================
- CableDyn v0.4.2
+ CableDyn v0.4.3
Geometrically exact finite-element statics and dynamics of
mooring lines and dynamic power cables for floating offshore wind
-------------------------------------------------------------------
diff --git a/doc/references.rst b/doc/references.rst
index 9498856b..3c952ccb 100644
--- a/doc/references.rst
+++ b/doc/references.rst
@@ -89,6 +89,48 @@ Hydrodynamics and ocean environment
vortex-induced vibrations in stationary and oscillating flows. *Journal of Fluids and
Structures* **61**, 1–19. https://doi.org/10.1016/j.jfluidstructs.2015.11.006
+.. _ref-thorsen2017:
+
+- **Thorsen, M. J., Sævik, S. & Larsen, C. M. (2017).** Non-linear time domain analysis of
+ cross-flow vortex-induced vibrations. *Marine Structures* **51**, 134–151.
+ https://doi.org/10.1016/j.marstruc.2016.10.007
+
+.. _ref-ulveseter2017:
+
+- **Ulveseter, J. V., Thorsen, M. J., Sævik, S. & Larsen, C. M. (2017).** Stochastic modelling of
+ cross-flow vortex-induced vibrations. *Marine Structures* **56**, 260–280.
+ https://doi.org/10.1016/j.marstruc.2017.08.001
+
+.. _ref-ulveseter2018:
+
+- **Ulveseter, J. V., Thorsen, M. J., Sævik, S. & Larsen, C. M. (2018).** Time domain
+ simulation of riser VIV in current and irregular waves. *Marine Structures* **60**, 241–260.
+ https://doi.org/10.1016/j.marstruc.2018.04.001
+
+.. _ref-ulveseter2019:
+
+- **Ulveseter, J. V., Thorsen, M. J., Sævik, S. & Larsen, C. M. (2019).** Simulating fundamental
+ and higher harmonic VIV of slender structures. *Applied Ocean Research* **90**, 101856.
+ https://doi.org/10.1016/j.apor.2019.101856
+
+.. _ref-andersen2024a:
+
+- **Andersen, M. L., Sævik, S., Wu, J., Leira, B. J. & Langseth, H. (2024a).** Applying Bayesian
+ optimization to predict parameters in a time-domain model for cross-flow vortex-induced
+ vibrations. *Marine Structures* **94**, 103571. https://doi.org/10.1016/j.marstruc.2023.103571
+
+.. _ref-andersen2024b:
+
+- **Andersen, M. L., Sævik, S., Wu, J., Leira, B. J. & Langseth, H. (2024b).** Simulating
+ vortex-induced vibrations in sheared current by using an empirical time-domain model with
+ adaptive parameters. *Applied Ocean Research* **153**, 104284.
+ https://doi.org/10.1016/j.apor.2024.104284
+
+.. _ref-feeny2008:
+
+- **Feeny, B. F. (2008).** A complex orthogonal decomposition for wave motion analysis.
+ *Journal of Sound and Vibration* **310**, 77–90. https://doi.org/10.1016/j.jsv.2007.07.047
+
.. _ref-morison1950:
- **Morison, J. R., O'Brien, M. P., Johnson, J. W. & Schaaf, S. A. (1950).** The force
@@ -206,6 +248,18 @@ Verification and validation references
the IEA Wind 15-Megawatt Offshore Reference Wind Turbine.* Technical Report
NREL/TP-5000-76773, National Renewable Energy Laboratory. https://doi.org/10.2172/1660012
+.. _ref-facchinetti2004:
+
+- **Facchinetti, M. L., de Langre, E. & Biolley, F. (2004).** Coupling of structure and wake
+ oscillators in vortex-induced vibrations. *Journal of Fluids and Structures* **19**\ (2),
+ 123–140. https://doi.org/10.1016/j.jfluidstructs.2003.12.004
+
+.. _ref-violette2010:
+
+- **Violette, R., de Langre, E. & Szydlowski, J. (2010).** A linear stability approach to
+ vortex-induced vibrations and waves. *Journal of Fluids and Structures* **26**\ (3), 442–466.
+ https://doi.org/10.1016/j.jfluidstructs.2010.01.002
+
.. _ref-holcombe2025:
- **Holcombe, A., Hann, M., Brown, S., et al. (2025).** Experimental–numerical model
@@ -218,6 +272,68 @@ Verification and validation references
experiment of a mooring cable. *Journal of Marine Science and Engineering* **4**\ (1), 5.
https://doi.org/10.3390/jmse4010005
+.. _ref-wang2014:
+
+- **Wang, J., Fu, S., Baarholm, R., Wu, J. & Larsen, C. M. (2014).** Fatigue damage of a steel
+ catenary riser from vortex-induced vibration caused by vessel motions. *Marine Structures*
+ **39**, 131–156. https://doi.org/10.1016/j.marstruc.2014.07.002
+
+.. _ref-fu2014:
+
+- **Fu, S., Wang, J., Baarholm, R., Wu, J. & Larsen, C. M. (2014).** Features of vortex-induced
+ vibration in oscillatory flow. *Journal of Offshore Mechanics and Arctic Engineering*
+ **136**\ (1), 011801. https://doi.org/10.1115/1.4025759
+
+.. _ref-davies2026:
+
+- **Davies, R., Lekkala, M. R., Michaloliakos, A., Wong, W.-Y., Hall, M., Vakakis, A. & Zuo, L.
+ (2026).** Time-domain vortex induced vibration modeling of reference dynamic power cable for the
+ Gulf of Maine. *Journal of Fluids and Structures* **146**, 104651.
+ https://doi.org/10.1016/j.jfluidstructs.2026.104651
+
+.. _ref-chaplin2005:
+
+- **Chaplin, J. R., Bearman, P. W., Huera Huarte, F. J. & Pattenden, R. J. (2005).** Laboratory
+ measurements of vortex-induced vibrations of a vertical tension riser in a stepped current.
+ *Journal of Fluids and Structures* **21**\ (1), 3–24.
+ https://doi.org/10.1016/j.jfluidstructs.2005.04.010
+
+.. _ref-chaplin2005b:
+
+- **Chaplin, J. R., Bearman, P. W., Cheng, Y., Fontaine, E., Graham, J. M. R., Herfjord, K.,
+ Huera Huarte, F. J., Isherwood, M., Lambrakos, K., Larsen, C. M., Meneghini, J. R., Moe, G.,
+ Pattenden, R. J., Triantafyllou, M. S. & Willden, R. H. J. (2005).** Blind predictions of
+ laboratory measurements of vortex-induced vibrations of a tension riser. *Journal of Fluids and
+ Structures* **21**\ (1), 25–40. https://doi.org/10.1016/j.jfluidstructs.2005.05.016
+
+.. _ref-chaplin2018:
+
+- **Chaplin, J. R. & King, R. (2018).** Laboratory measurements of the vortex-induced vibrations
+ of an untensioned catenary riser with high curvature. *Journal of Fluids and Structures*
+ **79**, 26–38. https://doi.org/10.1016/j.jfluidstructs.2018.01.008
+
+.. _ref-trim2005:
+
+- **Trim, A. D., Braaten, H., Lie, H. & Tognarelli, M. A. (2005).** Experimental investigation
+ of vortex-induced vibration of long marine risers. *Journal of Fluids and Structures*
+ **21**\ (3), 335–361. https://doi.org/10.1016/j.jfluidstructs.2005.07.014
+
+.. _ref-fontaine2011:
+
+- **Fontaine, E., Marcollo, H., Vandiver, K., Triantafyllou, M., Larsen, C., Tognarelli, M.,
+ Constantinides, Y. & Oakley, O. (2011).** Reliability based factors of safety for VIV fatigue
+ using NDP riser high mode VIV tests. *ASME 2011 30th International Conference on Ocean,
+ Offshore and Arctic Engineering (OMAE2011)*, Volume 7: CFD and VIV; Offshore Geotechnics,
+ 511–522. https://doi.org/10.1115/OMAE2011-49820
+
+.. _ref-dewilde2021:
+
+- **de Wilde, J., Heijnsdijk, R. & de Ridder, E.-J. (2021).** *D5.5 – Report on VIV
+ (hydrodynamic) behaviour.* FLOTANT project deliverable 210430-FLT-WP5_D-5-5_V0 (MARIN report
+ 30995-53-DWB), Maritime Research Institute Netherlands, 30 April 2021. EU Horizon 2020 grant
+ agreement 815289 (https://doi.org/10.3030/815289); public deliverable, no DOI.
+ https://flotantproject.eu/wp-content/uploads/2021/11/210430_FLT-D5.5_VIV_test_v0.pdf
+
Comparison codes
----------------
diff --git a/doc/theory.rst b/doc/theory.rst
index ee8f8b64..8cb0dda2 100644
--- a/doc/theory.rst
+++ b/doc/theory.rst
@@ -229,6 +229,42 @@ as closely. The local value is floored at 0.1 % of the root curvature, as the cu
sign near the tip. On the same hang-off, the curvature along the stiffener follows OrcaFlex
11.6d with its stiffener given as a line attachment within 0.5 % of the root curvature.
+.. _theory-free-cable-end:
+
+Free cable ends
+~~~~~~~~~~~~~~~
+
+A finite-EI line whose End B is a ``Free`` point (:doc:`driver_format`) has that end's position
+free: the dynamic march holds only End A's three positions, and the point's mass, volume, drag
+area and added-mass coefficient act on the End B node as a discrete attachment (the weight
+:math:`(M - \rho V)g`, the added mass :math:`C_a \rho V`, the fluid inertia), with the point's
+isotropic drag :math:`\tfrac12 \rho\, C_dA\, |\mathbf w|\,\mathbf w` on the whole relative velocity,
+as a ``Free`` point carries it, rather than the attachment's normal/axial split. The point's loads
+stay out of the End B force (``AnchTen``, ``PointF``): it is the force the line exerts on the
+point, the line load the point balances, as on the ``EI = 0`` route. The end carries no moment (it is pinned, a natural boundary condition of the
+cubic-Hermite element) and no torque: the line is pinned in bending at both ends, and a torsion
+restraint at its other end is not solved (it is noted, as for a line with two moving ends).
+
+The static equilibrium starts from a held seed: the end is placed on the chord from End A towards
+the point's deck position, at the line's length stretched by its hanging weight,
+:math:`L\,(1 + (W_B + \sum w_i L_i)/EA_{\min})`, so that the seed is the taut straight line (a
+vertical span of exactly the line's length has no catenary seed). The line's static solve (with
+its attachments' homotopy) runs with that end held; the end is then released and the full-load
+equilibrium is solved again with its position free, by the attachment polish's warm-started
+Newton solve with its fallbacks, repeated to the drag and surface fixed point. The run starts at
+that rest position. The line and the point must be net heavy, so that the end hangs. On a flat
+seabed a seed that would lie below the seabed (a line longer than the depth below End A) is placed
+on the seabed at the same stretched length, out along the deck chord's horizontal direction; an end
+whose point is net heavy and that comes to rest on the seabed is refused, since an attachment has no
+seabed contact of its own on a finite-EI line (a bare end rests on the line's contact).
+
+On a 7 m cable (2.8 kg/m, EA 1e8 N) with a 200 kg clump the top tension is the submerged weight
+of both to 1e-6 relative and the end hangs one stretched length below the top to 1e-7 m; in a
+0.5 m/s current the end rests where the ``EI = 0`` route puts the same deck's ``Free`` point
+(within 2e-5 m at EI 3 N m², and converging to it as EI falls); and a 0.05 m sway of the top at
+0.05 Hz moves the end in phase with an amplitude ratio within 1 % of the Rayleigh estimate of the
+hanging string with its end mass (``tests/test_free_end_deck.f90``).
+
.. _theory-output-recovery:
Node tension, curvature and bend moment
@@ -837,6 +873,121 @@ viscoelastic or Syrope section has no single ``EA`` that sets the first mode, so
and a negative ``BA`` is refused under this option; ``BA`` in N·s is used as given under both
conventions.
+Bending damping
+~~~~~~~~~~~~~~~
+
+A finite-EI cable can carry a bending Kelvin–Voigt damping (``EI|Bb`` or ``EI|-zeta|f`` in
+LINE TYPES, see :doc:`file_formats`). With :math:`\mathbf{a} = \mathbf{r}_{,s}`,
+:math:`\mathbf{b} = \mathbf{r}_{,ss}` and the curvature vector of the elastic energy
+:math:`\boldsymbol{\kappa} = \mathbf{a}\times\mathbf{b}/\lvert\mathbf{a}\rvert^3`, the element's
+dissipation function is
+
+.. math::
+
+ \psi = \int_0^{L_0} \tfrac{1}{2}\,B_b\,\lvert\mathring{\boldsymbol{\kappa}}\rvert^2\,\mathrm{d}s,
+ \qquad
+ \mathring{\boldsymbol{\kappa}} = (\mathbf{I} - \mathbf{t}\mathbf{t}^\mathsf{T})\,\dot{\boldsymbol{\kappa}},
+ \qquad \mathbf{t} = \mathbf{a}/\lvert\mathbf{a}\rvert ,
+
+and the damping force is :math:`\partial\psi/\partial\mathbf{v}`, with exact position and velocity
+Jacobians. Under active line control (``CONTROL``) the curvature rate also carries the change of
+the element's unstretched length, on which the shape functions depend, as the axial strain rate
+does. Because :math:`\boldsymbol{\kappa}` is normal to :math:`\mathbf{t}`,
+:math:`\mathring{\boldsymbol{\kappa}} = \dot{\boldsymbol{\kappa}} - (\mathbf{t}\times\dot{\mathbf{t}})
+\times\boldsymbol{\kappa}`: the curvature rate in the frame carried with the tangent by the smallest
+rotation. It vanishes for a rigid motion whose rotation
+is normal to the tangent and equals :math:`\dot{\boldsymbol{\kappa}}` in planar bending. Without a
+twist state, a curvature that turns about the centreline cannot be told from a whirl and is damped
+as one; for a rigid rotation about the tangent of a curved span (the out-of-plane swing of a
+catenary) the force is of order :math:`B_b\kappa^2` and negligible against the span's inertia.
+
+The damping is stiffness-proportional in the bending stiffness alone. A uniform cable of tension
+:math:`T` vibrating in a mode of wavenumber :math:`k` and frequency :math:`\omega` has the damping
+ratio
+
+.. math::
+
+ \zeta = \frac{\omega\,B_b}{2\,EI}\;\frac{EI\,k^2}{EI\,k^2 + T} ,
+
+the pure-bending ratio times the bending share of the modal stiffness: a tension-dominated mode is
+damped much less than a bending one. ``EI|-zeta|f`` sets :math:`B_b = \zeta\,EI/(\pi f)`, the ratio
+:math:`\zeta` of a pure bending mode of frequency :math:`f`. The free decay of the first mode of a
+pinned cable reproduces this ratio to 0.05 % in the bending- and tension-dominated limits
+(``test_hermite_bending_damping_dynamic``). The force joins the axial damping as the structural
+damping load (it is in the reported end forces, not in the elastic ``BendMom`` output).
+
+.. _theory-mass-damping:
+
+Mass-proportional (Rayleigh) damping
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The bending damping alone gives :math:`\zeta \propto \omega`: a ratio set at one frequency is too
+low below it and too high above it, so a broad VIV band cannot hold one :math:`\zeta`. The form
+``EI|-zeta|f1|f2`` (LINE TYPES) adds a mass-proportional term, which makes the pair a Rayleigh
+damping :math:`\alpha\,\mathbf M + \beta\,\mathbf K_b` with :math:`\beta = B_b/EI`. With
+:math:`\mathbf v = \dot{\mathbf r}` the velocity interpolated by the shape functions of the
+consistent mass and :math:`m` the line's mass per unstretched length (``MassDenInAir``, with a
+stiffener sleeve's where ``STIFFENERS`` adds one), the
+element's dissipation function is
+
+.. math::
+
+ \psi_\alpha = \int_0^{L_0} \tfrac{1}{2}\,\alpha\,m\,
+ \lvert(\mathbf{I} - \mathbf{t}\mathbf{t}^\mathsf{T})\,\mathbf v\rvert^2\,\mathrm{d}s ,
+
+and the damping force is :math:`\mathbf f_\alpha = \partial\psi_\alpha/\partial\dot{\mathbf q} =
+\int_0^{L_0} \alpha\,m\,\mathbf N^\mathsf{T}(\mathbf I - \mathbf t\mathbf t^\mathsf{T})\,\mathbf v\,\mathrm ds`
+(:math:`\mathbf N` the cubic-Hermite position shape functions, four-point Gauss rule as the mass).
+Its velocity Jacobian :math:`\int \alpha m\,\mathbf N^\mathsf{T}(\mathbf I - \mathbf t\mathbf t^\mathsf{T})
+\mathbf N\,\mathrm ds` is symmetric; its position Jacobian follows from
+:math:`\partial\mathbf t/\partial\mathbf r' = (\mathbf I - \mathbf t\mathbf t^\mathsf{T})/\lvert\mathbf r'\rvert`,
+
+.. math::
+
+ \frac{\partial \mathbf f_\alpha}{\partial \mathbf q} = -\int_0^{L_0} \frac{\alpha\,m}{\lvert\mathbf r'\rvert}\,
+ \mathbf N^\mathsf{T}\Big[(\mathbf I - \mathbf t\mathbf t^\mathsf{T})(\mathbf t\cdot\mathbf v)
+ + \mathbf t\,\big((\mathbf I - \mathbf t\mathbf t^\mathsf{T})\mathbf v\big)^\mathsf{T}\Big]\,
+ \mathbf N_{,s}\,\mathrm ds ,
+
+so the Newton tangent stays exact. On a straight span the force is :math:`\alpha\,\mathbf M\,\mathbf v`
+in the two transverse directions and zero along the axis: axial motion is left to ``BA``. A
+transverse mode whose modal mass is the line's own is damped at :math:`\alpha/(2\omega)`, and with
+the bending damping the ratio is
+
+.. math::
+
+ \zeta(\omega) = \frac{\alpha}{2\,\omega} + \frac{\omega\,B_b}{2\,EI}\;\frac{EI\,k^2}{EI\,k^2 + T} .
+
+``EI|-zeta|f1|f2`` sets
+
+.. math::
+
+ B_b = \frac{\zeta\,EI}{\pi\,(f_1 + f_2)}, \qquad \alpha = \frac{4\pi\,\zeta\,f_1 f_2}{f_1 + f_2} ,
+
+so a mode whose stiffness is all bending has the ratio :math:`\zeta` at :math:`f_1` and
+:math:`f_2`, less between them (at least :math:`2\zeta\sqrt{f_1 f_2}/(f_1 + f_2)`, at
+:math:`\sqrt{f_1 f_2}`) and more outside. Free decays of modes 1, 2 and 3 of a pinned cable
+reproduce :math:`\zeta(\omega)` for :math:`\alpha` alone, :math:`B_b` alone and both to 0.06 %, and
+the target at :math:`f_1` and :math:`f_2` to 0.03 % (``test_hermite_mass_damping_dynamic``).
+The
+ratio is lower in two cases: :math:`B_b` damps a mode with tension in its bending share only, and
+:math:`\alpha` damps a mode in water in the share :math:`m/(m + m_a)` of its modal mass, since the
+added mass :math:`m_a` (and an attachment's mass) is not in :math:`\alpha\,\mathbf M`.
+
+The velocity is absolute (the earth frame), as in the usual Rayleigh model. The term therefore
+damps a rigid transverse translation and the pendulum swing of a span, and it opposes the
+transverse motion a moving fairlead imposes, as a linear drag :math:`\alpha m\,\mathbf v_n` would in
+still water. Its ratio :math:`\alpha/(2\omega)` grows as the frequency falls, so motions well below
+:math:`f_1` (slow drift, a moored line's pendulum and the low-frequency response of a coupled
+floater) are damped more than the target; set :math:`f_1` at the lowest frequency the analysis
+must resolve and compare the low-frequency response against the run without the pair. A velocity
+relative to the cable's filtered motion (the frame :ref:`theory-viv-frame` uses) would exempt
+slow motions, but it adds a filter state, lags the damping and replaces :math:`\alpha/(2\omega)`
+by a factor that depends on the filter, so the pair would no longer hold :math:`\zeta` at
+:math:`f_1`; CableDyn keeps the absolute velocity and no state. The force joins the structural
+damping load beside ``BA`` and :math:`B_b` (the end forces and ``DampPow`` carry it). ``EI = 0``
+lines have no counterpart: the form needs a finite-EI cable, as the bending damping does.
+
Viscoelastic rope (MoorDyn ``ElasticMod`` 2 and 3)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1088,17 +1239,65 @@ the state vector it integrates, so its phases start at zero at every node: a uni
excites the symmetric modes only, after which the line stays in its first mode. ``zero
VIVphaseSeed`` starts every phase at zero, and reproduces that start (:doc:`options`).
-In the implicit step the phase is explicit: the step's lift takes the phase predicted at
-:math:`t_{n+1}` from the step-start rate (the generalised-α level under the configuration blend),
-and the committed phase is the trapezoidal (Heun) update with the rate at the converged end
-state. The lift's position and velocity derivatives enter the tangent. The cross-flow motion of
-the phase and the velocity in the lift are the node values averaged with the neighbours,
+In the implicit step the phase is explicit. The step's lift takes the phase predicted at
+:math:`t_{n+1}` (the generalised-α level under the configuration blend) with the predictor rate
+:math:`\dot\phi_p`, the rate at the mid-point of the previous step, and the committed phase
+advances by the implicit mid-point rule on the cross-flow motion at the step's mid-point, solved
+by one fixed-point pass from :math:`\dot\phi_p`,
+
+.. math::
+
+ \dot\phi_1 = \dot\phi\bigl(\dot y_m, \ddot y_m, \phi_n + \tfrac12\delta t\,\dot\phi_p\bigr),\qquad
+ \phi_{n+1} = \phi_n + \delta t\,\dot\phi\bigl(\dot y_m, \ddot y_m,
+ \phi_n + \tfrac12\delta t\,\dot\phi_1\bigr),
+
+ \dot y_m = \frac{\mathbf r_{n+1} - \mathbf r_n}{\delta t}\cdot\mathbf e_m,\qquad
+ \ddot y_m = \frac{\dot{\mathbf r}_{n+1} - \dot{\mathbf r}_n}{\delta t}\cdot\mathbf e_m,
+
+the step means of the velocity and of its derivative, so a harmonic motion keeps its phase
+between them exactly, with the axis :math:`\mathbf e_m` and the speed :math:`U` of the mean of
+the step's two states. The mid-point rate becomes the next step's :math:`\dot\phi_p` and is part
+of the VIV state. The
+running mean squares advance by the mid-point rule as well, the mean square of a sample
+:math:`s` as :math:`\overline{s^2} + (1 - e^{-\delta t/T_w})(s_m^2 - \overline{s^2})`, over
+:math:`\delta t/2` for the mid-point rate. The acceleration comes from the converged velocities
+because the generalised-α acceleration :math:`\mathbf a_n` is not the line's: it approximates
+:math:`\ddot{\mathbf r}(t_n + (\alpha_m - \alpha_f)\,\delta t)`, so a phase sampling it is
+first order in the step, and at :math:`\rho_\infty = 1` it carries an undamped alternating mode
+of the integrator, while :math:`(\mathbf v_{n+1} - \mathbf v_n)/\delta t` is the mid-point
+acceleration to second order at every :math:`\rho_\infty`. The lift's position and velocity
+derivatives enter the tangent. The cross-flow motion of the phase and the velocity in the lift
+are the node values averaged with the neighbours,
:math:`(\mathbf{x}_{i-1} + 2\mathbf{x}_i + \mathbf{x}_{i+1})/4`. That keeps a resolved mode of
wavenumber :math:`k` to :math:`\cos^2(k l_0/2)` and removes the mesh-scale zig-zag mode exactly.
With the node's own kinematics, a step that resolves the zig-zag mode lets the synchronisation
loop pump it until the line loses lock-in; a coarse step only hides this behind the
integrator's numerical damping.
+The locked-in response is second order in the time step at every :math:`\rho_\infty`. On the taut
+line of the ``viv_step_order`` test (20 m, 10 elements, pinned in a 0.3 m/s cross current, lock-in
+at 0.65 Hz with a mid-span A/D of 0.57), with :math:`n` steps per response period, the lock-in
+frequency is low by about :math:`2.2/n^2` at :math:`\rho_\infty` 1 and 0.8 and :math:`3.4/n^2` at
+0.4, and the mid-span RMS A/D high by about :math:`1.6/n^2` and :math:`3.4/n^2` (fitted from 80 to
+2700 steps per period against the Richardson limit, which is the same at every
+:math:`\rho_\infty` to 1e-9). The finite-EI cable gives :math:`3.5/n^2` for its frequency at
+:math:`\rho_\infty` 0.8, and the same limit at :math:`\rho_\infty = 1` when its seed carries the
+static stretch of the tangents (from unit tangents the undamped tangent-stretch mode rings at
+:math:`\rho_\infty = 1` and moves the response by up to 0.4 % at fine steps). 100 steps per
+response period therefore keep the frequency and the
+amplitude within 0.04 %, 30 within 0.4 %. A phase that samples :math:`\mathbf a_n`, as
+CableDyn's did before, is first order: the frequency low by about :math:`0.06/n` at
+:math:`\rho_\infty` 0.8 and :math:`0.25/n` at 0.4 (0.25 % at 100 steps per period), and at
+:math:`\rho_\infty = 1` it converges to a frequency 3.4 % low. The amplitude estimate of
+:ref:`theory-viv-amplitude` keeps the smoothing of Thorsen et al., :math:`k_a\,\delta t = 0.1`
+per step, a time of ten steps; it lags only a changing amplitude, and with an amplitude table the
+locked-in response of the same line is second order as well (the frequency low by about
+:math:`2.4/n^2`). The default ``VIVrmsWindow``, 500 steps as in MoorDyn, ties the averaging time
+to ``dtM``: a time-step study gives it in seconds. At :math:`\rho_\infty = 1` from an unbalanced
+seed (tangent lengths not at the static stretch) the VIV response is resolution-sensitive below
+about 50 steps per cycle (on the taut line 4.7 % high in amplitude at 25): keep ``rhoInf`` at or
+below 0.95 (:doc:`options`) or seed the tangents at the stretch.
+
On a finite-EI (cubic-Hermite) cable the lift is a distributed load per unit deformed length,
.. math::
@@ -1112,7 +1311,7 @@ points of the drag (a point above the surface carries none), and its exact posit
velocity derivatives enter the tangent. Each node carries a phase, driven as above by the
node's cross-flow motion along its own tangent, the slope degrees of freedom; :math:`d`,
:math:`c_F` and :math:`d_F` at a node are the length-weighted averages over its lifting
-elements. The phase is explicit with the Heun commit as on ``EI = 0`` lines, and no smoothing is
+elements. The phase advances as on ``EI = 0`` lines, and no smoothing is
needed: the Hermite tangent and the integrated lift leave no mesh-scale mode for the loop to
pump, and the response is the same from ``dtM`` 5e-4 to 1e-2 s. A finite-EI line with
:math:`EI \to 0` reproduces the ``EI = 0`` line's lock-in. The standalone Hermite march
@@ -1122,9 +1321,529 @@ deck waves and current through the held fluid field, on a line with one or two m
VIV runs on every route that carries the line: the standalone driver, the coupled OpenFAST
and FAST.Farm routes and the standalone runner of a mixed ``EI = 0`` / finite-EI deck. On the
coupled routes the phase follows the host's fluid field (a SeaState current or waves), and the
-phases, the running mean squares and the averaging time are part of the checkpoint state, so a
-restart continues the uninterrupted run bit for bit. The OpenFAST correction iterations rewind
-them with the rest of the state.
+phases, the running mean squares, the predictor and the averaging time are part of the
+checkpoint state, so a restart continues the uninterrupted run bit for bit. The OpenFAST
+correction iterations rewind them with the rest of the state.
+
+.. _theory-viv-inline:
+
+In-line vortex-induced vibration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A line type can add the in-line shedding force of the combined cross-flow and in-line
+model of :ref:`Ulveseter et al. (2018) `, a ``VIV`` section row
+``TypeName ClX [alpha]`` (see :doc:`file_formats`). A second phase :math:`\phi_x` per node drives
+a force along the relative normal flow, per unit deformed length
+
+.. math::
+
+ \mathbf{f}_x = \tfrac{1}{2}\rho\,d\,C_{x}\cos\phi_x\;U\,\mathbf{v}_n ,
+
+the direction of the drag, at twice the cross-flow frequency. Its phase is slaved to the
+cross-flow shedding phase :math:`\phi`, with a band :math:`\alpha` in which it locks onto the
+in-line motion :math:`\dot x = \dot{\mathbf{r}}\cdot\mathbf{v}_n/U`:
+
+.. math::
+
+ \dot\phi_x = 2\,\dot\phi\,\bigl[1 + \alpha\sin(\phi_{\dot x} - \phi_x)\bigr], \qquad
+ \phi_{\dot x} = \operatorname{atan2}\!\left(-\frac{\ddot x}{\ddot x_\text{rms}},\,
+ \frac{\dot x}{\dot x_\text{rms}}\right),
+
+with the running RMS values of the cross-flow phase (:math:`\phi_{\dot x} = 0` at a node with no
+in-line motion). Ulveseter et al. take :math:`C_x = 0.85` and :math:`\alpha = 0.15` (the default
+here) with a cross-flow :math:`C_L` of 0.65. The in-line phase starts at twice the cross-flow
+one, so the two start locked. The in-line rate is twice the cross-flow one, so ``ClX > 0``
+needs the type's cross-flow :math:`C_L > 0`. On an ``EI = 0`` line it is a node force like the
+lift,
+
+.. math::
+
+ \mathbf{F}_x = \tfrac{1}{4}\rho\,d\,C_x\,(l_{i} + l_{i+1})\,U\cos\phi_x\;\mathbf{v}_n ,
+
+with the lift's wetted fractions, node tangent and neighbour-averaged kinematics (for the phase
+and in the force). On a finite-EI cable it is integrated with the lift at the same Gauss points,
+:math:`\cos\phi_x` interpolated between the element's end nodes. Its exact position and velocity
+derivatives enter the tangent on both. The phase advances as the cross-flow one, by the
+mid-point rule with its rate slaved to the mid-point cross-flow rate and its own predictor rate.
+The phase, the two mean squares and the predictor are part of the step-recovery, snapshot and
+checkpoint state, and a ``ClX`` of zero leaves the run exactly as without the row. On the taut
+line of ``viv_taut_cable_inline.dat`` the quarter span moves in line at twice the cross-flow
+frequency, A/D 0.19 against 0.03 with the cross-flow lift alone, and the same line as an
+``EI = 0`` line gives the cable's amplitudes within 1 %.
+
+A fourth column ``Chh`` adds the higher-harmonic force of
+:ref:`Ulveseter et al. (2019) `, the lift's form at the sum of the two phases,
+
+.. math::
+
+ \mathbf{f}_{hh} = \tfrac{1}{2}\rho\,d\,C_{hh}\cos(\phi + \phi_x)\;U\,
+ (\mathbf{t}\times\mathbf{v}_n) .
+
+With the cross-flow phase at the frequency :math:`\omega` and the in-line one at :math:`2\omega`
+it acts across the flow at :math:`3\omega`, and, through the turn of the relative flow by the
+motion, at :math:`\omega` and :math:`5\omega` across and :math:`2\omega` and :math:`4\omega` along the flow. It takes no
+state of its own: on a finite-EI cable it adds :math:`k_{hh}\cos(\phi + \phi_x)` to the node
+values of the lift scale the element integrates, on an ``EI = 0`` line it is a second node lift
+at the phase sum, and its derivatives enter the tangent with the lift's. Ulveseter et al. use
+:math:`C_{hh}` from 0 to 1.5 (with :math:`C_{v,y}` 0.85 and :math:`C_{v,x}` 0.75). On the
+in-line example with ``Chh`` 1.0 the quarter-span in-line response at four times the cross-flow
+frequency grows from A/D 0.002 to 0.007, the same on an ``EI = 0`` line.
+
+.. _theory-viv-wake:
+
+Wake oscillator
+~~~~~~~~~~~~~~~
+
+A ``WAKE OSCILLATOR`` row ``TypeName CL0 [St [eps [A]]]`` replaces the synchronisation model of a
+line type by the wake oscillator of :ref:`Facchinetti et al. (2004) `,
+distributed along the line as in :ref:`Violette et al. (2010) `. At each node a
+van der Pol oscillator in the reduced lift coefficient :math:`q = 2C_L/C_{L0}` stands for the
+near wake, forced by the node's cross-flow acceleration :math:`\ddot y` (the acceleration
+coupling Facchinetti et al. found to reproduce lock-in, the Griffin plot and the effective added
+mass):
+
+.. math::
+
+ \ddot q + \varepsilon\,\omega_f\,(q^2 - 1)\,\dot q + \omega_f^2\,q = \frac{A}{D}\,\ddot y,
+ \qquad \omega_f = 2\pi\,\mathrm{St}\,\frac{U_a}{D},
+
+with :math:`U_a` the speed of the ambient flow (current and host field) normal to the line, the
+free stream of the paper, so that the cable's own cross-flow velocity does not modulate the wake
+frequency, and :math:`\ddot y` along the cross-flow axis :math:`\mathbf t\times\mathbf v_n/U` of
+the synchronisation model. The ambient flow sets no frequency for a cable moved through still
+water, which then never sheds; a ``VIV FRAME`` row with the filter time :math:`T_f > 0` takes
+:math:`U_a` relative to the node's velocity low-pass filtered over :math:`T_f`,
+
+.. math::
+
+ U_a = \bigl|(\mathbf u - \bar{\mathbf v})_n\bigr|,\qquad
+ \bar{\mathbf v}_{n+1} = e^{-h}\,\bar{\mathbf v}_n + \bigl(1 - e^{-h}\bigr)\mathbf v_n
+ + \Bigl(1 - \frac{1 - e^{-h}}{h}\Bigr)(\mathbf v_{n+1} - \mathbf v_n),\qquad
+ h = \delta t/T_f,
+
+the exact first-order filter of the converged velocity linear over the step, started at the
+node's initial velocity. The slow motion (a tow, a floater's response) then counts as flow, and the
+VIV velocity, far faster than :math:`T_f`, is filtered out. On a cable towed at 0.15 m/s through
+still water (the taut cable of the deck gate, VIV at 0.28 Hz) :math:`T_f` 10 s gives the lock-in of
+the cable held in a 0.15 m/s current to 0.6 % in A/D and 0.001 Hz, where the ambient flow gave no
+lock-in; on the held cable it changes A/D by 0.03 %. :math:`\bar{\mathbf v}` is part of the wake
+state. The lift per unit length acts across the relative normal flow
+:math:`\mathbf v_n` of speed :math:`U`, as the synchronisation lift does:
+
+.. math::
+
+ \mathbf f = \tfrac{1}{4}\rho\,D\,C_{L0}\,q\;U\,(\mathbf t\times\mathbf v_n) ,
+
+the synchronisation lift with :math:`C_L\cos\phi` replaced by :math:`C_{L0}q/2`: a free wake
+settles on the limit cycle :math:`q = 2\cos\omega_f t`, the lift :math:`C_{L0}` of a fixed
+cylinder. The defaults St 0.2, :math:`\varepsilon` 0.3 and :math:`A` 12 are theirs, fixed from
+forced-wake data with :math:`C_{L0}` 0.3, which the row gives. Their
+fluid-added damping :math:`\gamma\,\omega_f\,\rho D^2\dot y` with
+:math:`\gamma = C_D/(4\pi\mathrm{St})` is the linearised Morison drag, which CableDyn applies
+in full, and their inviscid added mass is the Morison :math:`C_a`; the wake adds the lift only.
+
+The wake state :math:`(q, \dot q)` of a node is integrated beside the cable, as the phase of the
+synchronisation model is. At the start of a step it is advanced under the predictor, the
+cross-flow acceleration at the mid-point of the previous step, at the step-start
+:math:`\omega_f`, to give the :math:`q` the step's lift takes; at the converged end it is advanced
+again from the committed state under the mid-point acceleration
+:math:`(\dot{\mathbf r}_{n+1} - \dot{\mathbf r}_n)\cdot\mathbf e_m/\delta t` (held over the
+step, its integral exact), at the mean of the start and end :math:`\omega_f`, and committed, the
+mid-point acceleration becoming the next predictor: second order in the step, as the phase of the
+synchronisation model. Both use classical Runge-Kutta in equal sub-steps of
+:math:`r\,\delta t \le 0.1`, :math:`r = \omega_f\max(1, \varepsilon q^2)` the faster of the
+oscillation and the van der Pol damping rate at the start of the interval, so a large
+:math:`\varepsilon` stays resolved; should the rate exceed :math:`0.2/\delta t` on the way, or the
+result not be finite, the interval is redone with twice the sub-steps. The lift is integrated on a finite-EI cable at the Gauss
+points of the synchronisation lift, :math:`q` interpolated between the element's end nodes, with
+its exact position and velocity derivatives in the tangent at fixed :math:`q`. On an ``EI = 0``
+line it acts at the free nodes as the synchronisation lift does, over the node's tributary length,
+with the node's smoothed velocity (the average with its two neighbours) in the forcing, and
+:math:`(q, \dot q)` takes the place of the phase and the first motion statistic in the line's
+VIV state, the predictor the second (with :math:`T_f`, :math:`\bar{\mathbf v}` the next three
+statistics, and three more state rows on a finite-EI cable). :math:`q` starts on
+its limit cycle at the node's phase seed, :math:`q = 2\cos\phi_0`, :math:`\dot q = 0`, and the
+state is part of the step-recovery, snapshot and checkpoint state.
+
+The kernel reproduces the limit cycle (amplitude 2.001, the van der Pol period shift of
+:math:`\varepsilon^2/16`), and forced at its own frequency by a cylinder moving as
+:math:`y_0 D\cos\omega_f t` it follows the lift magnification of their Eq. 17 within 0.2 % at
+:math:`y_0 = 0.05` and 1.9 % at :math:`y_0 = 0.5`, the gap growing with the third harmonic their
+one-harmonic balance leaves out. On the taut cable of ``viv_taut_cable_inline.dat`` with
+``Cl`` 0 and ``CL0`` 0.3 the cable locks in at 0.282 Hz, below the wake's own 0.30 Hz, at a
+steady mid-span A/D of 0.58; with :math:`A` = 0 the uncoupled wake drives it at 0.298 Hz at A/D
+0.10, and over the lock-in the drag and damping take out the wake lift's power within 0.3 %. The
+same line with ``EI = 0`` locks in at 0.283 Hz (one 0.001 Hz step from the cable) and A/D 0.586
+(0.1 % from the finite-EI cable), and 0.099 uncoupled (0.3 %). The wake oscillator acts on
+finite-EI cables and ``EI = 0`` lines, cross-flow only.
+
+.. _theory-viv-amplitude:
+
+Amplitude-dependent coefficients
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A ``VIV AMPLITUDE`` table makes the cross-flow coefficient of the synchronisation model and the
+normal drag coefficient of a line type functions of the cross-flow amplitude, the form of
+:ref:`Thorsen et al. (2016) `, who fit an excitation curve
+:math:`C_v(y_0/D)` to riser tests. Each node estimates its amplitude as they do (their Eq. 8 and
+9):
+
+.. math::
+
+ y_0 = \frac{1}{2}\int_{t_1}^{t_2} |\dot y|\,\mathrm{d}t, \qquad
+ \frac{\mathrm{d}y_0^*}{\mathrm{d}t} = k_a\,(y_0 - y_0^*), \quad k_a = \frac{0.1}{\Delta t},
+
+with :math:`t_1, t_2` the last two zero crossings of :math:`\dot y` (a narrow-band response
+travels :math:`2y_0` between them) and :math:`y_0^*` the smoothed amplitude, which moves a tenth
+of the way to :math:`y_0` in each time step :math:`\Delta t`. :math:`\dot y` is the node's
+velocity across the ambient flow normal to the line, :math:`\dot{\mathbf r}\cdot(\mathbf t\times
+\mathbf u_n)/|\mathbf u_n|`: their :math:`y` is measured across the incoming flow, and the
+cross-flow axis of the phase, across the relative flow, turns with the node's own velocity, which
+at a response velocity comparable to the flow would shorten the projected velocity by
+:math:`U/|\mathbf v_n|` (16 % at the A/D of 0.68 of the gate below); a ``VIV FRAME`` row takes the
+flow and the velocity relative to the cable's filtered motion (:ref:`theory-viv-frame`). The
+travel is integrated by the trapezoidal rule over each step, with a crossing inside a step
+placed by linear interpolation; the error is that of the rule, :math:`(\omega\Delta t)^2/12` relative for a harmonic response.
+The travel is carried signed, :math:`\int\dot y\,\mathrm{d}t` since the last crossing, whose sign
+is that of the half cycle: a velocity that reverses through a sample at zero ends the half cycle
+there, and one that touches zero without a sign change ends none.
+
+An element takes the mean :math:`y_0^*` of its free nodes (the VIV nodes; a fixed end node has
+none) over its diameter as :math:`A/D` and reads its table there: :math:`C_v` in place of ``Cl`` in the lift, and a factor of ``Cd`` in the
+normal Morison drag, linear between rows and held beyond the end ones. The coefficients of a step
+use the estimate of the committed state, so the Jacobians only scale. The estimate is updated at
+the end of each converged step from the committed one, so a repeated or rewound step updates it
+once, and it is part of the step-recovery, snapshot and checkpoint state.
+
+On the taut line of the wake-oscillator gate (Cl 0.8, ``EI = 0`` and finite-EI alike) the
+smoothed mid-span estimate follows the half peak-to-peak cross-flow displacement of the steady
+response within 0.04 % at A/D 0.68 (0.1 % on the ``EI = 0`` line); a table whose :math:`C_v`
+falls from 0.8 at A/D 0.1 to zero at 0.3 holds the response at A/D 0.28; :math:`C_v = 0` with a drag factor 2 settles at the static
+offset of ``Cd`` 2.4 to six digits; and a table with :math:`C_v` = ``Cl`` and factor 1 is the
+line without it, bit for bit.
+
+.. _theory-viv-diameter:
+
+VIV diameter
+~~~~~~~~~~~~
+
+A ``VIV DIAMETER`` row gives the VIV model of a line type a diameter :math:`D_v` of its own. The
+shedding frequency :math:`2\pi(c_F + d_F\sin(\phi_y - \phi))U/D_v` (or the wake frequency
+:math:`2\pi\,\mathrm{St}\,U_a/D_v` with the coupling :math:`A/D_v`), the VIV forces
+:math:`\tfrac12\rho D_v C U^2` and the amplitude ratio :math:`y_0^*/D_v` of a ``VIV AMPLITUDE``
+table take it, while the drag, added mass, buoyancy and contact keep the type's ``Diam``. It
+serves a section whose shedding is set by a larger outer diameter than its hydrodynamic one, as a
+buoyancy-module zone whose modules are ATTACHMENTS on the bare cable: a copy of the cable's type
+with :math:`D_v` the module diameter and its own synchronisation coefficients. The shedding of
+such a zone, where modules and bare cable alternate, has no established model; :math:`D_v` and
+the coefficients are the user's.
+
+On the taut line of the wake-oscillator gate (``Diam`` 0.1 m) the synchronisation model locks in
+near the first mode, at 0.287 Hz; with :math:`D_v` = 0.2 m its band,
+0.075-0.195 Hz, lies below the mode, where the motion lags the lift by less than a quarter period
+and the phase runs at the top of the band, 0.196 Hz, on ``EI = 0`` lines and finite-EI cables
+alike; an uncoupled wake oscillator (:math:`A` = 0) drives the cable at 0.149 Hz against
+:math:`\mathrm{St}\,U/D_v` = 0.15 Hz; and :math:`D_v` equal to ``Diam`` is the line without the row,
+bit for bit.
+
+.. _theory-viv-cf-damping:
+
+Cross-flow damping
+~~~~~~~~~~~~~~~~~~
+
+A ``VIV DAMPING`` row splits the normal Morison drag of a finite-EI line type in the frame of the
+ambient flow. With :math:`\mathbf t` the tangent, :math:`\mathbf u_n` the ambient flow normal to
+it, :math:`\mathbf e_x = \mathbf u_n/|\mathbf u_n|` and :math:`\mathbf e_y = \mathbf t\times\mathbf e_x`,
+the relative normal velocity :math:`\mathbf w` splits into :math:`w_x` and :math:`w_y`, and
+
+.. math::
+
+ \mathbf f_n = \tfrac12\rho D\left[C_{dn}A_d\,|\mathbf w|\,w_x\,\mathbf e_x
+ + \left(C_{dy}|w_y| + c\,C_{dn}|\mathbf w|\right)w_y\,\mathbf e_y\right],\qquad
+ C_{dy} = a + b\,\frac{y_0^*}{D},
+
+with :math:`A_d` the drag factor of the type's amplitude table and :math:`y_0^*` its amplitude
+estimate (:ref:`theory-viv-amplitude`). The quadratic term is the cross-flow hydrodynamic damping of
+:ref:`Thorsen et al. (2016) ` (their Eq. 1, :math:`a = 0.31`, :math:`b = 0.89`
+from the still-water decay tests of Vikestad et al. 2000, valid for :math:`y_0/D` up to about
+0.6). The :math:`c` term is Morison's own cross-flow drag. Where :math:`|\mathbf u_n|` falls below
+:math:`u_{ref} = 0.01` m/s the axes are undefined, and :math:`\mathbf f_n` blends to Morison's as
+:math:`\beta\,\mathbf f_s + (1-\beta)\,\mathbf f_M` with :math:`\beta = U^2/(U^2 + u_{ref}^2)`.
+The force and its Jacobians in the relative velocity and in the tangent are exact, and the
+tangential drag is unchanged. With a ``VIV FRAME`` row the axes and the blend take the ambient flow
+relative to the cable's filtered motion (:ref:`theory-viv-frame`).
+
+The row serves two uses:
+
+- With :math:`(0, 0, 1)` and the drag factor of :ref:`Chaplin et al. (2005) `,
+ the amplification acts on the in-line drag alone, while the cross-flow drag stays Morison's
+ (validation case L3-D, the Delta Flume riser in a stepped current). The factor is measured on
+ the mean drag, but it multiplies the whole in-line term, so the in-line damping
+ :math:`-\tfrac12\rho D C_{dn}A_d|\mathbf w|\,\dot x` rises with it.
+- :math:`(0.31, 0.89, 0)` is Thorsen's cross-flow model. It drops the linear part
+ :math:`\tfrac12\rho D C_{dn}U\dot y` of Morison's cross-flow damping, so it is consistent with
+ cross-flow VIV alone. An in-line force that turns with the relative flow can then drive an
+ undamped low-frequency cross-flow motion.
+
+On the taut gate line, :math:`(0, 0, 1)` with factor 1 is the line without the row to round-off;
+with :math:`C_v = 0` and factor 2 the line settles at the static in-line offset of ``Cd`` 2.4 to the
+printed digits; Thorsen's form raises the steady cross-flow amplitude from :math:`A/D` 0.68 to 1.01;
+and the drag, damping and VIV powers balance within 0.2 %.
+
+.. _theory-viv-frame:
+
+Flow frame of the synchronisation model
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The synchronisation model takes the node's motion in the earth frame. Its phase reads the
+cross-flow velocity :math:`\dot{\mathbf r}\cdot\mathbf e` across the relative flow, which is
+:math:`\mathbf u\cdot\mathbf e` and so zero in still water; the amplitude estimate and the
+cross-flow damping are defined across the ambient flow, which still water does not have. A cable
+moved through still water, by a tow or by its floater, therefore locks its phase on
+:math:`\ddot y` alone, keeps :math:`y_0^* = 0`, :math:`C_v(0)` and the drag factor at 0, and its
+damping blends to Morison's, while the same problem in the cable's frame (the water moving past
+the held cable) does not. A ``VIV FRAME`` row with :math:`T_f > 0` on a synchronisation type
+(LINE TYPES ``Cl > 0``) takes these quantities in the frame of the node's filtered velocity
+:math:`\bar{\mathbf v}` of :ref:`theory-viv-wake` (the same filter, started at the node's
+velocity):
+
+- the phases (cross-flow, and in-line where it runs) take :math:`\dot{\mathbf r} -
+ \bar{\mathbf v}` along their axes, which the relative flow sets, so the axes and the shedding
+ speed :math:`U` stay those of the relative flow; the acceleration stays the node's, since
+ :math:`\bar{\mathbf v}` changes slowly and its rate :math:`(\mathbf v - \bar{\mathbf v})/T_f`
+ would carry the VIV velocity;
+- the amplitude estimate takes
+
+ .. math::
+
+ \dot y = (\dot{\mathbf r} - \bar{\mathbf v})\cdot
+ \frac{\mathbf t\times(\mathbf u - \bar{\mathbf v})_n}{|(\mathbf u - \bar{\mathbf v})_n|},
+
+ and with it the table's :math:`C_v`, drag factor and :math:`C_{dy}`;
+- the damping takes :math:`\mathbf e_x`, :math:`\mathbf e_y` and the blend :math:`\beta` from
+ :math:`(\mathbf u - \bar{\mathbf v})_n`, an element the mean :math:`\bar{\mathbf v}` of its end
+ nodes.
+
+:math:`\bar{\mathbf v}` is held over a step (the step-start value), so the Jacobians are
+unchanged, and it is updated at the converged end, exactly for the velocity linear over the step;
+the phases take the mean of its start and end values, at the step's mid-point. The lift and the
+drag act on the relative velocity, which does not depend on the frame, and are unchanged. For a
+frame moving at a constant velocity (a steady tow) the model is that of the held cable exactly.
+The velocity relative to :math:`\bar{\mathbf v}` loses the part of the VIV velocity that passes the filter: for a response
+at :math:`\omega` it is scaled by :math:`\omega T_f/\sqrt{1 + \omega^2 T_f^2}` and led by
+:math:`\arctan(1/\omega T_f)` (0.9985 and 3.1° at 0.29 Hz with :math:`T_f` 10 s). For a motion at
+:math:`\omega_m` the filter lags by :math:`\arctan\omega_m T_f`. :math:`T_f` is therefore taken
+several VIV periods long and short against the motion. The two conditions hold together only for
+a motion much slower than the VIV: keeping about 95 % of the VIV velocity
+(:math:`\omega T_f \ge 3`) while leaving at most 10 % of the motion's velocity in the relative
+velocity (:math:`|1 - H(\omega_m)| = \omega_m T_f/\sqrt{1 + \omega_m^2 T_f^2} \le 0.1` with the
+filter's :math:`H(\omega) = 1/(1 + i\omega T_f)`, so :math:`\omega_m T_f \le 0.1`) needs :math:`\omega/\omega_m \ge 30`, a motion period at least 30
+VIV periods long. For a motion only a few VIV periods long no :math:`T_f` separates the two, and
+the response depends on :math:`T_f`.
+
+A pipe of the displaced mass (20 m, :math:`D` 0.1 m, ``Cl`` 0.8) moved in still water with
+velocity amplitude 0.6 m/s and period 40 s, against the same pipe held in the water moving the
+other way (the held fluid field, so the Froude-Krylov load acts; a pipe of another mass would
+differ by :math:`(m - \rho A)\dot V`), with :math:`T_f` 0.6 s:
+
+.. list-table::
+ :header-rows: 1
+
+ * - Pipe
+ - Frame
+ - Peak A/D moving / held
+ - RMS A/D moving / held
+ * - Amplitude table and Thorsen's damping
+ - ``Tf`` 0.6 s
+ - 0.811 / 0.818
+ - 0.446 / 0.446
+ * -
+ - none
+ - 0.700 / 0.851
+ - 0.345 / 0.450
+ * - ``Cl`` alone
+ - ``Tf`` 0.6 s
+ - 0.713 / 0.712
+ - 0.372 / 0.370
+ * -
+ - none
+ - 0.700 / 0.733
+ - 0.345 / 0.374
+
+With the row the RMS of the two frames agrees within 0.6 % (0.02 % with the table) and the peak,
+a single extreme, within 1 % (with the step-start phase update the moving pipe's peak ranged
+0.811-0.819 over builds, OpenBLAS kernels and platforms), the rest being the filter's lag
+(:math:`\omega_m T_f` = 0.094). A taut cable towed at 0.15 m/s with :math:`T_f` 10 s gives A/D
+0.7902 against 0.7903 held in the current with the same row (0.792 without it; 0.663 towed without
+the row) with the table and damping, and 0.6758 against 0.6758 with ``Cl`` alone. On the held
+cable :math:`T_f` changes A/D by at most 0.24 % on both line kinds. :math:`\bar{\mathbf v}` takes
+rows 7-9 of the node's motion statistics on both line kinds (nine rows; rows 3-6, the amplitude
+estimate, stay 0 without a table), so it is part of the step-recovery, snapshot and checkpoint
+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
+~~~~~~~~~~~~~~~~~~~~~~
+
+The synchronisation band of :ref:`theory-viv` has a constant centre :math:`\hat f_0` (``cF``), so
+a long cable in a steady current settles on one response. Measured high-mode responses wander in
+amplitude and frequency. Ulveseter et al. (2017, Eq. 6) make the centre a slowly varying random
+process; a ``VIV STOCHASTIC`` row gives a line type this centre:
+
+.. math::
+
+ \hat F_0(t) = \hat f_0 + \sum_{i=1}^{N_f} a\,\sin\bigl(p_i + 2\pi \hat f_i\,\theta(t)\bigr),
+ \qquad \theta(t) = \int_0^t \frac{U}{D}\,\mathrm d t ,
+
+with :math:`U` the shedding speed of the phase rate. The spectrum is flat over
+:math:`(0, c\,\hat f_0]` (their Fig. 4); its :math:`N_f` components sit at the mid-points
+:math:`\hat f_i = (i - 1/2)\,c\,\hat f_0/N_f` of equal intervals with the amplitude
+:math:`a = \sigma\sqrt{2/N_f}`, so :math:`\hat F_0` has the mean :math:`\hat f_0` and the standard
+deviation :math:`\sigma`, and for many components it is close to Gaussian. Each component advances
+at its non-dimensional frequency times :math:`U/D`, as the shedding phase does, which keeps the
+process free of the fluctuation of :math:`U` that a time-based phase would carry (their Fig. 5);
+for :math:`c \ll 1` it is slow against the VIV, so the response has time to build up before the band
+moves. The half-width :math:`\Delta\hat f` (``dF``) stays constant. The start phases
+:math:`p_i` are uniform on :math:`[0, 2\pi)` and independent between nodes, as in the article (no
+spanwise correlation). Ulveseter et al. take :math:`N_f` 100, :math:`c` 0.07 and :math:`\sigma`
+0.016 for the NDP riser, and 0.040 as an upper case.
+
+**Implementation.** Each lifting node carries :math:`\theta` as one more row of its motion
+statistics. The step advances it by :math:`\Delta t\,U/D` with :math:`U` at the step's mid-point,
+and the phase rate takes :math:`\hat F_0` at :math:`\theta + \Delta t\,U/(2D)`, so the centre follows
+the mid-point rule of the phase (:ref:`theory-viv`). The phases :math:`p_i` come from a
+minimal-standard generator seeded by the row's seed, the line and the node, so a run repeats its
+realisation and needs no stored phases: :math:`\theta` alone is part of the step-recovery,
+snapshot and checkpoint state. The process over :math:`\theta` = 0 to :math:`4\times 10^6` (about
+200 periods of the lowest component) with the NDP values has the mean :math:`\hat f_0` to
+:math:`2\times 10^{-6}`, the standard deviation :math:`\sigma` to four digits and an excess kurtosis of
+-0.18. A row with :math:`\sigma` = 0 leaves the run unchanged to the bit; with :math:`\sigma` 0.02 the
+taut cable of the flow-frame gates stays locked in (A/D within 1 % of the constant centre's over
+50-80 s on both line kinds). A seed is one realisation: statistics of a response need several.
+
+.. _theory-viv-coefficients:
+
+Published coefficient sets
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The VIV coefficients are empirical, and the published sets differ by test, Reynolds number range
+and model form. The table gives each set with its source and the line-type columns it maps to.
+``Cl dF cF`` are the cross-flow columns of the line type, with the synchronisation band
+:math:`c_F \pm d_F` in non-dimensional frequency; ``ClX alpha`` is the ``VIV`` section row.
+
+.. list-table::
+ :header-rows: 1
+ :widths: 30 34 36
+
+ * - Source and data
+ - Values
+ - In CableDyn
+ * - :ref:`Thorsen et al. (2016) `: excitation curve fitted to the 44 NDP
+ riser tests (uniform and sheared flow, Re 8 000–65 000), their Fig. 7
+ - :math:`C_v(y_0/D)`: 0.35 at 0, a maximum of 1.00 at 0.46, zero from 0.66; cross-flow
+ damping :math:`C_{d,y} = 0.31 + 0.89\,y_0/D` (their Eq. 1)
+ - a ``VIV AMPLITUDE`` table (below); ``VIV DAMPING`` ``0.31 0.89 0``
+ * - :ref:`Thorsen et al. (2017) `: the truncated catenary riser of
+ :ref:`Wang et al. (2014) ` in uniform current (Re about 3 000) and under
+ heave motion of its upper end (Re about 4 000)
+ - :math:`C_v` 0.7 in the current, 0.8 in heave; :math:`\hat f_0` 0.18,
+ :math:`\Delta\hat f` 0.08, :math:`C_D` 1.2, :math:`C_M` 2
+ - ``Cl dF cF`` = ``0.7 0.08 0.18`` (current) or ``0.8 0.08 0.18`` (heave), ``Cd_n`` 1.2,
+ ``Ca_n`` 1.0 (validation cases L3-W and L3-Wh)
+ * - :ref:`Ulveseter et al. (2018) `: in-line force at twice the
+ cross-flow frequency
+ - :math:`C_x` 0.85, :math:`\alpha` 0.15, with a cross-flow :math:`C_L` of 0.65
+ - ``VIV`` row ``0.85 0.15``; ``Cl`` 0.65
+ * - :ref:`Andersen et al. (2024a) `, Table 3: the set calibrated to
+ low-Re forced-oscillation tests that they quote as the model's fixed values
+ - :math:`C_v` 1.2, :math:`C_D` 1.1, :math:`C_a` 1.0, :math:`\hat f_0` 0.18, band
+ 0.11–0.26
+ - ``Cl`` 1.2, ``Cd_n`` 1.1, ``Ca_n`` 1.0; the band here is symmetric about ``cF``:
+ ``dF cF`` = ``0.075 0.185`` spans 0.11–0.26
+ * - :ref:`Andersen et al. (2024a) `: Bayesian optimisation against seven
+ tests of a rigid cylinder on a spring-supported pendulum rig (Re 4.2e4–1.2e5)
+ - unified :math:`C_v` "very close to 2.0"; the per-case optima scatter with flow speed
+ - ``Cl`` 2.0 (no unified band is tabulated)
+ * - :ref:`Andersen et al. (2024b) `, Table 3: average of the per-case
+ optima for the 22 sheared-flow NDP tests
+ - cross-flow :math:`C_{v,y}` 1.28, :math:`\hat f_{0,y}` 0.131, :math:`\Delta\hat f_y` 0.066;
+ :math:`C_D` 1.16, :math:`C_a` 1.0
+ - ``Cl dF cF`` = ``1.28 0.066 0.131``, ``Cd_n`` 1.16; their in-line set (:math:`C_{v,x}`
+ 1.09, :math:`\hat f_{0,x}` 0.321) belongs to an independent in-line synchronisation, not
+ the ``VIV`` row's form
+ * - :ref:`Facchinetti et al. (2004) `: wake oscillator with
+ acceleration coupling, fitted to forced-cylinder lift and lock-in data
+ - :math:`C_{L0}` 0.3, St 0.2 (sub-critical, :math:`300 < Re < 1.5\times10^5`),
+ :math:`\varepsilon` 0.3, :math:`A` 12
+ - ``WAKE OSCILLATOR`` row ``0.3 0.2 0.3 12``
+
+Thorsen et al. (2016)'s curve, read from the vector figure and sampled every 0.05 in
+:math:`y_0/D`, as a ``VIV AMPLITUDE`` table for a type ``riser`` (its ``Cv`` replaces ``Cl``;
+the drag factor stays 1):
+
+.. code-block:: text
+
+ --------------------- VIV AMPLITUDE ------------------------------------
+ TypeName AD Cv
+ (-) (-) (-)
+ riser 0.00 0.35
+ riser 0.05 0.48
+ riser 0.10 0.60
+ riser 0.15 0.70
+ riser 0.20 0.79
+ riser 0.25 0.86
+ riser 0.30 0.92
+ riser 0.35 0.96
+ riser 0.40 0.99
+ riser 0.45 1.00
+ riser 0.50 0.98
+ riser 0.55 0.82
+ riser 0.60 0.53
+ riser 0.65 0.10
+ riser 0.70 0.00
+
+The sets do not transfer between structures without checking: Andersen et al. find optima that
+scatter between tests with no trend in Reynolds number, and Thorsen et al. state that their curve
+holds only in the Reynolds number range of the tests it was fitted to.
.. _theory-dry-buoyancy:
@@ -1140,11 +1859,24 @@ On the ``EI = 0`` path, an element crossing the free surface uses its wetted fra
Drag, added mass, and fluid inertia act on the wetted part (drag with the wet-weighted relative
velocity), and a recovery load :math:`-(1 - f)\,\tfrac{1}{2}\rho A g L_0` on each end node removes
the buoyancy of the dry part; the derivatives of :math:`f` with respect to the nodal heights are
-included in the tangent. On the Hermite path the hydrodynamic loads are integrated over the
-deformed element length at three Gauss points, and a Gauss point above the local surface
-carries no load. This is exact for fully submerged elements, the regime of lazy-wave cables and
-moorings, and approximates the wetted length of a surface-piercing element by the Gauss
-sampling. The Hermite buoyancy recovery is exact: the waterline crossings of the cubic
+included in the tangent. On the Hermite path the hydrodynamic loads (drag, added mass, the wave
+Froude-Krylov load and the VIV lift) are integrated over the deformed element length at the
+Gauss points, each weighted by the immersed fraction of its section, linear across one diameter:
+
+.. math::
+
+ w = \min\left(1, \max\left(0, \tfrac12 + \frac{\eta - z_g}{D}\right)\right),
+
+with :math:`z_g` the height of the Gauss point and :math:`\eta` the local surface. A point
+deeper than :math:`D/2` has :math:`w = 1` exactly, so fully submerged elements, the regime of
+lazy-wave cables and moorings, are integrated as before to the bit; across the surface the load
+of a point is continuous in its height (with :math:`\partial w/\partial z_g = -1/D` in the
+tangent). In waves a point above the instantaneous surface inside the band takes the wave velocity
+and acceleration at the surface, where the Wheeler-stretched field vanishes above it. A wet/dry
+switch per point made the load jump, and a static equilibrium with a Gauss point at the surface
+then had no root: a 31 mm cable through the surface in a 0.400 m/s cross current
+failed every static route while 0.399 and 0.401 m/s solved. The Hermite buoyancy recovery is
+exact: the waterline crossings of the cubic
centreline height are located on each element, and the load :math:`\rho g A` is integrated in
closed form against the Hermite shape functions over the dry intervals,
@@ -1957,7 +2689,12 @@ pitchfork: the equilibrium beyond it turns the grounded run sideways on the seab
anchor and back (a lazy wave in a 0.7 to 1.2 m/s current along its plane, for example).
Newton cannot leave the plane of a symmetric problem, so the line is then solved in 3D under
the current with a cross-flow of 1 % of its horizontal speed, and that state is polished at
-the exact current and audited like any other. A planar equilibrium in such a current is also
+the exact current and audited like any other. The cross-flow points to the left of the
+horizontal chord from the anchor (End B) to the fairlead (End A), along :math:`+y` for a
+vertical chord, so the side the line leaves its plane to turns with the line: the same deck
+rotated about the vertical reaches the rotated equilibrium. Both sides are equilibria of the
+symmetric problem; a deck that needs one gives its current a small cross component of its own,
+and the static solve then follows that side. A planar equilibrium in such a current is also
checked with the line free to leave its plane; one that is a saddle there (the grounded run
held in the plane only by the symmetry) is replaced by this 3D solve; when the 3D solve finds
no equilibrium, the planar one is kept and a note says that it is held in the plane of the line
@@ -2382,6 +3119,17 @@ over the translational free DOFs, and from the Newmark predictor otherwise (and
under-resolved mode rings, a loosely converged step would keep the extrapolated acceleration,
whereas the zero guess damps it. A failed constant-acceleration attempt is re-solved from the
Newmark predictor. The test uses only the committed state, so a restart is exact.
+On a Hermite step either guess holds a free nodal tangent at its committed value where it
+would change the tangent's length, the stretch, by more than a quarter (a strain change of 0.25
+in one step). A tangent with some components fixed (a planar model fixes the out-of-plane one)
+is held on its free components, by their change of the length. The stretch is the line's stiffest motion (:math:`EA` against the tangents' small
+consistent mass), and with little numerical damping (:math:`\rho_\infty` near 1) an offset of it
+rings on with a committed velocity and acceleration far larger than the motion they make: a
+taut line seeded with unit tangents, :math:`7.6\times10^{-5}` off its elements' stretch, had
+every tangent carried across zero at 50 steps per VIV cycle, and Newton converged to the root
+with every element folded back along its chord. A guess that only turns a tangent is kept (a
+line turning fast is often right). A step that still ends with a tangent turned by 90° or more
+fails, and the next attempt or the step recovery re-solves it.
The ``EI = 0`` path uses an Armijo line search on :math:`\tfrac{1}{2}\lVert\mathbf{G}\rVert^2`
and converges when :math:`\lVert\mathbf{G}\rVert_\infty` relative to the larger of the external
load and the initial residual falls below the relative tolerance, or below the absolute
@@ -2396,10 +3144,22 @@ residual decreases; its convergence norm divides each translational residual by
frozen at the predictor and each tangent-DOF residual additionally by the nodal tributary
length. The force scale is the largest inertial or residual entry, bounded below by 1 N, by the
peak element weight, and by the round-off floor
-:math:`16\,\epsilon\,\max\big((EA + BA\,\gamma/(\beta\,\Delta t))/L_0\big)\,x_\text{ref}/\text{tol}`
-of the axial forces (:math:`x_\text{ref}` the largest coordinate magnitude or element length;
-the axial damping takes the strain rate from the Newmark velocity, whose rounding is
-:math:`\gamma/(\beta\,\Delta t)` times that of the coordinates). The
+:math:`16\,\epsilon\,\max\big((EA + BA\,\gamma/(\beta\,\Delta t))/L_0,\ (EI + B_b\,\gamma/(\beta\,\Delta t))/L_0^3\big)\,x_\text{ref}/\text{tol}`
+of the axial and bending forces (:math:`x_\text{ref}` the largest coordinate magnitude or element
+length; the axial and bending damping take the strain and curvature rates from the Newmark
+velocity, whose rounding is :math:`\gamma/(\beta\,\Delta t)` times that of the coordinates). The
+bending term is the larger on a soft line (a tensioner in series, a fine mesh) with bending
+damping at a small time step. The inertia takes the acceleration
+:math:`(\mathbf q - \mathbf q_n)/(\beta\,\Delta t^2) - \dots` from the coordinates, so a row's
+inertial force cannot be resolved finer than about
+:math:`\epsilon\,\sum_j \lvert M_{ij}\rvert\,\lvert q_j\rvert/(\beta\,\Delta t^2)`, a floor that grows
+like :math:`\Delta t^{-2}` and stands above the tolerance on a line near rest at a small time step
+(its inertia then sets no force scale), where a smaller step only raises it. As on the
+:math:`EI = 0` path, a residual on it is converged: when no step length of a fresh Newton
+correction reduces the residual, the residual is below :math:`10^{-4}` of the force scale, and
+the correction moves no free coordinate by more than :math:`16\,\epsilon` times its scale
+(:math:`x_\text{ref}` for the positions, the largest of 1 and the tangent or twist magnitudes for
+the tangents and twist angles), the iterate is accepted. The
deck defaults are relative tolerance :math:`10^{-8}`, absolute tolerance :math:`10^{-14}`, 30
iterations, and 12 backtracks (option ``dynamic_solver``). Option ``modified_newton`` reuses the
factorised tangent within a step while each iterate reduces the residual to at most a quarter
@@ -3065,19 +3825,34 @@ with the fluid velocity :math:`\mathbf{u}` and acceleration :math:`\dot{\mathbf{
the relative velocity :math:`\mathbf{w} = \mathbf{u} - \dot{\mathbf{r}}_j` split normal and along
the nodal tangent :math:`\mathbf{m}_j/\lvert\mathbf{m}_j\rvert` (the line's Morison law with
:math:`C_dA = C_{d,n} d` and :math:`C_dA_x = \pi C_{d,t} d`). The drag enters the velocity tangent
-and, through :math:`\mathbf{m}_j`, the position tangent exactly. Above the free surface an
-attachment carries its weight :math:`-m g\,\mathbf{e}_z` alone. The statics start from the
+and, through :math:`\mathbf{m}_j`, the position tangent exactly. At the free surface the buoyancy,
+Froude–Krylov force and drag carry the immersed fraction of the sphere of the attachment's volume,
+:math:`r = (3V/4\pi)^{1/3}` (of its drag area, :math:`C_dA = \pi r^2`, without a volume), as a
+Rigid6 body's buoyancy does: with the immersed height :math:`h = \min(2r, \max(0, \eta - z_j + r))`,
+
+.. math::
+
+ \phi = \frac{h^2 (3r - h)}{4 r^3},
+
+so the weight is :math:`-(m - \phi\rho V)\,g\,\mathbf{e}_z`, continuous with its slope as the node
+crosses the surface: :math:`\phi = 1` exactly from :math:`r` below the surface (the loads above,
+unchanged) and :math:`\phi = 0` from :math:`r` above it (the weight :math:`-m g\,\mathbf{e}_z`
+alone). A module that floats then rests at the height where :math:`\phi\rho V g` balances its
+share of the load, where a wet/dry switch at the node gave it no position. The added mass
+:math:`C_a \rho V` stays in the constant mass matrix, and the modal analysis leaves out the
+hydrostatic stiffness of the surface, a module's as a line's own. The statics start from the
equilibrium with the net weight smeared over the node's two elements, in a deck current across
the vertical plane of the chord with the drag areas smeared over them too (per-metre drag
coefficients :math:`C_dA/(d\,L)` and :math:`C_dA_x/(\pi d\,L)` added to an element of length
:math:`L` for each share), and continue to the lumped loads in warm-started Newton solves, the
smeared weight and drag moving to the node together; in a deck current the drag at rest is
lumped at the node, each solve takes
-every attachment's load on the side of the still-water level its node is on, and the final
-solve is repeated with the loads of its own solution until the nodes stop moving and no
-attachment changes side (an attachment that its weight in air takes below the surface and its
-weight in water above it has no static position, and the solve fails closed, naming the
-attachment that crossed the surface). Before, an attachment above the surface
+it at its incoming state, and the final solve is repeated with the drag of its own solution
+until the nodes stop moving. The buoyancy an attachment loses at the still-water level,
+:math:`\rho V g (1 - \phi)` downward, is part of every Newton iterate with its stiffness
+:math:`-\rho V g\, \partial\phi/\partial z` and potential, so a floating module needs no
+outer iteration. Before, a wet/dry switch at the node gave a module at the surface no static
+position and the solve stopped with an error; and before that, an attachment above the surface
kept its buoyancy in the statics: a 500 kg, 0.2 m\ :sup:`3` module 3 m above it moved the
fairlead load by up to 6.1 % in the first second of the march. The load moves
in eighths; a solve that stalls on a residual floor above the tight static tolerance is
diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst
index fd141c64..f89f972d 100644
--- a/doc/troubleshooting.rst
+++ b/doc/troubleshooting.rst
@@ -653,13 +653,8 @@ but a few geometries are genuinely hard:
reported in the note ``... was reached after a failed Newton solve ... and passed the
acceptance checks of the smeared state``. Check that the deck with the modules replaced by the equivalent
smeared buoyancy section solves; if it does, the discrete layout itself is the difficulty.
- ``... attachment of the line (Mass ..., Volume ...) crossed the still-water level ...``
- means the solves carried that attachment across the surface, where the dynamics drops its
- buoyancy: its weight in air takes it below the surface and its weight in water above it, so a
- point attachment has no static position there (the dynamics would bob it there). It is a
- net-buoyant module that would float, or a module whose node lies nearer the surface than the
- deflection its buoyancy gives the line. The message of the failed solve follows it. Move it
- along the line or change its ``Mass`` or ``Volume``.
+ A module at the surface is not a cause: its buoyancy fades over the sphere of its volume, so a
+ module that floats has a static position.
- **A cold start at full load.** The static solve continues the load in stages; if you have
hand-tuned a case into a bad basin, remove the tuning and let the default continuation run
from the catenary/arch seed.
diff --git a/doc/tutorial_openfast.rst b/doc/tutorial_openfast.rst
index a9e41cb1..726b26fa 100644
--- a/doc/tutorial_openfast.rst
+++ b/doc/tutorial_openfast.rst
@@ -168,7 +168,7 @@ The CableDyn part of the console (other modules' lines trimmed):
.. code-block:: text
- Running CableDyn (v0.4.2, 2026-11-09).
+ Running CableDyn (v0.4.3, 2026-11-20).
CableDyn: geometrically exact finite-element statics and dynamics of mooring lines and dynamic power cables.
...
CableDyn time step dtM = 2.50000E-02 s (1 x glue DT; deck dtM)
diff --git a/examples/cabledyn_options_reference.dat b/examples/cabledyn_options_reference.dat
index a9f693e1..b8038759 100644
--- a/examples/cabledyn_options_reference.dat
+++ b/examples/cabledyn_options_reference.dat
@@ -97,6 +97,7 @@ none waves - Wave model and parameters (m, s, deg) {none; airy;
-- 0.01 threshIC - MoorDyn dynamic-relaxation compatibility only; accepted and ignored
-- 0 WriteLog - MoorDyn logging compatibility only; accepted and ignored
-- 0.1 dtOut - MoorDyn output-cadence compatibility only; accepted and ignored
+-- 0.1 CDOutDt - OpenFAST/FAST.Farm: .CD.out row interval, a whole multiple of the CableDyn step [default: 0 = every step]
-- 0 Currents - MoorDyn-C current mode {0=none; 1=current_profile.txt} [default: 0]
-- 0.25 dtWave - MoorDyn-C WaveKin 3 resampling step (s) [default: 0.25]
-- 3.14159 WvHiCOff - High cut-off of an elevation record, WaveKinMod 1 or WaveKin 3 (rad/s) {value; none} [default: 3.14159]
diff --git a/examples/openfast/README.md b/examples/openfast/README.md
index 7ed66bfb..7dac9f6d 100644
--- a/examples/openfast/README.md
+++ b/examples/openfast/README.md
@@ -70,7 +70,7 @@ Grid sizing is described in the manual's OpenFAST page (SeaState grid).
.\openfast.exe IEA-15-UMaine_CompMooring3_MoorDyn.fst # MoorDyn
```
-The CableDyn run log identifies the module with `Running CableDyn (v0.4.2, 2026-11-09)` and
+The CableDyn run log identifies the module with `Running CableDyn (v0.4.3, 2026-11-20)` and
prints the converged fairlead state of each line, as the standalone driver does:
```text
diff --git a/examples/viv_taut_cable_inline.dat b/examples/viv_taut_cable_inline.dat
new file mode 100644
index 00000000..0e1237a6
--- /dev/null
+++ b/examples/viv_taut_cable_inline.dat
@@ -0,0 +1,65 @@
+--------------------- CableDyn Input File ------------------------------------
+CableDyn driver deck -- cross-flow and in-line VIV of a taut cable in a uniform current, 90 s
+-- The taut line of viv_taut_line_crossflow.dat as a finite-EI cable (EI 1 N m^2, a string to
+-- within 1e-6 of its geometric stiffness): 100 m, D 0.1 m, 10 kg/m, EA 5e7 N, about 50 kN, held
+-- at both ends 50 m below the surface in a 0.15 m/s current along +Y. The LINE TYPES columns
+-- Cl dF cF give the cross-flow lift (0.8 in MoorDyn's band), which locks the first vertical mode
+-- in across the flow (Z). The VIV section adds the in-line shedding force of Ulveseter et al.
+-- (Mar. Struct. 60, 2018) along the flow (Y): ClX 0.85 and the band alpha 0.15 of its phase
+-- about twice the cross-flow one. Over 60-90 s the quarter span (L1N13py) moves in line at A/D
+-- 0.19, at twice the 0.29 Hz cross-flow frequency of the mid span (L1N26pz, A/D 0.82); with the
+-- cross-flow lift alone (drop the VIV section) they are 0.03 and 0.66. The Outputs flag V writes
+-- the VIV force, lift and in-line, at every node to .Line1.V.out. VIVPow1, DragPow1 and
+-- DampPow1 are the power the VIV loads, the drag and the axial damping deliver to the line: over
+-- 60-90 s the VIV loads put in 8.45 W and the drag and damping take out 8.48 W.
+--------------------- LINE TYPES ---------------------------------------
+TypeName Diam MassDenInAir EA BA/-zeta EI Cd_n Cd_t Ca_n Ca_t Cl dF cF
+(-) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) (-) (-) (-)
+riser 0.10 10.0 5.0e7 -0.8 1.0 1.2 0.0 1.0 0.0 0.8 0.08 0.18
+--------------------- POINTS -------------------------------------------
+ID Type X Y Z Mass Vol CdA Ca
+(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
+1 Coupled 0.0 0.0 -50.0 0 0 0 0
+2 Fixed 100.0 0.0 -50.0 0 0 0 0
+--------------------- LINES --------------------------------------------
+ID NodeA NodeB Outputs
+(-) (-) (-) (-)
+1 1 2 V
+--------------------- SECTIONS -----------------------------------------
+-- 99.9 m unstretched: 50 kN stretches it to the 100 m span (EA 5e7 N, strain 0.1 %).
+LineID LineType Length NumSegs
+(-) (-) (m) (-)
+1 riser 99.9001 50
+--------------------- VIV ----------------------------------------------
+-- In-line VIV of a line type: the in-line shedding coefficient ClX (0 = off; it needs the type's
+-- cross-flow Cl > 0) and the band alpha (0 <= alpha < 1, default 0.15). EI = 0 lines take it too.
+TypeName ClX alpha
+(-) (-) (-)
+riser 0.85 0.15
+--------------------- OPTIONS ------------------------------------------
+9.80665 g - Gravitational acceleration (m/s^2) [default: 9.80665]
+1025.0 rhoW - Water density (kg/m^3) [default: 1025]
+100.0 WtrDpth - Water depth (m) [default: absent standalone; host-owned OpenFAST]
+1.0e5 kBot - Seabed penalty stiffness base (Pa/m) [default: 1.0e5]
+1.0e4 cBot - Seabed normal damping base (Pa-s/m) [default: 1.0e4]
+0.02 dtM - CableDyn internal time step (s) [default: omitted standalone; the glue DT in OpenFAST]
+90.0 TMax - Standalone simulation duration (s) [default: omitted standalone; host-owned OpenFAST]
+0.25 VIVrmsWindow - Averaging time of the VIV running RMS motion (s) {0=500 steps of dtM} [default: 0]
+spread VIVphaseSeed - Initial VIV phases {spread=2 pi i/N, MoorDyn-C; zero=MoorDyn-F} [default: spread]
+uniform 0.0 0.15 0.0 current - Current model and X/Y/Z velocity (m/s) {none; uniform; profile} [default: none]
+none waves - Wave model, height, period, and direction (m, s, deg) {none; airy; jonswap} [default: none]
+0 WaterKin - Water-kinematics source {0/none; 3; 7; file; SEASTATE coupled only} [default: no policy]
+0.4 rhoInf - Generalised-alpha spectral radius {0<=rhoInf<=1} [default: 0.4]
+False modified_newton - Tangent-reuse mode {False=full Newton; True=guarded reuse} [default: False]
+False adaptive_mesh - Automatic finite-EI refinement {False; True} [default: False]
+dynamic_solver 1.0e-8 1.0e-14 30 12 - Relative tolerance, absolute tolerance, max iterations, backtracks [defaults shown]
+none frictionMu - Seabed friction coefficient {none; value>=0} [default: none]
+-- Complete option/default reference: cabledyn_options_reference.dat and doc/options.rst.
+--------------------- OUTPUTS ------------------------------------------
+"FairTen1"
+"L1N26pz"
+"L1N13py"
+"VIVPow1"
+"DragPow1"
+"DampPow1"
+--------------------- need this line -----------------------------------
diff --git a/integration/openfast/README.md b/integration/openfast/README.md
index 3761dbea..10adb328 100644
--- a/integration/openfast/README.md
+++ b/integration/openfast/README.md
@@ -9,7 +9,7 @@ who only run coupled cases should use the released `openfast.exe` and the
The patches in [`patches/`](patches/) apply to the public OpenFAST upstream commit
`2895884d2be01862173c88d70f86b358d2f1a50a` (the OpenFAST v5.0.0 release, used by
-CableDyn v0.4.2). They add only the OpenFAST host integration; the CableDyn sources come from
+CableDyn v0.4.3). They add only the OpenFAST host integration; the CableDyn sources come from
this repository.
| File | Purpose |
@@ -67,7 +67,7 @@ ifx default, `/fp:fast`, may reassociate sums and flush subnormals to zero.
OpenFAST names its version with `git describe --dirty`, which would read `v5.0.0-dirty` on
the patched tree. A CableDyn-enabled executable names itself
`OpenFAST--CableDyn-` instead, here
-`OpenFAST-v5.0.0-CableDyn-0.4.2` (printed by `openfast.exe -v` and at the start of every run).
+`OpenFAST-v5.0.0-CableDyn-0.4.3` (printed by `openfast.exe -v` and at the start of every run).
The OpenFAST part is `git describe --tags --abbrev=8` of the checked-out commit, the
unpatched base; the CableDyn part is the project version in the CableDyn `CMakeLists.txt`.
Patch `0021` sets it in the CMake build, and `integrate_openfast_vs_solution.ps1` in the
diff --git a/pyproject.toml b/pyproject.toml
index b89abb2a..2c5f381c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -12,7 +12,7 @@ build-backend = "scikit_build_core.build"
[project]
name = "cabledyn"
-version = "0.4.2"
+version = "0.4.3"
description = "Python tools for CableDyn, a geometrically exact finite-element solver for mooring lines and dynamic power cables"
readme = "python/README.md"
requires-python = ">=3.10"
diff --git a/python/README.md b/python/README.md
index 23652cae..762e218c 100644
--- a/python/README.md
+++ b/python/README.md
@@ -25,7 +25,7 @@ Fortran compiler and LAPACK.
The pure Python wheel attached to each
[GitHub release](https://github.com/SMI-Lab-Inha/CableDyn/releases/latest)
-(`cabledyn-0.4.2-py3-none-any.whl`) carries no solver. `CableDynDriver` finds the
+(`cabledyn-0.4.3-py3-none-any.whl`) carries no solver. `CableDynDriver` finds the
driver from an explicit path, then the `CABLEDYN_DRIVER` environment variable,
then the driver inside the package, then `PATH`; the in-process `CableDyn` class
uses the library inside the package, or one named by `CABLEDYN_LIBRARY` or found in
diff --git a/python/cabledyn/__init__.py b/python/cabledyn/__init__.py
index 90ecc52b..63070260 100644
--- a/python/cabledyn/__init__.py
+++ b/python/cabledyn/__init__.py
@@ -54,6 +54,7 @@
damage_along_arc,
lifetime_fatigue,
miner_damage,
+ section_stress,
study_sea_state_damage,
)
from cabledyn.deck import DeckWriter
@@ -149,6 +150,13 @@
)
from cabledyn.sweep import parameter_grid
from cabledyn.touchdown import TouchdownHistory, touchdown_history
+from cabledyn.viv import (
+ CurrentSteps,
+ ModalAmplitudes,
+ VIVResponse,
+ current_steps,
+ viv_response,
+)
if TYPE_CHECKING:
from cabledyn._lib import abi_minor as abi_minor
@@ -175,6 +183,7 @@
"CoherenceResult",
"ConvergenceError",
"CoupledRun",
+ "CurrentSteps",
"DamageProfile",
"DeckFile",
"DeckFormatError",
@@ -198,6 +207,7 @@
"LinePositions",
"LineSegmentHistory",
"LineSummary",
+ "ModalAmplitudes",
"ModeShapes",
"MoorDynLineHistory",
"NaturalModes",
@@ -226,6 +236,7 @@
"TimeHistory",
"Touchdown",
"TouchdownHistory",
+ "VIVResponse",
"WaterSurface",
"WeibullFit",
"animate",
@@ -239,6 +250,7 @@
"channel_summary",
"clearance_matrix",
"compare_histories",
+ "current_steps",
"cycle_histogram",
"damage_along_arc",
"damage_equivalent_range",
@@ -278,15 +290,17 @@
"resample",
"run_study",
"seabed_clearance",
+ "section_stress",
"segment_distance",
"static_range_graph",
"study_sea_state_damage",
"tension_check",
"touchdown_history",
"upcrossing_maxima",
+ "viv_response",
]
-__version__ = "0.4.2"
+__version__ = "0.4.3"
def __getattr__(name: str) -> Any:
diff --git a/python/cabledyn/builder.py b/python/cabledyn/builder.py
index d73f3f31..5b80ab2e 100644
--- a/python/cabledyn/builder.py
+++ b/python/cabledyn/builder.py
@@ -114,9 +114,12 @@
("line", re.compile(r"(tdp)([0-9]+)(s|x|y|z|lay|exc|grd)", re.IGNORECASE)),
(
"line",
- re.compile(r"(ten|curvx|curvy|curv|bendmom|stfmom|torq)([0-9]+)(n[0-9]+)", re.IGNORECASE),
+ re.compile(
+ r"(ten|curvx|curvy|curv|bendmom|stfmom|torq|vivamp)([0-9]+)(n[0-9]+)", re.IGNORECASE
+ ),
),
("line", re.compile(r"(twist)([0-9]+)(n[0-9]+|)", re.IGNORECASE)),
+ ("line", re.compile(r"(vivpow|dragpow|damppow)([0-9]+)(n[0-9]+|)", re.IGNORECASE)),
("line", re.compile(r"(l)([0-9]+)(n[0-9]+(?:[pva][xyz]|dec|azi))", re.IGNORECASE)),
("point", re.compile(r"(point|con)([0-9]+)(p[xyz])", re.IGNORECASE)),
("point", re.compile(r"(point)([0-9]+)(f[xyzh])", re.IGNORECASE)),
@@ -188,8 +191,13 @@ class LineType:
viscoelastic type, or a :class:`SyropeEA`.
ba : float | tuple[float, ...]
Axial damping in N s (negative: damping ratio), or ``(Bs, Bd)``.
- ei : float
- Bending stiffness, in N m^2.
+ ei : float | tuple[float, ...]
+ Bending stiffness, in N m^2; ``(EI, Bb)`` adds the bending damping
+ ``Bb`` in N m^2 s (written ``EI|Bb``), and ``(EI, -zeta, f)`` gives it
+ as the damping ratio ``zeta`` of a bending mode of frequency ``f`` in Hz
+ (written ``EI|-zeta|f``; ``Bb = zeta EI / (pi f)``); ``(EI, -zeta, f1, f2)``
+ adds the mass-proportional damping ``alpha`` beside ``Bb``, the Rayleigh
+ pair that holds ``zeta`` at ``f1`` and ``f2`` (written ``EI|-zeta|f1|f2``).
cdn, cdt, can, cat : float
Normal and tangential drag and added-mass coefficients.
gas, gj, irt, irn : float | None
@@ -202,8 +210,67 @@ class LineType:
cl, df, cf : float | None
Optional cross-flow VIV columns of a type (MoorDyn's lift
coefficient and the half-range and centre of the synchronisation band
- in non-dimensional frequency). ``cl`` set writes the 13-column row, with
- MoorDyn's ``df = 0.08`` and ``cf = 0.18`` where they are ``None``.
+ in non-dimensional frequency). ``cl`` set writes them after the ten or
+ fourteen columns (the 13- or 17-column row), with MoorDyn's
+ ``df = 0.08`` and ``cf = 0.18`` where they are ``None``.
+ clx, il_alpha : float | None
+ Optional in-line VIV of a type, a ``VIV`` section row
+ ``Name ClX [alpha]``: the in-line shedding coefficient (it needs ``cl``,
+ the in-line phase running at twice the cross-flow one) and the frequency
+ band of that phase, ``0 <= il_alpha < 1``; ``None`` leaves alpha out of
+ the row (the solver takes 0.15).
+ chh : float | None
+ Optional higher-harmonic coefficient of the ``VIV`` row (``Name ClX alpha
+ Chh``, Ulveseter et al. 2019; it needs ``clx``); ``None`` leaves it out
+ (0). With ``chh`` set and ``il_alpha`` ``None`` the row writes alpha 0.15.
+ wake_cl0, wake_st, wake_eps, wake_a : float | None
+ Optional wake-oscillator VIV of a type (Facchinetti et al. 2004), a
+ ``WAKE OSCILLATOR`` section row ``Name CL0 [St [eps [A]]]``: the
+ reference lift coefficient, the Strouhal number, the van der Pol
+ parameter and the acceleration coupling. It replaces the
+ synchronisation lift, so ``cl`` stays ``None`` or 0, and acts on
+ ``EI = 0`` lines and finite-EI cables. ``None`` leaves a trailing value out of the row (the
+ solver takes 0.2, 0.3 and 12); a value given writes the ones before it.
+ viv_frame_tf : float | None
+ Optional flow frame of a type's VIV model, a ``VIV FRAME`` section row
+ ``Name Tf``: the filter time [s] of the cable velocity the model's free
+ stream is taken relative to (0: the ambient flow; set it for a cable
+ moved through the water by a tow or its floater). It sets the wake
+ oscillator's frequency, or on the synchronisation model the motion of
+ 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
+ ``(sigma, c)``, ``(sigma, c, Nf)`` or ``(sigma, c, Nf, seed)``
+ (Ulveseter et al. 2017): the standard deviation of the centre, the top
+ of its flat spectrum as a fraction of ``cF``, the number of components
+ (default 100) and the seed of their start phases (default 0). It needs
+ ``cl > 0`` and no ``wake_cl0``. ``None`` writes no row.
+ viv_amplitude : list of tuples | None
+ Optional amplitude-dependent VIV coefficients of a type (Thorsen et al.
+ 2016), the rows of a ``VIV AMPLITUDE`` section table ``Name AD Cv
+ [CdAmp]`` as ``(AD, Cv)`` or ``(AD, Cv, CdAmp)`` tuples, all of one
+ length, 2 to 32 of them in increasing amplitude ratio ``AD``: ``Cv``
+ replaces ``cl`` at that amplitude (so ``cl`` must be set) and ``CdAmp``
+ multiplies the normal drag coefficient ``cdn`` (1 when left out).
+ viv_damping : tuple[float, float] | tuple[float, float, float] | None
+ Optional ``VIV DAMPING`` row ``(a, b[, c])``: the cross-flow damping
+ ``C_dy = a + b y0/D`` of Thorsen et al. (2016) in place of the cross-flow part of the
+ type's Morison drag, plus a Morison-form term ``c Cdn |w| w_y``; ``(0.31, 0.89)`` is
+ their published fit, ``(0, 0, 1)`` amplifies the in-line drag alone (with a
+ ``viv_amplitude`` drag factor). Needs ``viv_amplitude``.
+ viv_diameter : float | None
+ Optional diameter of the type's VIV model, a ``VIV DIAMETER`` section row
+ ``Name Dviv``: the shedding frequency, the VIV forces and the amplitude
+ ratio take it in place of ``diam`` (which the drag, added mass and
+ buoyancy keep); it needs ``cl`` or ``wake_cl0``.
"""
name: str
@@ -211,7 +278,7 @@ class LineType:
mass: float
ea: float | tuple[float, ...] | SyropeEA
ba: float | tuple[float, ...] = 0.0
- ei: float = 0.0
+ ei: float | tuple[float, ...] = 0.0
cdn: float = 0.0
cdt: float = 0.0
can: float = 0.0
@@ -223,6 +290,19 @@ class LineType:
cl: float | None = None
df: float | None = None
cf: float | None = None
+ clx: float | None = None
+ il_alpha: float | None = None
+ chh: float | None = None
+ wake_cl0: float | None = None
+ wake_st: float | None = None
+ wake_eps: float | None = None
+ wake_a: float | None = None
+ viv_amplitude: list[tuple[float, ...]] | None = None
+ viv_diameter: float | None = None
+ 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)
@@ -1627,7 +1707,7 @@ def add_line_type(
mass: float,
ea: float | tuple[float, ...] | SyropeEA,
ba: float | tuple[float, ...] = 0.0,
- ei: float = 0.0,
+ ei: float | tuple[float, ...] = 0.0,
cdn: float = 0.0,
cdt: float = 0.0,
can: float = 0.0,
@@ -1639,6 +1719,19 @@ def add_line_type(
cl: float | None = None,
df: float | None = None,
cf: float | None = None,
+ clx: float | None = None,
+ il_alpha: float | None = None,
+ chh: float | None = None,
+ wake_cl0: float | None = None,
+ wake_st: float | None = None,
+ wake_eps: float | None = None,
+ wake_a: float | None = None,
+ viv_amplitude: list[tuple[float, ...]] | None = None,
+ viv_diameter: float | None = None,
+ 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.
@@ -1655,7 +1748,36 @@ def add_line_type(
_text(name, "line-type name")
self._check_new_key(self.line_types, name)
item = LineType(
- name, diam, mass, ea, ba, ei, cdn, cdt, can, cat, gas, gj, irt, irn, cl, df, cf
+ name,
+ diam,
+ mass,
+ ea,
+ ba,
+ ei,
+ cdn,
+ cdt,
+ can,
+ cat,
+ gas,
+ gj,
+ irt,
+ irn,
+ cl,
+ df,
+ cf,
+ clx,
+ il_alpha,
+ chh,
+ wake_cl0,
+ wake_st,
+ wake_eps,
+ wake_a,
+ None if viv_amplitude is None else [tuple(row) for row in viv_amplitude],
+ viv_diameter,
+ 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
@@ -2546,6 +2668,13 @@ def to_text(self, *, validate: bool = True) -> str:
_emit(out, "EQUIVALENT BUOYANCY", *self._equivalent_table())
_emit(out, "ATTACHMENTS", *self._attachment_table())
_emit(out, "STIFFENERS", *self._stiffener_table())
+ _emit(out, "VIV", *self._viv_table())
+ _emit(out, "WAKE OSCILLATOR", *self._wake_table())
+ _emit(out, "VIV AMPLITUDE", *self._viv_amp_table())
+ _emit(out, "VIV DIAMETER", *self._viv_diam_table())
+ _emit(out, "VIV FRAME", *self._viv_frame_table())
+ _emit(out, "VIV STOCHASTIC", *self._viv_sto_table())
+ _emit(out, "VIV DAMPING", *self._viv_damp_table())
_emit(out, "FAILURE", *self._failure_table())
_emit(out, "CONTROL", *self._control_table())
_emit(out, "EXTERNAL LOADS", *self._external_load_table())
@@ -2661,7 +2790,11 @@ def _line_type_table(self) -> tuple[str, str, list[list[str]]]:
row.append(f'"{_render(ea)}"')
else:
row.append(_multi(item.ea, what))
- row += [_multi(item.ba, what), _num(item.ei, what)]
+ if isinstance(item.ei, tuple) and len(item.ei) not in (2, 3, 4):
+ raise ValueError(
+ f"{what}: ei is EI, (EI, Bb), (EI, -zeta, f) or (EI, -zeta, f1, f2)"
+ )
+ row += [_multi(item.ba, what), _multi(item.ei, what)]
extra = (item.gas, item.gj, item.irt, item.irn)
if all(value is not None for value in extra):
wide = True
@@ -2675,9 +2808,6 @@ def _line_type_table(self) -> tuple[str, str, list[list[str]]]:
raise ValueError(f"{what}: give all of gas, gj, irt, irn or none")
row += [_num(v, what) for v in (item.cdn, item.cdt, item.can, item.cat)]
if item.cl is not None:
- if all(value is not None for value in extra):
- # a LINE TYPES row has 10, 11, 13 or 14 columns: no VIV on the wide row
- raise ValueError(f"{what}: cl, df and cf do not combine with gas, gj, irt, irn")
viv = True
df = 0.08 if item.df is None else item.df
cf = 0.18 if item.cf is None else item.cf
@@ -2688,6 +2818,9 @@ def _line_type_table(self) -> tuple[str, str, list[list[str]]]:
if wide:
header = "Name Diam Mass EA BA EI GAs GJ Irt Irn Cd_n Cd_t Ca_n Ca_t"
units = "(-) (m) (kg/m) (N) (N-s) (N-m^2) (N) (N-m^2) (kg-m) (kg-m) (-) (-) (-) (-)"
+ if viv:
+ header += " Cl dF cF"
+ units += " (-) (-) (-)"
elif viv:
header = "Name Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t Cl dF cF"
units = "(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-) (-) (-) (-)"
@@ -2907,6 +3040,137 @@ def _stiffener_table(self) -> tuple[str, str, list[list[str]]]:
header = "LineID End Length RootOD TipOD InnerD E Density"
return header, "(-) (-) (m) (m) (m) (m) (Pa) (kg/m^3)", rows
+ def _viv_table(self) -> tuple[str, str, list[list[str]]]:
+ rows: list[list[str]] = []
+ for item in self._line_types:
+ what = f"line type {item.name!r}"
+ if item.clx is None:
+ if item.il_alpha is not None:
+ raise ValueError(f"{what}: il_alpha needs the in-line VIV coefficient clx")
+ if item.chh is not None:
+ raise ValueError(f"{what}: chh needs the in-line VIV coefficient clx")
+ continue
+ row = [_text(item.name, what), _num(item.clx, what)]
+ if item.il_alpha is not None or item.chh is not None:
+ row.append(_num(0.15 if item.il_alpha is None else item.il_alpha, what))
+ if item.chh is not None:
+ row.append(_num(item.chh, what))
+ rows.append(row)
+ return "Name ClX alpha Chh", "(-) (-) (-) (-)", rows
+
+ def _wake_table(self) -> tuple[str, str, list[list[str]]]:
+ rows: list[list[str]] = []
+ defaults = (0.2, 0.3, 12.0)
+ for item in self._line_types:
+ what = f"line type {item.name!r}"
+ rest = (item.wake_st, item.wake_eps, item.wake_a)
+ if item.wake_cl0 is None:
+ if any(value is not None for value in rest):
+ raise ValueError(f"{what}: wake_st, wake_eps and wake_a need wake_cl0")
+ continue
+ row = [_text(item.name, what), _num(item.wake_cl0, what)]
+ # the values up to the last one given, the solver's defaults filling the gaps
+ last = max((index for index, value in enumerate(rest) if value is not None), default=-1)
+ for index in range(last + 1):
+ value = rest[index]
+ row.append(_num(defaults[index] if value is None else value, what))
+ rows.append(row)
+ return "Name CL0 St eps A", "(-) (-) (-) (-) (-)", rows
+
+ def _viv_amp_table(self) -> tuple[str, str, list[list[str]]]:
+ rows: list[list[str]] = []
+ for item in self._line_types:
+ if item.viv_amplitude is None:
+ continue
+ what = f"line type {item.name!r}"
+ table = list(item.viv_amplitude)
+ if not table:
+ raise ValueError(f"{what}: viv_amplitude needs at least two rows")
+ widths = {len(row) for row in table}
+ if len(widths) != 1 or not widths <= {2, 3}:
+ raise ValueError(
+ f"{what}: viv_amplitude rows are (AD, Cv) or (AD, Cv, CdAmp), all of one length"
+ )
+ if item.cl is None:
+ raise ValueError(f"{what}: viv_amplitude scales the synchronisation lift, set cl")
+ for row in table:
+ rows.append([_text(item.name, what), *(_num(value, what) for value in row)])
+ return "Name AD Cv CdAmp", "(-) (-) (-) (-)", rows
+
+ def _viv_damp_table(self) -> tuple[str, str, list[list[str]]]:
+ rows: list[list[str]] = []
+ for item in self._line_types:
+ if item.viv_damping is None:
+ continue
+ what = f"line type {item.name!r}"
+ if len(item.viv_damping) not in (2, 3):
+ raise ValueError(f"{what}: viv_damping is (a, b) or (a, b, c)")
+ if item.viv_amplitude is None:
+ raise ValueError(f"{what}: viv_damping takes its amplitude from viv_amplitude")
+ rows.append([_text(item.name, what)] + [_num(v, what) for v in item.viv_damping])
+ return "Name a b c", "(-) (-) (-) (-)", rows
+
+ def _viv_diam_table(self) -> tuple[str, str, list[list[str]]]:
+ rows: list[list[str]] = []
+ for item in self._line_types:
+ if item.viv_diameter is None:
+ continue
+ what = f"line type {item.name!r}"
+ if item.cl is None and item.wake_cl0 is None:
+ raise ValueError(
+ f"{what}: viv_diameter is the diameter of its VIV, set cl or wake_cl0"
+ )
+ rows.append([_text(item.name, what), _num(item.viv_diameter, what)])
+ return "Name Dviv", "(-) (m)", rows
+
+ 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"
+ )
+ 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]]]:
+ rows: list[list[str]] = []
+ for item in self._line_types:
+ if item.viv_stochastic is None:
+ continue
+ what = f"line type {item.name!r}"
+ if item.wake_cl0 is not None or not (item.cl is not None and item.cl > 0.0):
+ raise ValueError(
+ f"{what}: viv_stochastic varies the band centre of its synchronisation "
+ "model, set cl > 0 and no wake_cl0"
+ )
+ if not 2 <= len(item.viv_stochastic) <= 4:
+ raise ValueError(f"{what}: viv_stochastic is (sigma, c[, Nf[, seed]])")
+ rows.append([_text(item.name, what)] + [_num(v, what) for v in item.viv_stochastic])
+ width = max((len(r) for r in rows), default=3)
+ names = ["Name", "sigma", "c", "Nf", "seed"][:width]
+ units = ["(-)", "(-)", "(-)", "(-)", "(-)"][:width]
+ return " ".join(names), " ".join(units), rows
+
def _syrope_table(self) -> tuple[str, str, list[list[str]]]:
rows = [
[_line_list(row.lines), _num(row.tmax0, "SYROPE IC"), _num(row.tmean0, "SYROPE IC")]
@@ -3105,6 +3369,39 @@ def load(self) -> None:
for row in self.rows("STIFFENERS"):
t = row.tokens
model.add_stiffener(_native_int(t[0]), t[1][-1], *(_f(token) for token in t[2:8]))
+ for row in self.rows("VIV"):
+ t = row.tokens
+ item = model.line_types[t[0]]
+ item.clx = _f(t[1])
+ item.il_alpha = _f(t[2]) if len(t) >= 3 else None
+ item.chh = _f(t[3]) if len(t) == 4 else None
+ for row in self.rows("WAKE OSCILLATOR"):
+ t = row.tokens
+ item = model.line_types[t[0]]
+ item.wake_cl0 = _f(t[1])
+ item.wake_st = _f(t[2]) if len(t) >= 3 else None
+ item.wake_eps = _f(t[3]) if len(t) >= 4 else None
+ item.wake_a = _f(t[4]) if len(t) == 5 else None
+ for row in self.rows("VIV AMPLITUDE"):
+ t = row.tokens
+ item = model.line_types[t[0]]
+ if item.viv_amplitude is None:
+ item.viv_amplitude = []
+ item.viv_amplitude.append(tuple(_f(token) for token in t[1:]))
+ for row in self.rows("VIV DAMPING"):
+ t = row.tokens
+ model.line_types[t[0]].viv_damping = tuple(_f(v) for v in t[1:])
+ for row in self.rows("VIV DIAMETER"):
+ t = row.tokens
+ model.line_types[t[0]].viv_diameter = _f(t[1])
+ 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:])
for row in self.rows("ATTACHMENTS"):
t = row.tokens
arc: float | tuple[float, float, float]
@@ -3171,7 +3468,7 @@ def line_type(self, row: DeckRecord) -> None:
mass=_f(values["mass"]),
ea=ea,
ba=_fmulti(values["ba"]),
- ei=_f(values["ei"]),
+ ei=_fmulti(values["ei"]),
cdn=_f(values["cdn"]),
cdt=_f(values["cdt"]),
can=_f(values["can"]),
diff --git a/python/cabledyn/damage.py b/python/cabledyn/damage.py
index 918e0f5f..e79e52f8 100644
--- a/python/cabledyn/damage.py
+++ b/python/cabledyn/damage.py
@@ -7,6 +7,10 @@
* :func:`channel_damage` does the same for one channel of a time history.
* :func:`cable_stress` recovers the axial stress at the two extreme fibres of
a cable, ``sigma = T/A +/- E kappa r``.
+* :func:`section_stress` recovers it at points around the section from the
+ curvature vector on the section axes (the ``CurvX``/``CurvY`` channels),
+ ``sigma = T/A - E r (kappa_x cos theta + kappa_y sin theta)``, for biaxial
+ bending such as combined cross-flow and in-line VIV.
* :func:`damage_along_arc` evaluates the damage at every output node of a
line, from tension or from recovered stress.
* :func:`study_sea_state_damage` and :func:`lifetime_fatigue` weight the
@@ -50,6 +54,7 @@
"damage_along_arc",
"lifetime_fatigue",
"miner_damage",
+ "section_stress",
"study_sea_state_damage",
]
@@ -288,6 +293,78 @@ def cable_stress(
return _readonly(axial + bending), _readonly(axial - bending)
+def section_stress(
+ tension: npt.ArrayLike,
+ curvature_x: npt.ArrayLike,
+ curvature_y: npt.ArrayLike,
+ *,
+ area: float,
+ modulus: float,
+ radius: float,
+ points: int = 16,
+) -> tuple[npt.NDArray[Any], npt.NDArray[Any]]:
+ """Return the axial stress at points around a section from its curvature vector.
+
+ The point at angle ``theta`` from the section's x axis towards its y
+ axis, at distance ``radius`` from the neutral axis, has the bending strain
+ ``-(kappa_x x + kappa_y y)`` of the ``CurvX``/``CurvY`` channels (the
+ curvature vector on the section axes, pointing to the centre of
+ curvature), so
+
+ ``sigma(theta) = T/A - E r (kappa_x cos theta + kappa_y sin theta)``.
+
+ Unlike :func:`cable_stress` it follows the bending plane as it turns, so a
+ point sees the stress cycles of biaxial bending (cross-flow and in-line
+ VIV, a whirling orbit) that the two extreme fibres of a curvature
+ magnitude miss.
+
+ Parameters
+ ----------
+ tension : array_like
+ Effective tension, in newtons.
+ curvature_x, curvature_y : array_like
+ Curvature components on the section axes, in 1/m, broadcastable
+ against ``tension``.
+ area : float
+ Positive area that carries the tension, in m^2.
+ modulus : float
+ Positive Young's modulus of the component, in Pa.
+ radius : float
+ Non-negative distance of the points from the neutral axis, in metres.
+ points : int
+ Number of points, at ``theta = 360 k / points`` degrees.
+
+ Returns
+ -------
+ tuple[numpy.ndarray, numpy.ndarray]
+ Read-only stress with a last axis of length ``points``, in Pa, and the
+ ``(points,)`` angles in degrees.
+
+ Raises
+ ------
+ ValueError
+ If a section property or ``points`` is invalid or a value is not finite.
+ """
+ section = _positive(area, "area")
+ elastic = _positive(modulus, "modulus")
+ if isinstance(radius, bool) or not math.isfinite(float(radius)) or float(radius) < 0.0:
+ raise ValueError("radius must be finite and non-negative")
+ if isinstance(points, bool) or int(points) != points or points < 1:
+ raise ValueError("points must be a positive integer")
+ axial, kx, ky = np.broadcast_arrays(
+ np.asarray(tension, dtype=np.float64) / section,
+ np.asarray(curvature_x, dtype=np.float64),
+ np.asarray(curvature_y, dtype=np.float64),
+ )
+ if not (np.all(np.isfinite(axial)) and np.all(np.isfinite(kx)) and np.all(np.isfinite(ky))):
+ raise ValueError("tension and curvature must be finite")
+ angles = 2.0 * np.pi * np.arange(int(points)) / int(points)
+ bending = (
+ elastic * float(radius) * (kx[..., None] * np.cos(angles) + ky[..., None] * np.sin(angles))
+ )
+ return _readonly(axial[..., None] - bending), _readonly(np.degrees(angles))
+
+
@dataclass(frozen=True)
class DamageProfile:
"""Palmgren-Miner damage at every output node of one line.
@@ -297,7 +374,7 @@ class DamageProfile:
line_id : int
Deck line identifier.
quantity : str
- ``"tension"`` or ``"stress"``.
+ ``"tension"``, ``"stress"`` or ``"section"``.
curve : FatigueCurve
Curve used.
node_ids : tuple[int, ...]
@@ -308,11 +385,15 @@ class DamageProfile:
``(n,)`` arc length in metres, or node number.
damage : numpy.ndarray
``(n,)`` damage over the record; for ``"stress"`` the larger of the
- two fibres.
+ two fibres, for ``"section"`` the largest of the points around the
+ section.
duration : float
Length of the analysed record, in seconds.
source : pathlib.Path
Result file.
+ critical_angle : numpy.ndarray | None
+ ``(n,)`` angle of the most damaged point from the section's x axis, in
+ degrees, for ``"section"``; ``None`` otherwise.
"""
line_id: int
@@ -324,10 +405,13 @@ class DamageProfile:
damage: npt.NDArray[Any]
duration: float
source: Path
+ critical_angle: npt.NDArray[Any] | None = None
def __post_init__(self) -> None:
object.__setattr__(self, "location", _readonly(self.location))
object.__setattr__(self, "damage", _readonly(self.damage))
+ if self.critical_angle is not None:
+ object.__setattr__(self, "critical_angle", _readonly(self.critical_angle))
@property
def critical_node(self) -> int:
@@ -376,6 +460,7 @@ def damage_along_arc(
arc_length: ArcSource = None,
start: float | None = None,
stop: float | None = None,
+ points: int = 16,
) -> DamageProfile:
"""Return the Miner damage at every output node of a line.
@@ -389,6 +474,14 @@ def damage_along_arc(
S-N); each fibre is counted separately and the larger damage is kept.
Both channels must be written for the same nodes.
+ With ``quantity="section"`` the stress at ``points`` points around the
+ section is recovered from ``TenN``, ``CurvXN`` and
+ ``CurvYN`` by :func:`section_stress` (finite-EI lines; the same
+ section properties as ``"stress"``); each point is counted separately and
+ the largest damage is kept, with its angle in
+ :attr:`DamageProfile.critical_angle`. All three channels must be written
+ for the same nodes.
+
Parameters
----------
history : TimeHistory
@@ -398,7 +491,7 @@ def damage_along_arc(
curve : FatigueCurve
S-N or T-N curve.
quantity : str
- ``"tension"`` or ``"stress"``.
+ ``"tension"``, ``"stress"`` or ``"section"``.
area, breaking_strength, modulus, radius : float | None
Section properties, in SI units, as described above.
ultimate_strength : float | None
@@ -407,6 +500,8 @@ def damage_along_arc(
Node positions along the line (see :func:`cabledyn.node_range_graph`).
start, stop : float | None
Optional analysis window, in seconds.
+ points : int
+ Number of points around the section for ``"section"``.
Returns
-------
@@ -421,6 +516,7 @@ def damage_along_arc(
If ``quantity`` is unknown, a section property is missing or invalid,
or the tension and curvature channels cover different nodes.
"""
+ angles: npt.NDArray[Any] | None = None
view = _window(history, start, stop)
tensions = node_channels(view, line_id, "Ten")
data = node_matrix(view, tensions)
@@ -440,10 +536,31 @@ def damage_along_arc(
)
scale = 1.0e-6
histories = [outer, inner]
+ elif quantity == "section":
+ if curve.kind != "S-N":
+ raise ValueError("section-stress damage needs an S-N curve")
+ if area is None or modulus is None or radius is None or breaking_strength is not None:
+ raise ValueError("section-stress damage needs area, modulus, and radius only")
+ curvatures_x = node_channels(view, line_id, "CurvX")
+ curvatures_y = node_channels(view, line_id, "CurvY")
+ if tuple(curvatures_x) != tuple(tensions) or tuple(curvatures_y) != tuple(tensions):
+ raise ValueError("Ten, CurvX and CurvY channels must be written for the same nodes")
+ stresses, angles = section_stress(
+ data,
+ node_matrix(view, curvatures_x),
+ node_matrix(view, curvatures_y),
+ area=area,
+ modulus=modulus,
+ radius=radius,
+ points=points,
+ )
+ scale = 1.0e-6
+ histories = [stresses[:, :, k] for k in range(stresses.shape[2])]
else:
- raise ValueError("quantity must be 'tension' or 'stress'")
+ raise ValueError("quantity must be 'tension', 'stress' or 'section'")
damage = np.zeros(data.shape[1])
- for series in histories:
+ worst = np.zeros(data.shape[1], dtype=np.int64)
+ for k, series in enumerate(histories):
for index in range(data.shape[1]):
value = miner_damage(
rainflow_cycles(series[:, index]),
@@ -451,7 +568,9 @@ def damage_along_arc(
scale=scale,
ultimate_strength=ultimate_strength,
)
- damage[index] = max(damage[index], value)
+ if value > damage[index]:
+ damage[index] = value
+ worst[index] = k
node_ids = tuple(tensions)
kind, location = node_locations(int(line_id), node_ids, arc_length)
return DamageProfile(
@@ -464,6 +583,7 @@ def damage_along_arc(
damage=damage,
duration=float(view.time[-1] - view.time[0]),
source=view.path,
+ critical_angle=None if angles is None else angles[worst],
)
diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py
index a6ad7d83..14be1592 100644
--- a/python/cabledyn/deck_file.py
+++ b/python/cabledyn/deck_file.py
@@ -76,6 +76,20 @@
"STIFFENER": "STIFFENERS",
"BEND STIFFENERS": "STIFFENERS",
"BEND STIFFENER": "STIFFENERS",
+ "VIV": "VIV",
+ "VORTEX-INDUCED VIBRATION": "VIV",
+ "VORTEX INDUCED VIBRATION": "VIV",
+ "WAKE OSCILLATOR": "WAKE OSCILLATOR",
+ "WAKE OSCILLATORS": "WAKE OSCILLATOR",
+ "WAKE": "WAKE OSCILLATOR",
+ "VIV AMPLITUDE": "VIV AMPLITUDE",
+ "VIV AMPLITUDES": "VIV AMPLITUDE",
+ "VIV DIAMETER": "VIV DIAMETER",
+ "VIV DIAMETERS": "VIV DIAMETER",
+ "VIV DAMPING": "VIV DAMPING",
+ "VIV FRAME": "VIV FRAME",
+ "VIV FRAMES": "VIV FRAME",
+ "VIV STOCHASTIC": "VIV STOCHASTIC",
}
# Table sections whose rows the native reader takes through a Fortran
# list-directed READ. Their descriptive and units rows are recognized by the
@@ -98,7 +112,20 @@
# Table sections the native reader splits on whitespace and parses column by
# column (their comma-separated line lists are valid there).
_WHITESPACE_TABLE_SECTIONS = frozenset(
- {"FAILURE", "CONTROL", "SYROPE IC", "ATTACHMENTS", "STIFFENERS"}
+ {
+ "FAILURE",
+ "CONTROL",
+ "SYROPE IC",
+ "ATTACHMENTS",
+ "STIFFENERS",
+ "VIV",
+ "WAKE OSCILLATOR",
+ "VIV AMPLITUDE",
+ "VIV DIAMETER",
+ "VIV DAMPING",
+ "VIV FRAME",
+ "VIV STOCHASTIC",
+ }
)
_TABLE_SECTIONS = _LIST_DIRECTED_SECTIONS | _WHITESPACE_TABLE_SECTIONS
_NATIVE_RECORD_LENGTH = 512
@@ -231,6 +258,8 @@
"max_strain": "max_strain",
"vivrmswindow": "viv_rms_window",
"viv_rms_window": "viv_rms_window",
+ "cdoutdt": "cd_out_dt",
+ "cd_out_dt": "cd_out_dt",
"vivphaseseed": "viv_phase_seed",
"viv_phase_seed": "viv_phase_seed",
"rangestart": "range_start",
@@ -737,6 +766,20 @@ def _parse_line_node_channel(lowered: str) -> tuple[int, int, int, int]:
# Twist: the line's total twist (node 1)
line_id = _native_positive_int(lowered, 6, last)
return (line_id, 1, 11, 0) if line_id > 0 else (line_id, 0, 0, 0)
+ for keyword, code in (("vivpow", 15), ("dragpow", 17), ("damppow", 19)):
+ if not lowered.startswith(keyword):
+ continue
+ # the load power channels: the line total (node 1), N per length
+ prefix = len(keyword)
+ if last > prefix and "n" not in lowered[prefix:]:
+ line_id = _native_positive_int(lowered, prefix + 1, last)
+ return (line_id, 1, code, 0) if line_id > 0 else (line_id, 0, 0, 0)
+ separator = lowered.find("n", prefix)
+ if last <= prefix or separator < 0:
+ return 0, 0, 0, 0
+ line_id = _native_positive_int(lowered, prefix + 1, separator)
+ node_id = _native_positive_int(lowered, separator + 2, last)
+ return line_id, node_id, code + 1 if line_id > 0 and node_id > 0 else 0, 0
for keyword, code in (
("torq", 9),
("twist", 10),
@@ -746,6 +789,7 @@ def _parse_line_node_channel(lowered: str) -> tuple[int, int, int, int]:
("curv", 5),
("bendmom", 6),
("stfmom", 12),
+ ("vivamp", 21),
):
if lowered.startswith(keyword):
prefix = len(keyword)
@@ -819,7 +863,21 @@ def _channel_identity_key(channel: str) -> str:
if touchdown is not None and int(touchdown.group(1)) > 0:
component = ("s", "x", "y", "z", "lay", "exc", "grd").index(touchdown.group(2)) + 1
return f"tdp:{int(touchdown.group(1))}:{component}"
- if lowered.startswith(("ten", "curv", "bendmom", "stfmom", "l", "torq", "twist")):
+ if lowered.startswith(
+ (
+ "ten",
+ "curv",
+ "bendmom",
+ "stfmom",
+ "l",
+ "torq",
+ "twist",
+ "vivpow",
+ "dragpow",
+ "damppow",
+ "vivamp",
+ )
+ ):
line_id, node_id, kind, component = _parse_line_node_channel(lowered)
if line_id > 0 and node_id > 0 and kind > 0:
return f"node:{line_id}:{node_id}:{kind}:{component}"
@@ -1202,6 +1260,7 @@ def _scalar_option_value_error(keyword: str, value: str) -> str | None:
"max_strain",
"range_start",
"viv_rms_window",
+ "cd_out_dt",
}:
if key == "friction" and value.lower() == "none":
return None
@@ -1241,6 +1300,7 @@ def _scalar_option_value_error(keyword: str, value: str) -> str | None:
"max_strain",
"range_start",
"viv_rms_window",
+ "cd_out_dt",
} or raw in {
"dtic",
"tmaxic",
@@ -3175,6 +3235,408 @@ def _check_stiffeners(
"(End A and End B stiffeners together)"
)
+ def _check_viv_section(
+ self,
+ line_type_meta: dict[str, tuple[float, float, float, float]],
+ lift_type_names: set[str],
+ ) -> None:
+ """Native ``apply_type_viv`` for the VIV section.
+
+ A row ``TypeName ClX [alpha [Chh]]`` gives a line type in-line VIV: the in-line
+ shedding coefficient ``ClX >= 0`` (0 = off) and the band ``0 <= alpha < 1`` (default
+ 0.15) of its phase about twice the cross-flow one, so ``ClX > 0`` needs the type's LINE
+ TYPES lift ``Cl > 0``; and the higher-harmonic coefficient ``Chh >= 0`` (default 0),
+ which needs ``ClX > 0``. A type takes one row.
+ """
+ named: set[str] = set()
+ for row in self._rows("VIV"):
+ where = self._at(row)
+ if len(row.tokens) not in (2, 3, 4):
+ raise DeckFormatError(f"{where}: VIV rows must be: TypeName ClX [alpha [Chh]]")
+ name = row.tokens[0].lower()
+ if name not in line_type_meta:
+ raise DeckFormatError(
+ f'{where}: VIV row names undefined LINE TYPE "{row.tokens[0]}"'
+ )
+ if name in named:
+ raise DeckFormatError(f'{where}: VIV names LINE TYPE "{row.tokens[0]}" twice')
+ named.add(name)
+ try:
+ clx = _native_float(row.tokens[1])
+ alpha = _native_float(row.tokens[2]) if len(row.tokens) >= 3 else 0.15
+ chh = _native_float(row.tokens[3]) if len(row.tokens) == 4 else 0.0
+ except ValueError as exc:
+ raise DeckFormatError(
+ f"{where}: VIV ClX, alpha and Chh must be plain numbers"
+ ) from exc
+ if not (math.isfinite(clx) and math.isfinite(alpha) and math.isfinite(chh)):
+ raise DeckFormatError(f"{where}: VIV ClX, alpha and Chh must be finite")
+ if clx < 0.0 or clx > _NATIVE_MAX_COEFFICIENT:
+ raise DeckFormatError(
+ f"{where}: VIV in-line coefficient ClX must be non-negative (0 = in-line VIV "
+ "off) and at most 1e15"
+ )
+ if not 0.0 <= alpha < 1.0:
+ raise DeckFormatError(
+ f"{where}: VIV in-line frequency band alpha must satisfy 0 <= alpha < 1"
+ )
+ if chh < 0.0 or chh > _NATIVE_MAX_COEFFICIENT:
+ raise DeckFormatError(
+ f"{where}: VIV higher-harmonic coefficient Chh must be non-negative (0 = off) "
+ "and at most 1e15"
+ )
+ if chh > 0.0 and not clx > 0.0:
+ raise DeckFormatError(
+ f'{where}: VIV higher-harmonic force of LINE TYPE "{row.tokens[0]}" needs its '
+ "in-line VIV (ClX > 0): it runs at the cross-flow plus in-line phase"
+ )
+ if clx > 0.0 and name not in lift_type_names:
+ raise DeckFormatError(
+ f'{where}: VIV in-line VIV of LINE TYPE "{row.tokens[0]}" needs its '
+ "cross-flow lift (LINE TYPES Cl > 0): the in-line phase runs at twice the "
+ "cross-flow one"
+ )
+
+ def _check_wake_section(self, lift_type_names: set[str]) -> set[str]:
+ """Native ``apply_type_wake`` for the WAKE OSCILLATOR section; the types it switches on.
+
+ A row ``TypeName CL0 [St [eps [A]]]`` gives a line type the wake oscillator of
+ Facchinetti et al. (2004): the reference lift coefficient ``CL0 >= 0`` (0 = off), the
+ Strouhal number ``St > 0`` (default 0.2), the van der Pol ``eps > 0`` (0.3) and the
+ acceleration coupling ``A >= 0`` (12), each at most 1e15. It replaces the synchronisation
+ model, so a type with ``CL0 > 0`` takes no LINE TYPES lift ``Cl``. A type takes one row.
+ """
+ types = {row.tokens[0].lower() for row in self.line_types}
+ named: set[str] = set()
+ wake: set[str] = set()
+ for row in self._rows("WAKE OSCILLATOR"):
+ where = self._at(row)
+ if not 2 <= len(row.tokens) <= 5:
+ raise DeckFormatError(
+ f"{where}: WAKE OSCILLATOR rows must be: TypeName CL0 [St [eps [A]]]"
+ )
+ name = row.tokens[0].lower()
+ if name not in types:
+ raise DeckFormatError(
+ f'{where}: WAKE OSCILLATOR row names undefined LINE TYPE "{row.tokens[0]}"'
+ )
+ if name in named:
+ raise DeckFormatError(
+ f'{where}: WAKE OSCILLATOR names LINE TYPE "{row.tokens[0]}" twice'
+ )
+ named.add(name)
+ values = [0.0, 0.2, 0.3, 12.0]
+ try:
+ for index, token in enumerate(row.tokens[1:]):
+ values[index] = _native_float(token)
+ except ValueError as exc:
+ raise DeckFormatError(
+ f"{where}: WAKE OSCILLATOR CL0, St, eps and A must be plain numbers"
+ ) from exc
+ if not all(math.isfinite(value) for value in values):
+ raise DeckFormatError(f"{where}: WAKE OSCILLATOR CL0, St, eps and A must be finite")
+ cl0, st, eps, a = values
+ if cl0 < 0.0 or cl0 > _NATIVE_MAX_COEFFICIENT:
+ raise DeckFormatError(
+ f"{where}: WAKE OSCILLATOR lift coefficient CL0 must be non-negative (0 = off) "
+ "and at most 1e15"
+ )
+ if not (
+ 0.0 < st <= _NATIVE_MAX_COEFFICIENT
+ and 0.0 < eps <= _NATIVE_MAX_COEFFICIENT
+ and 0.0 <= a <= _NATIVE_MAX_COEFFICIENT
+ ):
+ raise DeckFormatError(
+ f"{where}: WAKE OSCILLATOR needs St > 0, eps > 0 and A >= 0, each at most 1e15"
+ )
+ if cl0 > 0.0 and name in lift_type_names:
+ raise DeckFormatError(
+ f'{where}: WAKE OSCILLATOR of LINE TYPE "{row.tokens[0]}" replaces its '
+ "synchronisation lift: give the type LINE TYPES Cl 0"
+ )
+ if cl0 > 0.0:
+ wake.add(name)
+ return wake
+
+ def _check_viv_diam_section(self, viv_type_names: set[str]) -> None:
+ """Native ``apply_type_viv_diam`` for the VIV DIAMETER section.
+
+ A row ``TypeName Dviv`` sets the diameter of a line type's VIV model, ``Dviv > 0`` (at
+ most 1e15). The type needs VIV (LINE TYPES ``Cl > 0`` or a WAKE OSCILLATOR row with
+ ``CL0 > 0``); a type takes one row.
+ """
+ types = {row.tokens[0].lower(): row.tokens[0] for row in self.line_types}
+ named: set[str] = set()
+ for row in self._rows("VIV DIAMETER"):
+ where = self._at(row)
+ if len(row.tokens) != 2:
+ raise DeckFormatError(f"{where}: VIV DIAMETER rows must be: TypeName Dviv")
+ name = row.tokens[0].lower()
+ if name not in types:
+ raise DeckFormatError(
+ f'{where}: VIV DIAMETER row names undefined LINE TYPE "{row.tokens[0]}"'
+ )
+ if name in named:
+ raise DeckFormatError(
+ f'{where}: VIV DIAMETER names LINE TYPE "{types[name]}" twice'
+ )
+ named.add(name)
+ try:
+ value = _native_float(row.tokens[1])
+ except ValueError as exc:
+ raise DeckFormatError(f"{where}: VIV DIAMETER Dviv must be a plain number") from exc
+ if not (math.isfinite(value) and 0.0 < value <= _NATIVE_MAX_COEFFICIENT):
+ raise DeckFormatError(f"{where}: VIV DIAMETER needs Dviv > 0, at most 1e15")
+ if name not in viv_type_names:
+ raise DeckFormatError(
+ f'{where}: VIV DIAMETER of LINE TYPE "{types[name]}" sets the diameter of its '
+ "VIV: give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row"
+ )
+
+ def _check_viv_frame_section(
+ self,
+ frame_type_names: set[str],
+ lift_type_names: set[str] | 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.
+
+ 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`` (``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) 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(
+ f'{where}: VIV FRAME row names undefined LINE TYPE "{row.tokens[0]}"'
+ )
+ if name in named:
+ raise DeckFormatError(f'{where}: VIV FRAME names LINE TYPE "{types[name]}" twice')
+ named.add(name)
+ try:
+ value = _native_float(row.tokens[1])
+ except ValueError as exc:
+ raise DeckFormatError(f"{where}: VIV FRAME Tf must be a plain number") from exc
+ if not (math.isfinite(value) and 0.0 <= value <= _NATIVE_MAX_COEFFICIENT):
+ raise DeckFormatError(
+ f"{where}: VIV FRAME filter time Tf must be >= 0 (0 = the ambient flow), "
+ "at most 1e15"
+ )
+ if name not in frame_type_names:
+ raise DeckFormatError(
+ 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.
+
+ A row ``TypeName sigma c [Nf [seed]]`` makes the band centre of a line type's
+ synchronisation model a slowly varying random process (Ulveseter et al. 2017): standard
+ deviation ``0 <= sigma <= 1e3``, the top ``0 < c <= 1`` of its flat spectrum as a fraction
+ of ``cF``, ``Nf`` components (an integer from 1 to 1000, default 100) and the seed of their
+ start phases (an integer from 0 to 2147483646, default 0). The type needs LINE TYPES
+ ``Cl > 0`` (``viv_type_names``) and no WAKE OSCILLATOR row; a type takes one row.
+ """
+ types = {row.tokens[0].lower(): row.tokens[0] for row in self.line_types}
+ named: set[str] = set()
+ for row in self._rows("VIV STOCHASTIC"):
+ where = self._at(row)
+ if not 3 <= len(row.tokens) <= 5:
+ raise DeckFormatError(
+ f"{where}: VIV STOCHASTIC rows must be: TypeName sigma c [Nf [seed]]"
+ )
+ name = row.tokens[0].lower()
+ if name not in types:
+ raise DeckFormatError(
+ f'{where}: VIV STOCHASTIC row names undefined LINE TYPE "{row.tokens[0]}"'
+ )
+ if name in named:
+ raise DeckFormatError(
+ f'{where}: VIV STOCHASTIC names LINE TYPE "{types[name]}" twice'
+ )
+ named.add(name)
+ values = [0.0, 0.0, 100.0, 0.0]
+ for k, token in enumerate(row.tokens[1:]):
+ try:
+ values[k] = _native_float(token)
+ except ValueError as exc:
+ raise DeckFormatError(
+ f"{where}: VIV STOCHASTIC sigma, c, Nf and seed must be plain numbers"
+ ) from exc
+ sigma, c, nf, seed = values
+ if not (
+ all(math.isfinite(v) for v in values) and 0.0 <= sigma <= 1.0e3 and 0.0 < c <= 1.0
+ ):
+ raise DeckFormatError(
+ f"{where}: VIV STOCHASTIC needs 0 <= sigma <= 1e3 and 0 < c <= 1"
+ )
+ if not (1.0 <= nf <= 1000.0 and nf == int(nf)):
+ raise DeckFormatError(
+ f"{where}: VIV STOCHASTIC Nf must be an integer from 1 to 1000"
+ )
+ if not (0.0 <= seed <= 2147483646.0 and seed == int(seed)):
+ raise DeckFormatError(
+ f"{where}: VIV STOCHASTIC seed must be an integer from 0 to 2147483646"
+ )
+ if name not in viv_type_names or name in wake_type_names:
+ raise DeckFormatError(
+ f'{where}: VIV STOCHASTIC of LINE TYPE "{types[name]}" varies the band '
+ "centre of its synchronisation model: give the type LINE TYPES Cl > 0 and "
+ "no WAKE OSCILLATOR row"
+ )
+
+ def _check_viv_damp_section(self, amp_type_names: set[str]) -> set[str]:
+ """Native ``apply_type_viv_damp`` for the VIV DAMPING section; the types it names.
+
+ A row ``TypeName a b [c]`` gives a line type the cross-flow hydrodynamic damping
+ ``C_dy = a + b y0/D`` of Thorsen et al. (2016) in place of the cross-flow part of its
+ Morison drag, plus a Morison-form term ``c Cdn |w| w_y`` (default 0); ``a, b, c >= 0``,
+ each at most 1e15. ``y0`` is the amplitude estimate of the type's VIV AMPLITUDE table,
+ so the type needs one. A type takes one row.
+ """
+ types = {row.tokens[0].lower(): row.tokens[0] for row in self.line_types}
+ named: set[str] = set()
+ for row in self._rows("VIV DAMPING"):
+ where = self._at(row)
+ if len(row.tokens) not in (3, 4):
+ raise DeckFormatError(f"{where}: VIV DAMPING rows must be: TypeName a b [c]")
+ name = row.tokens[0].lower()
+ if name not in types:
+ raise DeckFormatError(
+ f'{where}: VIV DAMPING row names undefined LINE TYPE "{row.tokens[0]}"'
+ )
+ if name in named:
+ raise DeckFormatError(f'{where}: VIV DAMPING names LINE TYPE "{types[name]}" twice')
+ try:
+ values = [_native_float(token) for token in row.tokens[1:]]
+ except ValueError as exc:
+ raise DeckFormatError(
+ f"{where}: VIV DAMPING a, b and c must be plain numbers"
+ ) from exc
+ if not all(math.isfinite(v) and 0.0 <= v <= _NATIVE_MAX_COEFFICIENT for v in values):
+ raise DeckFormatError(f"{where}: VIV DAMPING needs a, b and c >= 0, at most 1e15")
+ if name not in amp_type_names:
+ raise DeckFormatError(
+ f'{where}: VIV DAMPING of LINE TYPE "{types[name]}" takes the amplitude '
+ "estimate of its VIV AMPLITUDE table: give the type Cl > 0 and a VIV "
+ "AMPLITUDE table"
+ )
+ named.add(name)
+ return named
+
+ def _check_viv_amp_section(self, lift_type_names: set[str]) -> set[str]:
+ """Native ``apply_type_viv_amp`` for the VIV AMPLITUDE section; the types with a table.
+
+ Rows ``TypeName AD Cv [CdAmp]`` build a line type's amplitude table: the rows of a type
+ in strictly increasing ``AD >= 0``, ``Cv >= 0`` replacing the type's LINE TYPES ``Cl``
+ and ``CdAmp > 0`` (default 1) multiplying its normal drag coefficient, each at most
+ 1e15, all rows of a type with the same columns, 2 to 32 rows. The type needs the
+ synchronisation lift (LINE TYPES ``Cl > 0``).
+ """
+ types = {row.tokens[0].lower(): row.tokens[0] for row in self.line_types}
+ rows_of: dict[str, int] = {}
+ cols_of: dict[str, int] = {}
+ last_ad: dict[str, float] = {}
+ for row in self._rows("VIV AMPLITUDE"):
+ where = self._at(row)
+ if not 3 <= len(row.tokens) <= 4:
+ raise DeckFormatError(
+ f"{where}: VIV AMPLITUDE rows must be: TypeName AD Cv [CdAmp]"
+ )
+ name = row.tokens[0].lower()
+ if name not in types:
+ raise DeckFormatError(
+ f'{where}: VIV AMPLITUDE row names undefined LINE TYPE "{row.tokens[0]}"'
+ )
+ label = types[name]
+ if name not in lift_type_names:
+ raise DeckFormatError(
+ f'{where}: VIV AMPLITUDE of LINE TYPE "{label}" scales its synchronisation '
+ "lift: give the type LINE TYPES Cl > 0"
+ )
+ if name in rows_of and len(row.tokens) != cols_of[name]:
+ raise DeckFormatError(
+ f'{where}: the VIV AMPLITUDE rows of LINE TYPE "{label}" must all have the '
+ "same columns"
+ )
+ if rows_of.get(name, 0) >= 32:
+ raise DeckFormatError(
+ f'{where}: VIV AMPLITUDE gives LINE TYPE "{label}" more than 32 rows'
+ )
+ values = [0.0, 0.0, 1.0]
+ try:
+ for index, token in enumerate(row.tokens[1:]):
+ values[index] = _native_float(token)
+ except ValueError as exc:
+ raise DeckFormatError(
+ f"{where}: VIV AMPLITUDE AD, Cv and CdAmp must be plain numbers"
+ ) from exc
+ if not all(math.isfinite(value) for value in values):
+ raise DeckFormatError(f"{where}: VIV AMPLITUDE AD, Cv and CdAmp must be finite")
+ ad, cv, cd_amp = values
+ if not (
+ 0.0 <= ad <= _NATIVE_MAX_COEFFICIENT
+ and 0.0 <= cv <= _NATIVE_MAX_COEFFICIENT
+ and 0.0 < cd_amp <= _NATIVE_MAX_COEFFICIENT
+ ):
+ raise DeckFormatError(
+ f"{where}: VIV AMPLITUDE needs AD >= 0, Cv >= 0 and CdAmp > 0, each at most "
+ "1e15"
+ )
+ if name in last_ad and not ad > last_ad[name]:
+ raise DeckFormatError(
+ f'{where}: the VIV AMPLITUDE rows of LINE TYPE "{label}" must increase '
+ "strictly in AD"
+ )
+ rows_of[name] = rows_of.get(name, 0) + 1
+ cols_of[name] = len(row.tokens)
+ last_ad[name] = ad
+ for name, count in rows_of.items():
+ if count == 1:
+ raise DeckFormatError(
+ f'{self._label}: VIV AMPLITUDE gives LINE TYPE "{types[name]}" one row: a '
+ "table needs at least two"
+ )
+ return set(rows_of)
+
def _legacy_rod_type_columns(self, record: DeckRecord) -> bool:
"""Return whether ``record`` sits under a legacy CableDyn ROD TYPES header.
@@ -3397,6 +3859,102 @@ def validate(self) -> None:
raise DeckFormatError(f"{exc}{_STATIC_CHECK_HINT}") from None
raise
+ def _free_cable_ends(
+ self,
+ point_types: dict[str, str],
+ line_type_meta: dict[str, tuple[float, float, float, float]],
+ effective: Callable[[str, float], float],
+ ) -> set[str]:
+ """The Free points native promote_free_cable_ends makes free finite-EI cable ends."""
+ if (
+ self.caller_driven
+ or self._rows("BODIES")
+ or any(segments != 0 for _, segments in self._rod_rows_by_id().values())
+ or any(_option_key(option.keyword) == "bathymetry" for option in self.options)
+ ):
+ return set()
+ sections: dict[str, list[tuple[str, float]]] = {}
+ ends: dict[str, tuple[str, str]] = {}
+ try:
+ for section in self._rows("SECTIONS"):
+ sections.setdefault(str(_native_int(section.tokens[0])), []).append(
+ (section.tokens[1].lower(), _native_float(section.tokens[2]))
+ )
+ for row in self.lines:
+ line_key = str(_native_int(row.tokens[0]))
+ a_tok, b_tok = (
+ (row.tokens[2], row.tokens[3]) if len(row.tokens) == 7 else row.tokens[1:3]
+ )
+ ends[line_key] = (str(_native_int(a_tok)), str(_native_int(b_tok)))
+ if len(row.tokens) == 7:
+ sections[line_key] = [(row.tokens[1].lower(), _native_float(row.tokens[4]))]
+ except (ValueError, IndexError):
+ return set()
+ if not ends or not all(
+ any(
+ line_type_meta.get(name, (0.0, 0.0, 0.0, 0.0))[3] > 0.0
+ for name, _ in sections.get(k, [])
+ )
+ for k in ends
+ ):
+ return set()
+
+ # pinned in bending at both ends, at most one end restrained in torsion; a numeric zero
+ # stiffness is pinned / free, as native append_end_connection reads it
+ def zero_or(token: str, keywords: frozenset[str]) -> bool:
+ word = _strip_quotes(token).lower()
+ if word in keywords:
+ return True
+ try:
+ return _native_float(word) == 0.0
+ except ValueError:
+ return False
+
+ clamped: set[str] = set()
+ twisted: dict[str, int] = {}
+ for row in self.end_connections:
+ with contextlib.suppress(ValueError, IndexError):
+ line_key = str(_native_int(row.tokens[0]))
+ if not zero_or(row.tokens[2], _PINNED_END_CONNECTIONS):
+ clamped.add(line_key)
+ if len(row.tokens) >= 10 and not zero_or(row.tokens[6], _FREE_TORSION_KEYWORDS):
+ twisted[line_key] = twisted.get(line_key, 0) + 1
+ clamped |= {line_key for line_key, count in twisted.items() if count > 1}
+ rho_w, grav = effective("water_density", 1025.0), effective("gravity", 9.80665)
+ rows = {str(_native_int(row.tokens[0])): row for row in self.points}
+ promoted: set[str] = set()
+ for point_id, point_type in point_types.items():
+ if point_type == "connect":
+ return set()
+ if point_type != "free":
+ continue
+ refs = [k for k, pair in ends.items() if point_id in pair]
+ if len(refs) != 1 or ends[refs[0]][1] != point_id:
+ return set()
+ line_key = refs[0]
+ if (
+ point_types.get(ends[line_key][0], "") not in {"coupled", "vessel"}
+ or line_key in clamped
+ ):
+ return set()
+ if any(name not in line_type_meta for name, _ in sections.get(line_key, [])):
+ return set()
+ values = [_native_float(tok) for tok in rows[point_id].tokens[2:]]
+ mass, vol = (values[3], values[4]) if len(values) == 7 else (0.0, 0.0)
+ w_line = sum(
+ (line_type_meta[name][1] - rho_w * 0.25 * math.pi * line_type_meta[name][0] ** 2)
+ * grav
+ * length
+ for name, length in sections.get(line_key, [])
+ )
+ w_point = (mass - rho_w * vol) * grav
+ if not (w_line + w_point > 0.0 and w_point >= 0.0):
+ return set()
+ if not any(line_type_meta[name][2] > 0.0 for name, _ in sections.get(line_key, [])):
+ return set()
+ promoted.add(point_id)
+ return promoted
+
def _validate(self) -> None:
required = {"LINE TYPES", "POINTS", "LINES"}
if not self._rows("LINES") and (self._rows("RODS") or self._rows("BODIES")):
@@ -3699,7 +4257,11 @@ def effective(key: str, default: float) -> float:
raise DeckFormatError(
f"{self._label}: standalone OPTION frictionMu requires dtM and TMax"
)
- allowed_widths = {"LINE TYPES": {10, 11, 13, 14}, "POINTS": {5, 9}, "LINES": {3, 4, 7}}
+ allowed_widths = {
+ "LINE TYPES": {10, 11, 13, 14, 15, 17},
+ "POINTS": {5, 9},
+ "LINES": {3, 4, 7},
+ }
# Every row present is checked, also in a line-free deck of bodies and rods: the
# native reader parses each table row whether or not a line uses it.
for name in sorted(allowed_widths):
@@ -3727,8 +4289,10 @@ def numeric(token: str, row: DeckRecord, field: str) -> float:
viv_type_names: set[str] = set()
for row in self.line_types:
for index in (1, 2, *range(5, len(row.tokens))):
- if len(row.tokens) == 14 and index == 7:
+ if len(row.tokens) >= 14 and index == 7:
continue # the GJ column, GJ, GJ|K or GJ|K|Bt, is read below
+ if index == 5:
+ continue # the EI column (EI, EI|Bb, EI|-zeta|f, EI|-zeta|f1|f2) is read below
numeric(row.tokens[index], row, f"LINE TYPES column {index + 1}")
ea_parts = row.tokens[3].split("|")
ba_parts = row.tokens[4].split("|")
@@ -3778,9 +4342,9 @@ def numeric(token: str, row: DeckRecord, field: str) -> float:
f"{self._at(row)}: Syrope BA_s and BA_d must be non-negative "
"with a positive sum"
)
- # Native append_type: drag and added-mass coefficients (columns 7-10, the last
- # four of a 14-column row, in either column order) must be non-negative.
- hydro_start = len(row.tokens) - 4 if len(row.tokens) == 14 else 6
+ # Native append_type: drag and added-mass coefficients (columns 7-10, or 11-14 of
+ # a 14-column row, in either column order) must be non-negative.
+ hydro_start = 10 if len(row.tokens) >= 14 else 6
hydro = [
numeric(row.tokens[index], row, f"LINE TYPES column {index + 1}")
for index in range(hydro_start, hydro_start + 4)
@@ -3790,13 +4354,67 @@ def numeric(token: str, row: DeckRecord, field: str) -> float:
f"{self._at(row)}: LINE TYPES drag and added-mass coefficients "
"(Cd_n Cd_t Ca_n Ca_t) must be non-negative"
)
- ei = numeric(row.tokens[5], row, "EI")
- if len(row.tokens) in (11, 13):
- # Native check_viv_columns: MoorDyn's cross-flow VIV columns Cl [dF cF]
- cl = numeric(row.tokens[10], row, "Cl")
+ # native parse_ei_column: EI, EI|Bb (bending damping, N m^2 s), EI|-zeta|f or
+ # EI|-zeta|f1|f2 (the Rayleigh pair of Bb and the mass-proportional alpha)
+ ei_parts = row.tokens[5].split("|")
+ if len(ei_parts) > 4:
+ raise DeckFormatError(
+ f'{self._at(row)}: LINE TYPES EI column "{row.tokens[5]}" takes EI, EI|Bb, '
+ "EI|-zeta|f or EI|-zeta|f1|f2"
+ )
+ ei = numeric(ei_parts[0], row, "EI")
+ bend_damping = 0.0
+ if len(ei_parts) == 2:
+ bend_damping = numeric(ei_parts[1], row, "EI|Bb damping")
+ if bend_damping < 0.0:
+ raise DeckFormatError(
+ f'{self._at(row)}: LINE TYPES EI column "{row.tokens[5]}": a negative '
+ "bending damping is -zeta and needs the frequency it holds at, EI|-zeta|f"
+ )
+ elif len(ei_parts) == 3:
+ ratio = numeric(ei_parts[1], row, "EI|-zeta|f ratio")
+ frequency = numeric(ei_parts[2], row, "EI|-zeta|f frequency")
+ if not -1.0 < ratio < 0.0:
+ raise DeckFormatError(
+ f'{self._at(row)}: LINE TYPES EI column "{row.tokens[5]}": '
+ "EI|-zeta|f takes a damping ratio 0 < zeta < 1, written negative"
+ )
+ if not frequency > 0.0:
+ raise DeckFormatError(
+ f'{self._at(row)}: LINE TYPES EI column "{row.tokens[5]}": the frequency f '
+ "of EI|-zeta|f must be positive [Hz]"
+ )
+ bend_damping = -ratio * ei / (math.pi * frequency)
+ elif len(ei_parts) == 4:
+ ratio = numeric(ei_parts[1], row, "EI|-zeta|f1|f2 ratio")
+ f_one = numeric(ei_parts[2], row, "EI|-zeta|f1|f2 frequency f1")
+ f_two = numeric(ei_parts[3], row, "EI|-zeta|f1|f2 frequency f2")
+ if not -1.0 < ratio < 0.0:
+ raise DeckFormatError(
+ f'{self._at(row)}: LINE TYPES EI column "{row.tokens[5]}": '
+ "EI|-zeta|f1|f2 takes a damping ratio 0 < zeta < 1, written negative"
+ )
+ if not (f_one > 0.0 and f_two > 0.0):
+ raise DeckFormatError(
+ f'{self._at(row)}: LINE TYPES EI column "{row.tokens[5]}": the '
+ "frequencies f1 and f2 of EI|-zeta|f1|f2 must be positive [Hz]"
+ )
+ bend_damping = -ratio * ei / (math.pi * (f_one + f_two))
+ # a damping asked for (a ratio form, or Bb > 0) needs a finite EI: on EI = 0 the
+ # ratio form resolves to Bb = 0 and would pass unnoticed
+ if (len(ei_parts) >= 3 or bend_damping > 0.0) and not ei > 0.0:
+ raise DeckFormatError(
+ f"{self._at(row)}: LINE TYPES {row.tokens[0]}: bending damping (EI|Bb) needs "
+ "a finite-EI cable (EI > 0)"
+ )
+ if len(row.tokens) in (11, 13, 15, 17):
+ # Native check_viv_columns: MoorDyn's cross-flow VIV columns Cl [dF cF], after
+ # the ten standard columns or the fourteen of a finite-EI row
+ at = 10 if len(row.tokens) in (11, 13) else 14
+ cl = numeric(row.tokens[at], row, "Cl")
d_f, c_f = (
- (numeric(row.tokens[11], row, "dF"), numeric(row.tokens[12], row, "cF"))
- if len(row.tokens) == 13
+ (numeric(row.tokens[at + 1], row, "dF"), numeric(row.tokens[at + 2], row, "cF"))
+ if len(row.tokens) in (13, 17)
else (0.08, 0.18)
)
if cl < 0.0:
@@ -3815,7 +4433,7 @@ def numeric(token: str, row: DeckRecord, field: str) -> float:
model = "Syrope" if is_syrope else "viscoelastic stiffness"
raise DeckFormatError(f"{self._at(row)}: {model} is not supported with EI > 0")
gj_value = 0.0
- if len(row.tokens) == 14:
+ if len(row.tokens) >= 14:
# the GJ column is GJ, GJ|K or GJ|K|Bt (K the torque-tension coupling, N m;
# Bt the torsional damping, N m^2 s, negative: -zeta)
gj_parts = row.tokens[7].split("|")
@@ -3972,7 +4590,7 @@ def unique(records: tuple[DeckRecord, ...], label: str, numeric: bool) -> set[st
type_names = unique(self.line_types, "line type", False)
if any(
- len(row.tokens) == 14 and self._stock_line_type_columns(row) for row in self.line_types
+ len(row.tokens) >= 14 and self._stock_line_type_columns(row) for row in self.line_types
):
raise DeckFormatError(
f"{self._label}: 14-column LINE TYPES rows require CableDyn hydro-column order"
@@ -4016,6 +4634,15 @@ def end_key(token: str) -> str:
f"z = -WtrDpth = {z_floor:.10g} m by more than the {tolerance:.2e} m "
"seabed tolerance; place the anchor on (or above) the seabed"
)
+ # Native promote_free_cable_ends: a Free point that ends exactly one finite-EI line as its
+ # End B (from a Coupled/Vessel End A, pinned and free in torsion, net heavy), on a
+ # standalone deck of finite-EI lines with no BODIES, RODS or Connect point, is the line's
+ # free End B (its loads an end attachment) and reads Fixed from here on, when every Free
+ # point of the deck is such an end; otherwise the deck is left as it is.
+ free_cable_ends = self._free_cable_ends(point_types, line_type_meta, effective)
+ self._free_cable_end_points = free_cable_ends
+ for point_id in free_cable_ends:
+ point_types[point_id] = "fixed"
has_dynamic_points = any(
point_type in {"connect", "free"} or point_type.startswith(("body", "rod"))
for point_type in point_types.values()
@@ -4307,6 +4934,37 @@ def end_key(token: str) -> str:
)
self._check_stiffeners(line_ids, section_types_by_line, line_type_meta, line_lengths)
+ self._check_viv_section(line_type_meta, viv_type_names)
+ 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, 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 = {
+ line_id
+ for line_id, section_types in section_types_by_line.items()
+ if {line_type.lower() for line_type in section_types} & amp_type_names
+ }
+ # native build_one_hermite_cable and the EI = 0 line wiring: the cross-flow damping acts on
+ # finite-EI cables only, and a line takes one VIV model
+ for line_id, section_types in section_types_by_line.items():
+ types_used = {line_type.lower() for line_type in section_types}
+ if types_used & damp_type_names and line_id not in finite_line_ids:
+ raise DeckFormatError(
+ f"{self._label}: line {line_id}: the cross-flow damping (VIV DAMPING "
+ "section) acts on finite-EI cables (EI > 0) only"
+ )
+ if not types_used & wake_type_names:
+ continue
+ if types_used & viv_type_names:
+ raise DeckFormatError(
+ f"{self._label}: line {line_id}: a line takes one VIV model, but its types mix "
+ "the synchronisation lift (LINE TYPES Cl > 0) and the wake oscillator (WAKE "
+ "OSCILLATOR section)"
+ )
self._check_attachments(line_ids, section_types_by_line, line_type_meta, line_lengths)
assigned_end_connections: set[tuple[str, str]] = set()
@@ -5317,6 +5975,58 @@ def is_body_kind(kind: str, pinned: bool) -> bool:
"restrained (END CONNECTIONS TorsStiffness), so it carries no torque"
)
continue
+ if lowered.startswith("vivamp"):
+ # native: VIVAmpN, the smoothed VIV amplitude estimate (VIV AMPLITUDE)
+ line_number, node_id, kind, _ = _parse_line_node_channel(lowered)
+ line_id = str(line_number)
+ if (
+ node_id == 0
+ and line_id in line_ids
+ and re.search(r"[0-9]n0(?![0-9])", lowered) is not None
+ ):
+ raise DeckFormatError(
+ f"{self._label}: OUTPUT {channel!r}: node numbers start at 1 = End A "
+ "(MoorDyn numbers from N0)"
+ )
+ if line_id not in line_ids or kind == 0 or node_id < 1:
+ raise DeckFormatError(
+ f"{self._label}: OUTPUT {channel!r}: bad VIV amplitude channel (use "
+ "VIVAmpN, with a known line id)"
+ )
+ if node_id > line_nelems[line_id] + 1:
+ raise DeckFormatError(
+ f"{self._label}: OUTPUT {channel!r} node exceeds the line node count"
+ )
+ if line_id not in amp_lines:
+ raise DeckFormatError(
+ f"{self._label}: OUTPUT {channel!r}: line {line_id} has no VIV AMPLITUDE "
+ "table, so no amplitude estimate"
+ )
+ continue
+ if lowered.startswith(("vivpow", "dragpow", "damppow")):
+ # native: VIVPow/DragPow/DampPow and N, the load power channels
+ line_number, node_id, kind, _ = _parse_line_node_channel(lowered)
+ line_id = str(line_number)
+ if (
+ node_id == 0
+ and line_id in line_ids
+ and re.search(r"[0-9]n0(?![0-9])", lowered) is not None
+ ):
+ raise DeckFormatError(
+ f"{self._label}: OUTPUT {channel!r}: node numbers start at 1 = End A "
+ "(MoorDyn numbers from N0)"
+ )
+ if line_id not in line_ids or kind == 0 or node_id < 1:
+ raise DeckFormatError(
+ f"{self._label}: OUTPUT {channel!r}: bad load power channel (use "
+ "VIVPow, DragPow, DampPow, or N per unit length, "
+ "with a known line id)"
+ )
+ if node_id > line_nelems[line_id] + 1:
+ raise DeckFormatError(
+ f"{self._label}: OUTPUT {channel!r} node exceeds the line node count"
+ )
+ continue
if lowered.startswith(("ten", "curv", "bendmom", "stfmom", "l")):
# native parse_line_node_channel: Ten/Curv/BendMom/StfMomN, LN...
line_number, node_id, kind, _ = _parse_line_node_channel(lowered)
@@ -5928,6 +6638,8 @@ def _check_torsion_lines(
"its LINE TYPES rows give no GJ (the 14-column row; torsion has no "
"EI/1.3 default)"
)
+ elif end_b in getattr(self, "_free_cable_end_points", set()):
+ note = "its End B is a free end (a Free point)"
elif point_types[end_b] != "fixed":
note = "it has two moving ends (torsion needs a Fixed End B)"
elif dynamic and not force_blend:
@@ -6041,10 +6753,13 @@ def _check_torsion_lines(
def _line_type_fields(self, record: DeckRecord) -> tuple[str, ...]:
fields = _FIELDS["line_type"]
- if len(record.tokens) == 14:
- return (*fields[:6], "gas", "gj", "irt", "irn", "cdn", "cdt", "can", "cat")
- # MoorDyn's optional cross-flow VIV columns follow the ten standard ones
- viv = {11: ("cl",), 13: ("cl", "df", "cf")}.get(len(record.tokens), ())
+ # MoorDyn's optional cross-flow VIV columns follow the ten standard ones, or the
+ # fourteen of a finite-EI row
+ viv = {11: ("cl",), 13: ("cl", "df", "cf"), 15: ("cl",), 17: ("cl", "df", "cf")}.get(
+ len(record.tokens), ()
+ )
+ if len(record.tokens) >= 14:
+ return (*fields[:6], "gas", "gj", "irt", "irn", "cdn", "cdt", "can", "cat", *viv)
if self._stock_line_type_columns(record):
return (*fields[:6], "cd", "ca", "cdax", "caax", *viv)
return (*fields, *viv)
diff --git a/python/cabledyn/ranges.py b/python/cabledyn/ranges.py
index be641e19..13dde176 100644
--- a/python/cabledyn/ranges.py
+++ b/python/cabledyn/ranges.py
@@ -57,7 +57,9 @@
"curvature": ("Curv", "Curvature", "1/m"),
"bend_moment": ("BendMom", "BendMoment", "N-m"),
}
-_NODE_QUANTITY = re.compile(r"(Ten|Curv|BendMom)0*([1-9][0-9]{0,8})N0*([1-9][0-9]{0,8})", re.I)
+_NODE_QUANTITY = re.compile(
+ r"(Ten|CurvX|CurvY|Curv|BendMom)0*([1-9][0-9]{0,8})N0*([1-9][0-9]{0,8})", re.I
+)
_NODE_POSITION = re.compile(r"L0*([1-9][0-9]{0,8})N0*([1-9][0-9]{0,8})p([xyz])", re.I)
ArcSource = StaticProfile | Mapping[int, float] | None
diff --git a/python/cabledyn/study.py b/python/cabledyn/study.py
index 6c721f2c..0fb54c4d 100644
--- a/python/cabledyn/study.py
+++ b/python/cabledyn/study.py
@@ -314,6 +314,19 @@ def _case_dict(case: StudyCaseResult) -> dict[str, object]:
return result
+def _case_environment(job_count: int) -> dict[str, str] | None:
+ """The environment entries of every case process: one OpenMP thread each when several run at
+ once and the caller's environment does not choose a count, otherwise none.
+
+ Several CableDyn processes that each start an OpenMP team oversubscribe the cores; on a 24-core
+ workstation a batch of 24 finite-EI lazy-wave runs took 14 % longer with OpenMP left at its
+ default than with one thread per process.
+ """
+ if job_count <= 1 or os.environ.get("OMP_NUM_THREADS", "").strip():
+ return None
+ return {"OMP_NUM_THREADS": "1"}
+
+
def run_study(
case_manifest: str | os.PathLike[str],
*,
@@ -354,7 +367,10 @@ def run_study(
Per-case time limit, in seconds; ``None`` for no limit.
jobs : int
Number of independent native processes run at once (not solver
- threads within a process).
+ threads within a process). With ``jobs > 1`` and no
+ ``OMP_NUM_THREADS`` in the environment, each process runs with
+ ``OMP_NUM_THREADS=1``: the processes then share the cores without
+ oversubscribing them. A set ``OMP_NUM_THREADS`` is passed on unchanged.
overwrite : bool
Allow a non-empty output directory and replace existing case outputs.
@@ -446,6 +462,7 @@ def run_study(
solver_version = native.version()
destination.mkdir(parents=True, exist_ok=True)
+ case_env = _case_environment(job_count)
started = datetime.now(timezone.utc).isoformat()
summaries: dict[str, list[dict[str, object]]] = {}
summaries_lock = threading.Lock()
@@ -464,9 +481,14 @@ def execute(case: _Case) -> StudyCaseResult:
main_output: Path | None = None
static_output: Path | None = None
try:
- native_result = native.run(
- case.deck, output_root, timeout=timeout_value, overwrite=overwrite
- )
+ if case_env is None:
+ native_result = native.run(
+ case.deck, output_root, timeout=timeout_value, overwrite=overwrite
+ )
+ else:
+ native_result = native.run(
+ case.deck, output_root, timeout=timeout_value, overwrite=overwrite, env=case_env
+ )
stdout, stderr = native_result.stdout, native_result.stderr
returncode = native_result.returncode
main_output = native_result.main_output
@@ -600,6 +622,11 @@ def execute(case: _Case) -> StudyCaseResult:
"started_at": started,
"finished_at": finished,
"jobs": job_count,
+ "omp_num_threads": (
+ case_env["OMP_NUM_THREADS"]
+ if case_env is not None
+ else os.environ.get("OMP_NUM_THREADS")
+ ),
"timeout": timeout_value,
"period": {"start": start_value, "stop": stop_value},
"channels": list(selected) if selected is not None else None,
diff --git a/python/cabledyn/viv.py b/python/cabledyn/viv.py
new file mode 100644
index 00000000..414d86e2
--- /dev/null
+++ b/python/cabledyn/viv.py
@@ -0,0 +1,766 @@
+# SPDX-License-Identifier: Apache-2.0
+"""Vortex-induced vibration (VIV) response of a line from its node positions.
+
+:func:`viv_response` resolves the motion of every node of a line about its mean
+position into the local flow frame of the node and reports the quantities a VIV
+study describes a response by: the cross-flow and in-line amplitude along the
+span, the response frequencies and the non-dimensional frequency they give
+against the flow, the modal content, how far the response is a travelling wave,
+and the in-line/cross-flow orbits.
+
+The local frame of a node follows the mean shape over the analysed window: the
+tangent ``t`` from End A towards End B (central differences of the mean node
+positions), the in-line direction ``e_x`` along the part of the flow velocity
+normal to the tangent, and the cross-flow direction ``e_y = t x e_x``, so that
+``(e_x, e_y, t)`` is right-handed. A node whose tangent is parallel to the flow
+has no normal flow and no frame; its values are ``nan``.
+
+The positions come from a CableDyn per-line position file
+(``.Line.p.out``, a :class:`~cabledyn.LineNodeHistory`), a MoorDyn
+per-line file with node positions (a :class:`~cabledyn.MoorDynLineHistory`), or
+the ``LNpx``/``py``/``pz`` channels of a main output for the nodes the
+deck lists. The frequency analysis needs uniform sampling.
+"""
+
+from __future__ import annotations
+
+import math
+import os
+from dataclasses import dataclass
+from pathlib import Path
+from typing import Any
+
+import numpy as np
+import numpy.typing as npt
+
+from cabledyn._csv import number, write_csv
+from cabledyn._optional import pyplot
+from cabledyn.formats import MoorDynLineHistory
+from cabledyn.ranges import node_position_channels
+from cabledyn.results import LineNodeHistory, TimeHistory
+from cabledyn.spectra import _sampling
+from cabledyn.touchdown import _positions
+
+__all__ = ["CurrentSteps", "ModalAmplitudes", "VIVResponse", "current_steps", "viv_response"]
+
+_DIRECTIONS = ("cross_flow", "in_line")
+
+
+def _readonly(values: npt.ArrayLike, dtype: npt.DTypeLike = np.float64) -> npt.NDArray[Any]:
+ array = np.array(values, dtype=dtype, copy=True)
+ array.setflags(write=False)
+ return array
+
+
+def _direction(direction: str) -> str:
+ if direction not in _DIRECTIONS:
+ raise ValueError(f"direction must be one of {_DIRECTIONS}, not {direction!r}")
+ return direction
+
+
+def _peak_frequency(frequency: npt.NDArray[Any], power: npt.NDArray[Any]) -> float:
+ """Frequency of the largest power above zero, refined by a parabola through its neighbours."""
+ if power.size < 3 or not np.any(power[1:] > 0.0):
+ return math.nan
+ k = int(np.argmax(power[1:])) + 1
+ if 1 <= k < power.size - 1:
+ left, middle, right = power[k - 1], power[k], power[k + 1]
+ curvature = left - 2.0 * middle + right
+ if curvature < 0.0:
+ shift = 0.5 * (left - right) / curvature
+ return float(frequency[k] + shift * (frequency[1] - frequency[0]))
+ return float(frequency[k])
+
+
+@dataclass(frozen=True)
+class ModalAmplitudes:
+ """The modal content of one direction of a VIV response.
+
+ Attributes
+ ----------
+ direction : str
+ ``"cross_flow"`` or ``"in_line"``.
+ mode_numbers : tuple[int, ...]
+ One-based numbers of the shapes fitted.
+ coefficients : numpy.ndarray
+ Read-only ``(n_samples, n_modes)`` least-squares weights of the shapes
+ in the displacement at every sample, in metres per unit shape.
+ rms_over_diameter : numpy.ndarray
+ Read-only ``(n_modes,)`` RMS of each weight over the window, divided by
+ the diameter.
+ residual : float
+ RMS of the displacement the shapes leave unexplained, over the RMS of
+ the displacement (0 when the shapes reproduce it).
+ """
+
+ direction: str
+ mode_numbers: tuple[int, ...]
+ coefficients: npt.NDArray[Any]
+ rms_over_diameter: npt.NDArray[Any]
+ residual: float
+
+ @property
+ def dominant_mode(self) -> int:
+ """Number of the shape with the largest RMS weight."""
+ return self.mode_numbers[int(np.argmax(self.rms_over_diameter))]
+
+
+@dataclass(frozen=True)
+class VIVResponse:
+ """The VIV response of one line over an analysis window.
+
+ Created by :func:`viv_response`. Nodes are in End-A-to-End-B order of the
+ source; node arrays have one entry per node, time arrays one per sample.
+
+ Attributes
+ ----------
+ time : numpy.ndarray
+ Read-only ``(n_samples,)`` sample times of the window, in seconds.
+ arc_length : numpy.ndarray
+ Read-only ``(n_nodes,)`` chord length of the mean shape from End A, m.
+ mean_position : numpy.ndarray
+ Read-only ``(n_nodes, 3)`` mean node positions over the window, m.
+ tangent, in_line_axis, cross_flow_axis : numpy.ndarray
+ Read-only ``(n_nodes, 3)`` unit vectors of each node's local frame
+ (``nan`` rows where the flow is along the tangent).
+ normal_speed : numpy.ndarray
+ Read-only ``(n_nodes,)`` speed of the flow normal to the mean tangent,
+ m/s.
+ in_line, cross_flow : numpy.ndarray
+ Read-only ``(n_samples, n_nodes)`` displacement about the mean position
+ along the node's in-line and cross-flow axes, m.
+ diameter : float
+ Diameter the amplitudes are divided by, m.
+ flow : numpy.ndarray
+ Read-only ``(3,)`` flow velocity the frame is taken against, m/s.
+ whole_line : bool
+ Whether the nodes are the whole line, End A to End B (a per-line
+ file), so that ``arc_length`` spans it; a main output may hold only
+ some of its nodes.
+ node_numbers : tuple of int
+ The CableDyn number of each node (1 = End A): ``1 .. n_nodes`` for a
+ per-line file (MoorDyn's node ``J`` is ``J + 1``), the ``J`` of the
+ ``LNp`` channels for a main output. The methods that take a
+ node take this number. Empty means ``1 .. n_nodes``.
+ """
+
+ time: npt.NDArray[Any]
+ arc_length: npt.NDArray[Any]
+ mean_position: npt.NDArray[Any]
+ tangent: npt.NDArray[Any]
+ in_line_axis: npt.NDArray[Any]
+ cross_flow_axis: npt.NDArray[Any]
+ normal_speed: npt.NDArray[Any]
+ in_line: npt.NDArray[Any]
+ cross_flow: npt.NDArray[Any]
+ diameter: float
+ flow: npt.NDArray[Any]
+ whole_line: bool = True
+ node_numbers: tuple[int, ...] = ()
+
+ @property
+ def node_count(self) -> int:
+ """Number of nodes."""
+ return int(self.arc_length.size)
+
+ @property
+ def sampling_interval(self) -> float:
+ """Uniform sampling interval of the window, s."""
+ return float(self.time[1] - self.time[0])
+
+ def displacement(self, direction: str) -> npt.NDArray[Any]:
+ """Return the ``(n_samples, n_nodes)`` displacement of ``"cross_flow"`` or ``"in_line"``."""
+ return self.cross_flow if _direction(direction) == "cross_flow" else self.in_line
+
+ def rms_over_diameter(self, direction: str = "cross_flow") -> npt.NDArray[Any]:
+ """Return the ``(n_nodes,)`` RMS displacement over the diameter.
+
+ For a harmonic response the amplitude is ``sqrt(2)`` times the RMS.
+ """
+ values = self.displacement(direction)
+ return _readonly(np.sqrt(np.mean(values * values, axis=0)) / self.diameter)
+
+ def amplitude_over_diameter(self, direction: str = "cross_flow") -> npt.NDArray[Any]:
+ """Return the ``(n_nodes,)`` half peak-to-peak displacement over the diameter."""
+ values = self.displacement(direction)
+ return _readonly(0.5 * (values.max(axis=0) - values.min(axis=0)) / self.diameter)
+
+ def _moving_displacement(self, direction: str) -> npt.NDArray[Any]:
+ """The displacement of a direction with still nodes set to exactly zero.
+
+ A node whose displacement stays within round-off of its coordinates (a range below
+ 1e-12 of its distance from the origin plus the diameter) is still: its round-off
+ offset from the mean, windowed or transformed, would otherwise read as motion at
+ every frequency, with an arbitrary phase.
+ """
+ values = np.array(self.displacement(direction), dtype=np.float64)
+ scale = np.linalg.norm(self.mean_position, axis=1) + self.diameter
+ with np.errstate(invalid="ignore"):
+ still = (values.max(axis=0) - values.min(axis=0)) <= 1.0e-12 * scale
+ values[:, still] = 0.0
+ return values
+
+ def _power(self, direction: str) -> tuple[npt.NDArray[Any], npt.NDArray[Any]]:
+ """Frequencies and the ``(n_freq, n_nodes)`` Hann-windowed periodogram of a direction.
+
+ Still nodes (:meth:`_moving_displacement`) have no power.
+ """
+ values = self._moving_displacement(direction)
+ window = np.hanning(self.time.size)
+ spectrum = np.fft.rfft(values * window[:, None], axis=0)
+ frequency = np.fft.rfftfreq(self.time.size, self.sampling_interval)
+ return frequency, np.abs(spectrum) ** 2
+
+ def frequencies(self, direction: str = "cross_flow") -> npt.NDArray[Any]:
+ """Return the ``(n_nodes,)`` dominant response frequency of each node, Hz.
+
+ The peak of the node's Hann-windowed periodogram above zero frequency,
+ refined by a parabola through the bins beside it; ``nan`` for a node
+ without a frame or without motion.
+ """
+ frequency, power = self._power(direction)
+ result = np.full(self.node_count, math.nan)
+ for node in range(self.node_count):
+ if np.all(np.isfinite(power[:, node])):
+ result[node] = _peak_frequency(frequency, power[:, node])
+ return _readonly(result)
+
+ def frequency(self, direction: str = "cross_flow") -> float:
+ """Return the dominant response frequency of the line, Hz.
+
+ The peak of the sum of the nodes' periodograms (``nan`` without motion).
+ """
+ frequency, power = self._power(direction)
+ finite = np.all(np.isfinite(power), axis=0)
+ if not np.any(finite):
+ return math.nan
+ return _peak_frequency(frequency, power[:, finite].sum(axis=1))
+
+ def nondimensional_frequency(self, direction: str = "cross_flow") -> npt.NDArray[Any]:
+ """Return ``f D / U_n`` at every node, with ``f`` the line's dominant frequency.
+
+ For the cross-flow response this is the quantity a synchronisation
+ model's band ``cF +/- dF`` bounds, and its reciprocal the reduced
+ velocity ``U_n/(f D)``.
+ """
+ with np.errstate(divide="ignore", invalid="ignore"):
+ result = self.frequency(direction) * self.diameter / self.normal_speed
+ return _readonly(np.where(self.normal_speed > 0.0, result, math.nan))
+
+ def modal_amplitudes(
+ self,
+ direction: str = "cross_flow",
+ *,
+ n_modes: int = 10,
+ shapes: npt.ArrayLike | None = None,
+ ) -> ModalAmplitudes:
+ """Fit mode shapes to the displacement of a direction at every sample.
+
+ Parameters
+ ----------
+ direction : str
+ ``"cross_flow"`` or ``"in_line"``.
+ n_modes : int
+ Number of the default shapes ``sin(n pi s / S)``, ``n = 1 ..
+ n_modes``, of arc length ``s`` from End A over the mean chord
+ length ``S`` (the modes of a taut string with fixed ends). Ignored
+ when ``shapes`` is given.
+ shapes : array_like, optional
+ ``(n_modes, n_nodes)`` scalar shapes of the direction at the nodes
+ to fit instead, for example a component of the run's mode shapes.
+
+ Returns
+ -------
+ ModalAmplitudes
+ The weights of the shapes at every sample (least squares over the
+ nodes with a frame), their RMS over the diameter and the share of
+ the displacement they leave unexplained.
+
+ Raises
+ ------
+ ValueError
+ If the shapes are not finite, have the wrong number of nodes, or
+ fewer nodes with a frame than shapes remain; if the shapes are not
+ independent at those nodes (a sine that vanishes at every node, or
+ two that alias each other on a coarse output); or if the default
+ shapes are asked of a response that does not hold the whole line.
+ """
+ values = self.displacement(direction)
+ if shapes is None:
+ if isinstance(n_modes, bool) or int(n_modes) != n_modes or n_modes < 1:
+ raise ValueError("n_modes must be a positive integer")
+ if not self.whole_line:
+ # the sines vanish at the line's ends, which the nodes of a main output may
+ # not include: fitted over the span of the nodes it holds, they would be wrong
+ raise ValueError(
+ "the default shapes need the whole line, End A to End B: analyse the "
+ "per-line .p.out file, or give shapes at the nodes held"
+ )
+ span = float(self.arc_length[-1])
+ if not span > 0.0:
+ raise ValueError("the mean shape has no length")
+ numbers = np.arange(1, int(n_modes) + 1)
+ basis = np.sin(np.pi * numbers[:, None] * self.arc_length[None, :] / span)
+ else:
+ basis = np.array(shapes, dtype=np.float64)
+ if basis.ndim != 2 or basis.shape[1] != self.node_count or basis.shape[0] < 1:
+ raise ValueError(f"shapes must have shape (n_modes, {self.node_count})")
+ if not np.all(np.isfinite(basis)):
+ raise ValueError("shapes must be finite")
+ numbers = np.arange(1, basis.shape[0] + 1)
+ framed = np.all(np.isfinite(values), axis=0)
+ if int(np.count_nonzero(framed)) < basis.shape[0]:
+ raise ValueError("fewer nodes with a flow frame than shapes to fit")
+ design = basis[:, framed].T
+ target = values[:, framed].T
+ coefficients, _, rank, _ = np.linalg.lstsq(design, target, rcond=None)
+ if int(rank) < basis.shape[0]:
+ # dependent shapes at the nodes held (a mode that vanishes at every node, or two
+ # that alias each other): their weights are not determined by the motion
+ raise ValueError(
+ f"the {basis.shape[0]} shapes are not independent at the nodes with a flow frame "
+ f"(rank {int(rank)}): fit fewer modes, or use a finer output"
+ )
+ left = target - design @ coefficients
+ total = float(np.sqrt(np.mean(target * target)))
+ residual = float(np.sqrt(np.mean(left * left))) / total if total > 0.0 else 0.0
+ rms = np.sqrt(np.mean(coefficients * coefficients, axis=1)) / self.diameter
+ return ModalAmplitudes(
+ direction=_direction(direction),
+ mode_numbers=tuple(int(n) for n in numbers),
+ coefficients=_readonly(coefficients.T),
+ rms_over_diameter=_readonly(rms),
+ residual=residual,
+ )
+
+ def complex_shape(
+ self, direction: str = "cross_flow", frequency: float | None = None
+ ) -> npt.NDArray[Any]:
+ """Return the ``(n_nodes,)`` complex Fourier shape of a direction at one frequency.
+
+ ``c_j = (2/W) sum_k w_k u_j(t_k) exp(-2 pi i f t_k)`` with the Hann
+ window ``w`` of sum ``W``, so that a node moving as ``a cos(2 pi f t +
+ phase)`` has ``c_j = a exp(i phase)``; ``frequency`` defaults to the
+ line's dominant frequency of the direction. A still node has ``c_j = 0``.
+ """
+ f = self.frequency(direction) if frequency is None else float(frequency)
+ if not (math.isfinite(f) and f >= 0.0):
+ raise ValueError("the frequency must be finite and non-negative")
+ window = np.hanning(self.time.size)
+ phasor = window * np.exp(-2j * np.pi * f * self.time)
+ shape: npt.NDArray[Any] = np.asarray(
+ 2.0 * (phasor @ self._moving_displacement(direction)) / window.sum(),
+ dtype=np.complex128,
+ )
+ shape.setflags(write=False)
+ return shape
+
+ def travelling_wave_index(
+ self, direction: str = "cross_flow", frequency: float | None = None
+ ) -> float:
+ """Return how far the response of a direction is a travelling wave, from 0 to 1.
+
+ The ratio of the smaller to the larger singular value of the real and
+ imaginary parts of :meth:`complex_shape` (the travelling index of the
+ complex orthogonal decomposition, Feeny 2008): 0 for a standing wave,
+ whose nodes move in or out of phase, and 1 for a wave of constant
+ amplitude travelling over whole wavelengths. ``nan`` without motion.
+ """
+ if frequency is None and not math.isfinite(self.frequency(direction)):
+ return math.nan # no motion, or no node with a flow frame
+ shape = self.complex_shape(direction, frequency)
+ framed = np.isfinite(shape)
+ parts = np.vstack((shape[framed].real, shape[framed].imag))
+ if parts.shape[1] < 2:
+ return math.nan
+ singular = np.linalg.svd(parts, compute_uv=False)
+ return float(singular[1] / singular[0]) if singular[0] > 0.0 else math.nan
+
+ def orbit(self, node: int) -> tuple[npt.NDArray[Any], npt.NDArray[Any]]:
+ """Return the in-line and cross-flow displacement of a node over the window.
+
+ ``node`` is the node's number (:attr:`node_numbers`).
+ """
+ index = self._node_index(node)
+ return self.in_line[:, index], self.cross_flow[:, index]
+
+ def phase_difference(self, node: int, frequency: float | None = None) -> float:
+ """Return the in-line phase less twice the cross-flow phase at a node, in degrees.
+
+ ``theta = arg(c_x(2 f)) - 2 arg(c_y(f))`` in ``[0, 360)``, with ``c``
+ the node's complex Fourier coefficients (:meth:`complex_shape`) and
+ ``f`` the cross-flow frequency (default: the line's dominant one): the
+ phase that sets the shape and direction of a figure-of-eight orbit.
+ ``nan`` for a node without a frame or without motion at those
+ frequencies.
+ """
+ index = self._node_index(node)
+ f = self.frequency("cross_flow") if frequency is None else float(frequency)
+ if not math.isfinite(f):
+ return math.nan
+ cy = self.complex_shape("cross_flow", f)[index]
+ cx = self.complex_shape("in_line", 2.0 * f)[index]
+ if not (np.isfinite(cx) and np.isfinite(cy)) or abs(cx) == 0.0 or abs(cy) == 0.0:
+ return math.nan
+ return float(np.degrees(np.angle(cx) - 2.0 * np.angle(cy)) % 360.0)
+
+ def _numbers(self) -> tuple[int, ...]:
+ """The node numbers, ``1 .. n_nodes`` when none were recorded."""
+ return self.node_numbers or tuple(range(1, self.node_count + 1))
+
+ def _node_index(self, node: int) -> int:
+ numbers = self._numbers()
+ if isinstance(node, bool) or int(node) != node or int(node) not in numbers:
+ if numbers == tuple(range(1, self.node_count + 1)):
+ raise ValueError(f"node must be an integer from 1 to {self.node_count}")
+ raise ValueError(f"node must be one of the nodes held, {list(numbers)}")
+ return numbers.index(int(node))
+
+ def export(self, path: str | os.PathLike[str], *, overwrite: bool = False) -> Path:
+ """Atomically write the node values as a unit-labelled CSV, one row per node.
+
+ Columns: node number (:attr:`node_numbers`), arc length, normal flow speed,
+ cross-flow and in-line RMS
+ and half peak-to-peak displacement over the diameter, the nodes'
+ dominant frequencies and the non-dimensional cross-flow frequency.
+ Fields of a node without a frame are empty.
+
+ Raises
+ ------
+ FileExistsError
+ If ``path`` exists and ``overwrite`` is false.
+ """
+ columns = (
+ self.arc_length,
+ self.normal_speed,
+ self.rms_over_diameter("cross_flow"),
+ self.rms_over_diameter("in_line"),
+ self.amplitude_over_diameter("cross_flow"),
+ self.amplitude_over_diameter("in_line"),
+ self.frequencies("cross_flow"),
+ self.frequencies("in_line"),
+ self.nondimensional_frequency("cross_flow"),
+ )
+
+ numbers = self._numbers()
+
+ def row(index: int) -> tuple[str, ...]:
+ fields = tuple(
+ number(column[index]) if math.isfinite(float(column[index])) else ""
+ for column in columns
+ )
+ return (str(numbers[index]), *fields)
+
+ return write_csv(
+ path,
+ (
+ "Node",
+ "ArcLength_[m]",
+ "NormalSpeed_[m/s]",
+ "CrossFlowRMSOverD_[-]",
+ "InLineRMSOverD_[-]",
+ "CrossFlowAmplitudeOverD_[-]",
+ "InLineAmplitudeOverD_[-]",
+ "CrossFlowFrequency_[Hz]",
+ "InLineFrequency_[Hz]",
+ "CrossFlowNondimensionalFrequency_[-]",
+ ),
+ (row(index) for index in range(self.node_count)),
+ overwrite=overwrite,
+ )
+
+ def plot_envelope(self, *, ax: Any = None) -> Any:
+ """Plot the cross-flow and in-line RMS displacement over the diameter along the line."""
+ plt = pyplot()
+ if ax is None:
+ _, ax = plt.subplots()
+ ax.plot(self.arc_length, self.rms_over_diameter("cross_flow"), label="cross-flow")
+ ax.plot(self.arc_length, self.rms_over_diameter("in_line"), label="in-line")
+ ax.set_xlabel("Arc length from End A (m)")
+ ax.set_ylabel("RMS displacement / D (-)")
+ ax.legend()
+ return ax
+
+ def plot_orbit(self, node: int, *, ax: Any = None) -> Any:
+ """Plot a node's cross-flow displacement against its in-line displacement, over D."""
+ plt = pyplot()
+ if ax is None:
+ _, ax = plt.subplots()
+ x, y = self.orbit(node)
+ ax.plot(x / self.diameter, y / self.diameter)
+ ax.set_xlabel("In-line displacement / D (-)")
+ ax.set_ylabel("Cross-flow displacement / D (-)")
+ ax.set_aspect("equal", adjustable="datalim")
+ return ax
+
+
+def viv_response(
+ history: TimeHistory,
+ *,
+ flow: npt.ArrayLike,
+ diameter: float,
+ start: float | None = None,
+ stop: float | None = None,
+ line_id: int | None = None,
+ uniform_rtol: float = 1.0e-6,
+) -> VIVResponse:
+ """Resolve a line's node motion into its VIV response.
+
+ Parameters
+ ----------
+ history : TimeHistory
+ A :class:`~cabledyn.LineNodeHistory`, a :class:`~cabledyn.MoorDynLineHistory`
+ with node positions, or a main output with the line's
+ ``LNp{x,y,z}`` channels.
+ flow : array_like
+ ``(3,)`` flow velocity the local frames are taken against, m/s: the
+ current at the line (a uniform one, or a representative velocity of a
+ sheared one).
+ diameter : float
+ Diameter the amplitudes are divided by, m.
+ start, stop : float, optional
+ The window to analyse, s (default: the whole record); a lock-in study
+ leaves out the build-up.
+ line_id : int, optional
+ The line of a main output (required there, refused for a per-line file).
+ uniform_rtol : float
+ Relative tolerance of the uniform-sampling check.
+
+ Returns
+ -------
+ VIVResponse
+ The displacement in the local flow frames and the response measures.
+
+ Raises
+ ------
+ ValueError
+ If the flow is not a finite non-zero 3-vector, the diameter is not
+ positive, the window holds fewer than eight samples, the sampling is
+ not uniform, or the mean shape has coincident nodes.
+ """
+ velocity = np.array(flow, dtype=np.float64)
+ if velocity.shape != (3,) or not np.all(np.isfinite(velocity)) or not np.any(velocity):
+ raise ValueError("flow must be a finite, non-zero 3-vector")
+ if not (math.isfinite(float(diameter)) and float(diameter) > 0.0):
+ raise ValueError("diameter must be finite and positive")
+ time, positions = _positions(history, line_id)
+ whole_line = isinstance(history, (LineNodeHistory, MoorDynLineHistory))
+ if whole_line or line_id is None:
+ numbers = tuple(range(1, positions.shape[1] + 1))
+ else:
+ # the LNp nodes _positions took, in the same (ascending) order
+ numbers = tuple(node_position_channels(history, line_id))
+ keep = np.ones(time.size, dtype=bool)
+ if start is not None:
+ keep &= time >= float(start)
+ if stop is not None:
+ keep &= time <= float(stop)
+ time = time[keep]
+ positions = positions[keep]
+ if time.size < 8:
+ raise ValueError("the window must hold at least eight samples")
+ _sampling(time, rtol=float(uniform_rtol), atol=0.0)
+ if positions.shape[1] < 2:
+ raise ValueError("the line must have at least two nodes")
+ mean = positions.mean(axis=0)
+ chords = np.diff(mean, axis=0)
+ lengths = np.linalg.norm(chords, axis=1)
+ if np.any(lengths <= 0.0):
+ raise ValueError("the mean shape has coincident nodes")
+ tangent = np.empty_like(mean)
+ tangent[0] = chords[0]
+ tangent[-1] = chords[-1]
+ tangent[1:-1] = mean[2:] - mean[:-2]
+ tangent /= np.linalg.norm(tangent, axis=1)[:, None]
+ normal = velocity[None, :] - (tangent @ velocity)[:, None] * tangent
+ speed = np.linalg.norm(normal, axis=1)
+ framed = speed > 1.0e-9 * float(np.linalg.norm(velocity))
+ in_axis = np.full_like(mean, math.nan)
+ in_axis[framed] = normal[framed] / speed[framed, None]
+ cross_axis = np.cross(tangent, in_axis)
+ motion = positions - mean[None, :, :]
+ in_line = np.einsum("tnk,nk->tn", motion, in_axis)
+ cross_flow = np.einsum("tnk,nk->tn", motion, cross_axis)
+ return VIVResponse(
+ time=_readonly(time),
+ arc_length=_readonly(np.concatenate(([0.0], np.cumsum(lengths)))),
+ mean_position=_readonly(mean),
+ tangent=_readonly(tangent),
+ in_line_axis=_readonly(in_axis),
+ cross_flow_axis=_readonly(cross_axis),
+ normal_speed=_readonly(np.where(framed, speed, 0.0)),
+ in_line=_readonly(in_line),
+ cross_flow=_readonly(cross_flow),
+ diameter=float(diameter),
+ flow=_readonly(velocity),
+ whole_line=whole_line,
+ node_numbers=numbers,
+ )
+
+
+@dataclass(frozen=True)
+class CurrentSteps:
+ """A uniform current held at a sequence of speeds, for a stepped-current VIV study.
+
+ Created by :func:`current_steps`. The current is held at ``speeds[k]`` for
+ ``hold`` seconds, then ramps linearly over ``ramp`` seconds to the next
+ speed, so one run continues each step from the state the previous one
+ left (the response branch an up-and-down sweep follows). :meth:`write`
+ gives the deck its MoorDyn-C ``Currents 2`` file.
+
+ Attributes
+ ----------
+ speeds : numpy.ndarray
+ Read-only ``(n_steps,)`` current speeds, m/s.
+ hold, ramp : float
+ Hold time of each speed and ramp time between speeds, s.
+ direction : numpy.ndarray
+ Read-only ``(3,)`` unit direction of the current.
+ """
+
+ speeds: npt.NDArray[Any]
+ hold: float
+ ramp: float
+ direction: npt.NDArray[Any]
+
+ @property
+ def starts(self) -> npt.NDArray[Any]:
+ """Read-only ``(n_steps,)`` start time of each hold, s."""
+ return _readonly(np.arange(self.speeds.size) * (self.hold + self.ramp))
+
+ @property
+ def duration(self) -> float:
+ """End of the last hold, s: the deck's ``TMax``.
+
+ The file holds the last speed for two ramps beyond it (:meth:`write`); a
+ longer run then repeats the record.
+ """
+ return float(self.starts[-1] + self.hold)
+
+ def windows(self, settle: float) -> tuple[tuple[float, float], ...]:
+ """Return the analysis window of every hold, from ``settle`` seconds into it to its end."""
+ if not (math.isfinite(float(settle)) and 0.0 <= float(settle) < self.hold):
+ raise ValueError("settle must be finite, non-negative and shorter than the hold")
+ return tuple((float(t) + float(settle), float(t) + self.hold) for t in self.starts)
+
+ def write(
+ self,
+ folder: str | os.PathLike[str],
+ *,
+ depths: tuple[float, float] = (-1.0e4, 0.0),
+ overwrite: bool = False,
+ ) -> Path:
+ """Write ``current_profile_dynamic.txt``, the deck's ``Currents 2`` file, into ``folder``.
+
+ The current is uniform between the two ``depths`` (z, m, increasing) and
+ held beyond them. The file's smallest time interval is the ramp, the time
+ step MoorDyn-C and CableDyn resample it to, so the holds stay exact.
+
+ The resampled table has ``floor(t_last/dt) + 1`` samples and takes its
+ first sample over its last interval (where a longer run starts to repeat
+ it), and a rounded ``dt`` can drop the last sample by one step. The file
+ therefore ends two ramps after :attr:`duration`, still at the last speed,
+ so the run up to ``TMax`` never returns to the first speed.
+
+ Raises
+ ------
+ FileExistsError
+ If the file exists and ``overwrite`` is false.
+ ValueError
+ If the depths are not two finite, increasing elevations.
+ """
+ low, high = (float(z) for z in depths)
+ if not (math.isfinite(low) and math.isfinite(high) and low < high):
+ raise ValueError("depths must be two finite, increasing elevations")
+ target = Path(folder).expanduser().resolve() / "current_profile_dynamic.txt"
+ if target.exists() and not overwrite:
+ raise FileExistsError(f"output already exists: {target}")
+ rows: list[str] = []
+ for k, (start, speed) in enumerate(zip(self.starts, self.speeds, strict=True)):
+ velocity = float(speed) * self.direction
+ values = " ".join(f"{number(v)} {number(v)}" for v in velocity)
+ times = (float(start), float(start) + self.hold) if k else (0.0, self.hold)
+ rows.extend(f"{number(t)} {values}" for t in times)
+ # the guard: the last speed held two ramps past TMax (see above)
+ rows.append(f"{number(self.duration + 2.0 * self.ramp)} {values}")
+ lines = [
+ "--------------------- MoorDyn dynamic currents File -------------------------",
+ "a uniform current held at a sequence of speeds (cabledyn.current_steps)",
+ "line 5 lists the depths (m); each later row is t ux(z1 z2) uy(z1 z2) uz(z1 z2)",
+ "------------------------------------------------------------------------------",
+ f"{number(low)} {number(high)}",
+ "time ux... uy... uz...",
+ *rows,
+ ]
+ target.parent.mkdir(parents=True, exist_ok=True)
+ target.write_text("\n".join(lines) + "\n", encoding="ascii")
+ return target
+
+ def responses(
+ self,
+ history: TimeHistory,
+ *,
+ diameter: float,
+ settle: float,
+ line_id: int | None = None,
+ ) -> tuple[VIVResponse, ...]:
+ """Return the :func:`viv_response` of every hold, from ``settle`` seconds into it."""
+ return tuple(
+ viv_response(
+ history,
+ flow=float(speed) * self.direction,
+ diameter=diameter,
+ start=start,
+ stop=stop,
+ line_id=line_id,
+ )
+ for speed, (start, stop) in zip(self.speeds, self.windows(settle), strict=True)
+ )
+
+
+def current_steps(
+ speeds: npt.ArrayLike,
+ *,
+ hold: float,
+ ramp: float,
+ direction: npt.ArrayLike = (0.0, 1.0, 0.0),
+) -> CurrentSteps:
+ """Return a stepped current schedule.
+
+ Parameters
+ ----------
+ speeds : array_like
+ Positive current speeds, m/s, in the order they are held; an
+ up-and-down sweep lists them up and back.
+ hold : float
+ Hold time of each speed, s; a whole number of ramps.
+ ramp : float
+ Positive ramp time between speeds, s.
+ direction : array_like
+ ``(3,)`` direction of the current (normalised), default ``+y``.
+
+ Raises
+ ------
+ ValueError
+ If a speed is not finite and positive, the times are invalid, the hold
+ is not a whole number of ramps, or the direction is not a finite,
+ non-zero 3-vector.
+ """
+ values = np.array(speeds, dtype=np.float64).reshape(-1)
+ if values.size < 1 or not np.all(np.isfinite(values)) or np.any(values <= 0.0):
+ raise ValueError("speeds must be one or more finite, positive values")
+ hold_s, ramp_s = float(hold), float(ramp)
+ if not (math.isfinite(hold_s) and hold_s > 0.0 and math.isfinite(ramp_s) and ramp_s > 0.0):
+ raise ValueError("hold and ramp must be finite and positive")
+ ratio = hold_s / ramp_s
+ if abs(ratio - round(ratio)) > 1.0e-9 * ratio:
+ raise ValueError("hold must be a whole number of ramps (the file's resampling step)")
+ unit = np.array(direction, dtype=np.float64)
+ if unit.shape != (3,) or not np.all(np.isfinite(unit)) or not np.any(unit):
+ raise ValueError("direction must be a finite, non-zero 3-vector")
+ return CurrentSteps(
+ speeds=_readonly(values),
+ hold=hold_s,
+ ramp=ramp_s,
+ direction=_readonly(unit / np.linalg.norm(unit)),
+ )
diff --git a/python/pyproject.toml b/python/pyproject.toml
index 6a99fb89..cb544a53 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "cabledyn"
-version = "0.4.2"
+version = "0.4.3"
description = "Python tools for CableDyn, a geometrically exact finite-element solver for mooring lines and dynamic power cables"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/python/tests/test_builder.py b/python/tests/test_builder.py
index 8685f609..5332cabf 100644
--- a/python/tests/test_builder.py
+++ b/python/tests/test_builder.py
@@ -185,7 +185,7 @@ def test_build_single_catenary_validates_and_saves(tmp_path: Path) -> None:
assert model.save(target, overwrite=True) == target
-def test_viv_columns_do_not_combine_with_the_wide_finite_ei_row(tmp_path: Path) -> None:
+def test_viv_columns_follow_the_wide_finite_ei_row(tmp_path: Path) -> None:
model = _chain_model(tmp_path)
model.add_line_type(
"cable",
@@ -197,9 +197,173 @@ def test_viv_columns_do_not_combine_with_the_wide_finite_ei_row(tmp_path: Path)
gj=1.0e3,
irt=0.1,
irn=0.05,
- cl=0.0,
+ cl=0.8,
+ cf=0.17,
)
- with pytest.raises(ValueError, match="do not combine with gas, gj, irt, irn"):
+ text = model.to_text()
+ deck = DeckFile.from_text(text, path=tmp_path / "deck.dat")
+ rows = {row.tokens[0].upper(): row.tokens for row in deck.line_types}
+ # the 14 finite-EI columns, then Cl dF cF (MoorDyn's dF = 0.08 where df is None)
+ assert len(rows["CABLE"]) == 17
+ assert [float(value) for value in rows["CABLE"][14:]] == [0.8, 0.08, 0.17]
+ assert len(rows["CHAIN"]) == 10
+ loaded = DeckModel.from_text(text, path=tmp_path / "deck.dat")
+ cable = loaded.line_types["CABLE"]
+ assert (cable.gj, cable.irn, cable.cl, cable.df, cable.cf) == (1.0e3, 0.05, 0.8, 0.08, 0.17)
+ assert loaded.to_text() == text
+
+
+def test_wake_oscillator_rows_are_written_with_the_values_given(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type(
+ "cable", diam=0.1, mass=10.0, ea=5.0e7, ei=1.0, cdn=1.2, can=1.0, wake_cl0=0.3
+ )
+ model.add_line_type(
+ "riser",
+ diam=0.1,
+ mass=10.0,
+ ea=5.0e7,
+ ei=1.0,
+ cdn=1.2,
+ can=1.0,
+ wake_cl0=0.25,
+ wake_eps=0.2,
+ )
+ deck = DeckFile.from_text(model.to_text(validate=False), path=tmp_path / "deck.dat")
+ rows = {row.tokens[0].lower(): row.tokens for row in deck._rows("WAKE OSCILLATOR")}
+ assert rows["cable"] == ("cable", "0.3")
+ # St is written at the solver's default to keep eps in its column
+ assert [float(value) for value in rows["riser"][1:]] == [0.25, 0.2, 0.2]
+ model.add_line_type("bad", diam=0.1, mass=10.0, ea=5.0e7, wake_st=0.2)
+ with pytest.raises(ValueError, match="need wake_cl0"):
+ model.to_text(validate=False)
+
+
+def test_viv_amplitude_rows_are_written_with_the_values_given(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type(
+ "cable",
+ diam=0.1,
+ mass=10.0,
+ ea=5.0e7,
+ ei=1.0,
+ cdn=1.2,
+ can=1.0,
+ cl=0.8,
+ viv_amplitude=[(0.0, 0.8), (0.3, 0.0)],
+ )
+ model.add_line_type(
+ "riser",
+ diam=0.1,
+ mass=10.0,
+ ea=5.0e7,
+ cdn=1.2,
+ can=1.0,
+ cl=0.8,
+ viv_amplitude=[(0.0, 0.8, 1.0), (0.5, 0.9, 1.6), (1.0, 0.0, 2.0)],
+ )
+ deck = DeckFile.from_text(model.to_text(validate=False), path=tmp_path / "deck.dat")
+ rows = [row.tokens for row in deck._rows("VIV AMPLITUDE")]
+ assert [row[0] for row in rows] == ["cable", "cable", "riser", "riser", "riser"]
+ assert [[float(value) for value in row[1:]] for row in rows[2:]] == [
+ [0.0, 0.8, 1.0],
+ [0.5, 0.9, 1.6],
+ [1.0, 0.0, 2.0],
+ ]
+ model.add_line_type(
+ "mixed", diam=0.1, mass=10.0, ea=5.0e7, cl=0.8, viv_amplitude=[(0.0, 0.8, 1.0), (1.0, 0.8)]
+ )
+ with pytest.raises(ValueError, match="all of one length"):
+ model.to_text(validate=False)
+ model.line_types["mixed"].viv_amplitude = [(0.0, 0.8), (1.0, 0.8)]
+ model.line_types["mixed"].cl = None
+ with pytest.raises(ValueError, match="set cl"):
+ model.to_text(validate=False)
+
+
+def test_viv_frame_rows_are_written(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type(
+ "towed",
+ diam=0.1,
+ mass=10.0,
+ ea=5.0e7,
+ ei=1.0,
+ cdn=1.2,
+ can=1.0,
+ wake_cl0=0.3,
+ viv_frame_tf=8.0,
+ )
+ deck = DeckFile.from_text(model.to_text(validate=False), path=tmp_path / "deck.dat")
+ assert [row.tokens for row in deck._rows("VIV FRAME")] == [("towed", "8.0")]
+ model.add_line_type(
+ "lifted",
+ diam=0.1,
+ mass=10.0,
+ ea=5.0e7,
+ cl=0.8,
+ viv_amplitude=[(0.0, 0.8, 1.0), (1.0, 0.4, 1.5)],
+ viv_frame_tf=6.0,
+ )
+ model.add_line_type("lift", diam=0.1, mass=10.0, ea=5.0e7, cl=0.8, viv_frame_tf=4.0)
+ deck = DeckFile.from_text(model.to_text(validate=False), path=tmp_path / "deck.dat")
+ assert [row.tokens for row in deck._rows("VIV FRAME")] == [
+ ("towed", "8.0"),
+ ("lifted", "6.0"),
+ ("lift", "4.0"),
+ ]
+ model.add_line_type("plain", diam=0.1, mass=10.0, ea=5.0e7, viv_frame_tf=8.0)
+ with pytest.raises(ValueError, match="set cl > 0 or wake_cl0"):
+ model.to_text(validate=False)
+
+
+def test_viv_stochastic_rows_are_written(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type(
+ "riser", diam=0.1, mass=10.0, ea=5.0e7, cl=0.8, viv_stochastic=(0.016, 0.07, 100, 3)
+ )
+ deck = DeckFile.from_text(model.to_text(validate=False), path=tmp_path / "deck.dat")
+ assert [row.tokens for row in deck._rows("VIV STOCHASTIC")] == [
+ ("riser", "0.016", "0.07", "100.0", "3.0")
+ ]
+ model.add_line_type("plain", diam=0.1, mass=10.0, ea=5.0e7, viv_stochastic=(0.016, 0.07))
+ with pytest.raises(ValueError, match="set cl > 0 and no wake_cl0"):
+ model.to_text(validate=False)
+
+
+def test_viv_diameter_rows_are_written(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type(
+ "zone", diam=0.1, mass=10.0, ea=5.0e7, cdn=1.2, can=1.0, cl=0.4, viv_diameter=0.9
+ )
+ deck = DeckFile.from_text(model.to_text(validate=False), path=tmp_path / "deck.dat")
+ rows = [row.tokens for row in deck._rows("VIV DIAMETER")]
+ assert rows == [("zone", "0.9")]
+ model.add_line_type("plain", diam=0.1, mass=10.0, ea=5.0e7, viv_diameter=0.9)
+ with pytest.raises(ValueError, match="set cl or wake_cl0"):
+ model.to_text(validate=False)
+
+
+def test_viv_damping_rows_are_written(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type(
+ "riser",
+ diam=0.1,
+ mass=10.0,
+ ea=5.0e7,
+ cl=0.8,
+ viv_amplitude=[(0.0, 0.8, 1.0), (1.0, 0.4, 2.0)],
+ viv_damping=(0.0, 0.0, 1.0),
+ )
+ deck = DeckFile.from_text(model.to_text(validate=False), path=tmp_path / "deck.dat")
+ rows = [row.tokens for row in deck._rows("VIV DAMPING")]
+ assert rows == [("riser", "0.0", "0.0", "1.0")]
+ model.line_types["riser"].viv_damping = (0.31,)
+ with pytest.raises(ValueError, match=r"viv_damping is \(a, b\) or \(a, b, c\)"):
+ model.to_text(validate=False)
+ model.line_types["riser"].viv_damping = (0.31, 0.89)
+ model.line_types["riser"].viv_amplitude = None
+ with pytest.raises(ValueError, match="takes its amplitude from viv_amplitude"):
model.to_text(validate=False)
@@ -267,7 +431,16 @@ def test_edit_fields_in_place_and_revalidate() -> None:
def test_rename_propagates_to_rows_and_output_channels() -> None:
model = _chain_model()
model.outputs.add(
- "Ten1N3", "L1N2px", "TDP1s", "TDP1Grd", "AnchFz1", "AnchFH1", "Point2FH", "Con1py"
+ "Ten1N3",
+ "L1N2px",
+ "TDP1s",
+ "TDP1Grd",
+ "AnchFz1",
+ "AnchFH1",
+ "Point2FH",
+ "Con1py",
+ "VIVPow1",
+ "DampPow1N3",
)
model.rename(model.lines[1], 7)
model.rename(model.points[1], 11)
@@ -284,6 +457,8 @@ def test_rename_propagates_to_rows_and_output_channels() -> None:
"AnchFH7",
"Point2FH",
"Con11py",
+ "VIVPow7",
+ "DampPow7N3",
]
deck = model.to_deck_file()
assert deck.lines[0].tokens == ("7", "11", "2", "-")
@@ -994,6 +1169,90 @@ def test_torsional_damping_round_trips_in_the_gj_column(tmp_path: Path) -> None:
assert next(t for t in loaded.line_types if t.name == "cable").gj == (1.0e4, 0.0, -0.02)
+@pytest.mark.parametrize("ei", [(1.0e4, 250.0), (1.0e4, -0.02, 1.5), (1.0e4, -0.02, 0.5, 2.0)])
+def test_bending_damping_round_trips_in_the_ei_column(
+ tmp_path: Path, ei: tuple[float, ...]
+) -> None:
+ model = _chain_model(tmp_path)
+ cable = model.add_line_type("cable", diam=0.2, mass=40.0, ea=5.0e8, ei=ei)
+ assert cable.ei == ei
+ target = model.save(tmp_path / "bend_damped.dat")
+ deck = DeckFile.read(target)
+ row = next(r for r in deck.line_types if r.tokens[0] == "cable")
+ assert tuple(float(v) for v in row.tokens[5].split("|")) == ei
+ loaded = DeckModel.load(target)
+ assert next(t for t in loaded.line_types if t.name == "cable").ei == ei
+
+
+@pytest.mark.parametrize(("clx", "il_alpha"), [(0.85, 0.15), (0.85, None), (0.0, 0.2)])
+def test_inline_viv_round_trips_in_the_viv_section(
+ tmp_path: Path, clx: float, il_alpha: float | None
+) -> None:
+ model = _chain_model(tmp_path)
+ cable = model.add_line_type(
+ "cable", diam=0.2, mass=40.0, ea=5.0e8, ei=1.0e4, cl=0.8, clx=clx, il_alpha=il_alpha
+ )
+ assert (cable.clx, cable.il_alpha) == (clx, il_alpha)
+ target = model.save(tmp_path / "inline_viv.dat")
+ deck = DeckFile.read(target)
+ row = next(r for r in deck._rows("VIV") if r.tokens[0] == "cable")
+ assert [float(v) for v in row.tokens[1:]] == [clx] + ([] if il_alpha is None else [il_alpha])
+ loaded = next(t for t in DeckModel.load(target).line_types if t.name == "cable")
+ assert (loaded.clx, loaded.il_alpha) == (clx, il_alpha)
+
+
+@pytest.mark.parametrize(("il_alpha", "written_alpha"), [(0.2, 0.2), (None, 0.15)])
+def test_higher_harmonic_viv_round_trips(
+ tmp_path: Path, il_alpha: float | None, written_alpha: float
+) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type(
+ "cable",
+ diam=0.2,
+ mass=40.0,
+ ea=5.0e8,
+ ei=1.0e4,
+ cl=0.8,
+ clx=0.85,
+ il_alpha=il_alpha,
+ chh=1.2,
+ )
+ target = model.save(tmp_path / "higher_harmonic.dat")
+ row = next(r for r in DeckFile.read(target)._rows("VIV") if r.tokens[0] == "cable")
+ assert [float(v) for v in row.tokens[1:]] == [0.85, written_alpha, 1.2]
+ loaded = next(t for t in DeckModel.load(target).line_types if t.name == "cable")
+ assert (loaded.clx, loaded.il_alpha, loaded.chh) == (0.85, written_alpha, 1.2)
+
+
+def test_higher_harmonic_needs_the_inline_coefficient(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type("cable", diam=0.2, mass=40.0, ea=5.0e8, ei=1.0e4, cl=0.8, chh=1.0)
+ with pytest.raises(ValueError, match="chh needs the in-line VIV coefficient clx"):
+ model.to_text()
+
+
+def test_inline_viv_alpha_needs_the_coefficient(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type("cable", diam=0.2, mass=40.0, ea=5.0e8, ei=1.0e4, cl=0.8, il_alpha=0.15)
+ with pytest.raises(ValueError, match="il_alpha needs the in-line VIV coefficient clx"):
+ model.to_text()
+
+
+def test_no_viv_section_without_inline_viv(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type("cable", diam=0.2, mass=40.0, ea=5.0e8, ei=1.0e4, cl=0.8)
+ assert "VIV ---" not in model.to_text()
+
+
+def test_bending_damping_ei_tuple_length_is_checked(tmp_path: Path) -> None:
+ model = _chain_model(tmp_path)
+ model.add_line_type("cable", diam=0.2, mass=40.0, ea=5.0e8, ei=(1.0e4, -0.02, 1.0, 2.0, 3.0))
+ with pytest.raises(
+ ValueError, match=r"ei is EI, \(EI, Bb\), \(EI, -zeta, f\) or \(EI, -zeta, f1, f2\)"
+ ):
+ model.to_text()
+
+
@pytest.mark.parametrize(
("gj", "ei", "message"),
[
diff --git a/python/tests/test_damage.py b/python/tests/test_damage.py
index 10c6978d..dccccb48 100644
--- a/python/tests/test_damage.py
+++ b/python/tests/test_damage.py
@@ -25,6 +25,7 @@
lifetime_fatigue,
miner_damage,
read_output,
+ section_stress,
study_sea_state_damage,
)
from cabledyn.damage import SECONDS_PER_YEAR
@@ -323,3 +324,82 @@ def test_study_sea_state_damage_needs_a_time_history(tmp_path):
study = _study(tmp_path, [_case(tmp_path, "s", static)])
with pytest.raises(StudyOutputError, match="not a time history"):
study_sea_state_damage(study, {"s": 1.0}, lambda history: 0.0)
+
+
+def test_section_stress_follows_the_curvature_vector():
+ stress, angles = section_stress(
+ 1.0e5, 0.01, 0.0, area=0.01, modulus=2.0e11, radius=0.05, points=4
+ )
+ np.testing.assert_allclose(angles, [0.0, 90.0, 180.0, 270.0])
+ # the strain at (x, y) is -(kx x + ky y): compression towards the centre of curvature (+x)
+ np.testing.assert_allclose(stress, [1.0e7 - 1.0e8, 1.0e7, 1.0e7 + 1.0e8, 1.0e7], atol=1.0)
+ assert not stress.flags.writeable
+ # in a fixed bending plane the extreme points are the two fibres of cable_stress
+ kx, ky = 0.006, -0.008
+ many, _ = section_stress(
+ [2.0e5], [kx], [ky], area=0.01, modulus=2.0e11, radius=0.05, points=360
+ )
+ outer, inner = cable_stress(2.0e5, math.hypot(kx, ky), area=0.01, modulus=2.0e11, radius=0.05)
+ assert many.max() == pytest.approx(float(outer), rel=1.0e-4)
+ assert many.min() == pytest.approx(float(inner), rel=1.0e-4)
+ with pytest.raises(ValueError, match="points"):
+ section_stress(1.0, 0.0, 0.0, area=1.0, modulus=1.0, radius=1.0, points=0)
+ with pytest.raises(ValueError, match="points"):
+ section_stress(1.0, 0.0, 0.0, area=1.0, modulus=1.0, radius=1.0, points=True) # type: ignore[arg-type]
+ with pytest.raises(ValueError, match="finite"):
+ section_stress(1.0, math.nan, 0.0, area=1.0, modulus=1.0, radius=1.0)
+
+
+def _whirl_columns(kappa: float = 0.01) -> dict[str, np.ndarray]:
+ """A section whose curvature vector turns at a constant magnitude (0.5 Hz)."""
+ omega = 2.0 * math.pi * 0.5
+ columns: dict[str, np.ndarray] = {}
+ for node in (1, 3, 5):
+ columns[f"Ten1N{node}"] = np.full(TIME.shape, 1.0e6)
+ columns[f"Curv1N{node}"] = np.full(TIME.shape, kappa)
+ columns[f"CurvX1N{node}"] = kappa * np.cos(omega * TIME + 0.3 * node)
+ columns[f"CurvY1N{node}"] = kappa * np.sin(omega * TIME + 0.3 * node)
+ return columns
+
+
+def test_section_damage_sees_a_whirl_the_two_fibres_miss(tmp_path):
+ history = read_output(write_main(tmp_path / "whirl.out", _whirl_columns()))
+ curve = dnv_rp_c203_curve("D")
+ section = {"area": 0.01, "modulus": 2.0e11, "radius": 0.05}
+ fibres = damage_along_arc(history, 1, curve, quantity="stress", **section)
+ assert np.all(fibres.damage == 0.0) and fibres.critical_angle is None
+ profile = damage_along_arc(history, 1, curve, quantity="section", points=8, **section)
+ assert profile.quantity == "section"
+ assert np.all(profile.damage > 0.0)
+ columns = _whirl_columns()
+ stress, angles = section_stress(
+ columns["Ten1N3"], columns["CurvX1N3"], columns["CurvY1N3"], points=8, **section
+ )
+ damages = [
+ channel_damage(_table(tmp_path, stress[:, k]), "S", curve, scale=1.0e-6).damage
+ for k in range(8)
+ ]
+ assert profile.damage[1] == _close(max(damages))
+ assert profile.critical_angle is not None
+ # the critical angle is a point of the largest damage (opposite points of a whirl tie)
+ chosen = int(np.flatnonzero(angles == profile.critical_angle[1])[0])
+ assert damages[chosen] == _close(max(damages))
+
+
+def test_section_damage_errors(tmp_path):
+ history = read_output(write_main(tmp_path / "whirl.out", _whirl_columns()))
+ curve = dnv_rp_c203_curve("D")
+ tn = FatigueCurve("tn", "T-N", 3.0, 3.0)
+ section = {"area": 0.01, "modulus": 2.0e11, "radius": 0.05}
+ with pytest.raises(ValueError, match="S-N curve"):
+ damage_along_arc(history, 1, tn, quantity="section", **section)
+ with pytest.raises(ValueError, match="area, modulus, and radius"):
+ damage_along_arc(history, 1, curve, quantity="section", area=1.0)
+ columns = _whirl_columns()
+ del columns["CurvY1N5"]
+ sparse = read_output(write_main(tmp_path / "sparse.out", columns))
+ with pytest.raises(ValueError, match="same nodes"):
+ damage_along_arc(sparse, 1, curve, quantity="section", **section)
+ plain = read_output(write_main(tmp_path / "plain.out"))
+ with pytest.raises(KeyError, match="CurvX1N"):
+ damage_along_arc(plain, 1, curve, quantity="section", **section)
diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py
index 09682893..10493675 100644
--- a/python/tests/test_deck_file.py
+++ b/python/tests/test_deck_file.py
@@ -3862,6 +3862,8 @@ def unqueryable(first, second):
("TDP1Grd", "tdp01GRD"),
("AnchFz1", "anchfz01"),
("AnchFH1", "ANCHFH1"),
+ ("VIVPow1", "vivpow01"),
+ ("DragPow1N3", "dragpow01n03"),
],
)
def test_duplicate_output_channels_fail_like_native(first, second):
@@ -4612,7 +4614,7 @@ def test_line_free_object_deck_checks_line_type_rows_without_crashing():
("1 2 1 -\n", ""),
("1 chain 410.0 41\n", ""),
)
- with pytest.raises(DeckFormatError, match="LINE TYPES row needs 10, 11, 13, 14 fields"):
+ with pytest.raises(DeckFormatError, match="LINE TYPES row needs 10, 11, 13, 14, 15, 17 fields"):
DeckFile.from_text(_with_section(no_lines, "BODIES", *body_rows))
# a header-only LINES section does not make the deck a line deck (the rule counts rows)
with pytest.raises(DeckFormatError) as caught:
@@ -4789,7 +4791,7 @@ def test_line_type_viv_columns_are_read_and_kept(tmp_path, columns, expected):
(" -0.1", "Cl must be non-negative"),
(" 0.8 0.2 0.18", "needs cF > 0 and 0 <= dF < cF"),
(" 0.8 0.05 0.0", "needs cF > 0 and 0 <= dF < cF"),
- (" 0.8 0.08", "LINE TYPES row needs 10, 11, 13, 14 fields"),
+ (" 0.8 0.08", "LINE TYPES row needs 10, 11, 13, 14, 15, 17 fields"),
],
)
def test_line_type_viv_columns_follow_the_native_checks(columns, message):
@@ -4809,6 +4811,333 @@ def test_line_type_viv_is_accepted_on_a_finite_ei_line_type(tmp_path):
assert (line_type.ei, line_type.cl) == (1.0e4, 0.8)
+# the 14-column finite-EI row (GAs GJ Irt Irn) takes the same VIV columns after its last
+_WIDE_VIV_ROW = (
+ "chain 0.252 390.0 1.674e9 -1.0 1.0e4 1.0e8 1.0e3|0|-0.01 0.1 0.05 1.37 0.64 1.0 0.0"
+)
+
+
+@pytest.mark.parametrize(
+ "columns, expected",
+ [
+ (" 0.8", (0.8, None, None)),
+ (" 0.8 0.05 0.2", (0.8, 0.05, 0.2)),
+ ],
+)
+def test_line_type_viv_columns_follow_the_finite_ei_row(tmp_path, columns, expected):
+ from cabledyn import DeckModel
+
+ row = "chain 0.252 390.0 1.674e9 -1.0 1.0e4 1.37 0.64 1.0 0.0"
+ text = _edit(_DYNAMIC, (row, _WIDE_VIV_ROW + columns))
+ record = DeckFile.from_text(text).line_types[0]
+ assert len(record.tokens) == 14 + len(columns.split())
+ path = tmp_path / "viv_wide.dat"
+ path.write_text(text, encoding="utf-8")
+ line_type = DeckModel.load(path).line_types["chain"]
+ assert (line_type.gj, line_type.irn) == ((1.0e3, 0.0, -0.01), 0.05)
+ assert (line_type.cl, line_type.df, line_type.cf) == expected
+ assert (line_type.cdn, line_type.cdt, line_type.can, line_type.cat) == (1.37, 0.64, 1.0, 0.0)
+
+
+@pytest.mark.parametrize(
+ "columns, message",
+ [
+ (" -0.1", "Cl must be non-negative"),
+ (" 0.8 0.2 0.18", "needs cF > 0 and 0 <= dF < cF"),
+ (" 0.8 0.08", "LINE TYPES row needs 10, 11, 13, 14, 15, 17 fields"),
+ ],
+)
+def test_finite_ei_row_viv_columns_follow_the_native_checks(columns, message):
+ row = "chain 0.252 390.0 1.674e9 -1.0 1.0e4 1.37 0.64 1.0 0.0"
+ with pytest.raises(DeckFormatError, match=re.escape(message)):
+ DeckFile.from_text(_edit(_DYNAMIC, (row, _WIDE_VIV_ROW + columns)))
+
+
+@pytest.mark.parametrize(
+ "rows, expected",
+ [
+ (("chain 0.3",), (0.3, None, None, None)),
+ (("chain 0.3 0.17",), (0.3, 0.17, None, None)),
+ (("TypeName CL0 St eps A", "chain 0.3 0.2 0.25 10"), (0.3, 0.2, 0.25, 10.0)),
+ ],
+)
+def test_wake_oscillator_rows_are_read_and_kept(tmp_path, rows, expected):
+ from cabledyn import DeckModel
+
+ text = _with_section(_DYNAMIC, "WAKE OSCILLATOR", *rows)
+ DeckFile.from_text(text)
+ path = tmp_path / "wake.dat"
+ path.write_text(text, encoding="utf-8")
+ item = DeckModel.load(path).line_types["chain"]
+ assert (item.wake_cl0, item.wake_st, item.wake_eps, item.wake_a) == expected
+ saved = tmp_path / "saved.dat"
+ DeckModel.load(path).save(saved)
+ again = DeckModel.load(saved).line_types["chain"]
+ assert (again.wake_cl0, again.wake_st, again.wake_eps, again.wake_a) == expected
+
+
+@pytest.mark.parametrize(
+ "base, rows, message",
+ [
+ (None, ("chain 0.3 0.2 0.3 12 1",), "rows must be: TypeName CL0 [St [eps [A]]]"),
+ (None, ("chain 0.3 x",), "must be plain numbers"),
+ (None, ("cable 0.3",), 'undefined LINE TYPE "cable"'),
+ (None, ("chain 0.3", "chain 0.2"), 'names LINE TYPE "chain" twice'),
+ (None, ("chain -0.1",), "CL0 must be non-negative"),
+ (None, ("chain 0.3 0.0",), "St > 0, eps > 0 and A >= 0"),
+ (None, ("chain 0.3 0.2 0.0",), "St > 0, eps > 0 and A >= 0"),
+ (None, ("chain 0.3 0.2 0.3 -1",), "St > 0, eps > 0 and A >= 0"),
+ ("lift", ("chain 0.3",), "give the type LINE TYPES Cl 0"),
+ ("lift ei0", ("chain 0.3",), "give the type LINE TYPES Cl 0"),
+ ],
+)
+def test_wake_oscillator_rows_follow_the_native_checks(base, rows, message):
+ text = _DYNAMIC
+ if base and "lift" in base:
+ row = "chain 0.252 390.0 1.674e9 -1.0 1.0e4 1.37 0.64 1.0 0.0"
+ text = _edit(text, (row, row + " 0.8"))
+ if base and "ei0" in base:
+ text = _edit(text, ("1.674e9 -1.0 1.0e4 1.37", "1.674e9 -1.0 0.0 1.37"))
+ with pytest.raises(DeckFormatError, match=re.escape(message)):
+ DeckFile.from_text(_with_section(text, "WAKE OSCILLATOR", *rows))
+
+
+_LIFT_ROW = "chain 0.252 390.0 1.674e9 -1.0 1.0e4 1.37 0.64 1.0 0.0"
+
+
+@pytest.mark.parametrize(
+ "rows, expected",
+ [
+ (("chain 0.0 0.8", "chain 0.5 0.0"), [(0.0, 0.8), (0.5, 0.0)]),
+ (
+ ("TypeName AD Cv CdAmp", "chain 0.0 0.8 1.0", "chain 0.4 0.9 1.5", "chain 1.0 0.0 2.0"),
+ [(0.0, 0.8, 1.0), (0.4, 0.9, 1.5), (1.0, 0.0, 2.0)],
+ ),
+ ],
+)
+def test_viv_amplitude_rows_are_read_and_kept(tmp_path, rows, expected):
+ from cabledyn import DeckModel
+
+ text = _with_section(_edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")), "VIV AMPLITUDE", *rows)
+ DeckFile.from_text(text)
+ path = tmp_path / "amp.dat"
+ path.write_text(text, encoding="utf-8")
+ assert DeckModel.load(path).line_types["chain"].viv_amplitude == expected
+ saved = tmp_path / "saved.dat"
+ DeckModel.load(path).save(saved)
+ assert DeckModel.load(saved).line_types["chain"].viv_amplitude == expected
+
+
+@pytest.mark.parametrize(
+ "lift, rows, message",
+ [
+ (True, ("chain 0.0 0.8 1.0 2.0",), "rows must be: TypeName AD Cv [CdAmp]"),
+ (True, ("chain 0.0",), "rows must be: TypeName AD Cv [CdAmp]"),
+ (True, ("chain 0.0 x", "chain 1.0 0.8"), "must be plain numbers"),
+ (True, ("cable 0.0 0.8", "cable 1.0 0.8"), 'undefined LINE TYPE "cable"'),
+ (False, ("chain 0.0 0.8", "chain 1.0 0.8"), "give the type LINE TYPES Cl > 0"),
+ (True, ("chain 0.0 0.8 1.0", "chain 1.0 0.8"), "must all have the same columns"),
+ (True, ("chain 0.5 0.8", "chain 0.5 0.6"), "must increase strictly in AD"),
+ (True, ("chain -0.1 0.8", "chain 1.0 0.8"), "AD >= 0, Cv >= 0 and CdAmp > 0"),
+ (True, ("chain 0.0 -0.8", "chain 1.0 0.8"), "AD >= 0, Cv >= 0 and CdAmp > 0"),
+ (True, ("chain 0.0 0.8 0.0", "chain 1.0 0.8 1.0"), "AD >= 0, Cv >= 0 and CdAmp > 0"),
+ (True, ("chain 0.0 0.8",), "a table needs at least two"),
+ (True, tuple(f"chain {0.01 * k:.2f} 0.8" for k in range(33)), "more than 32 rows"),
+ ],
+)
+def test_viv_amplitude_rows_follow_the_native_checks(lift, rows, message):
+ text = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")) if lift else _DYNAMIC
+ with pytest.raises(DeckFormatError, match=re.escape(message)):
+ DeckFile.from_text(_with_section(text, "VIV AMPLITUDE", *rows))
+
+
+def test_viv_diameter_rows_are_read_and_kept(tmp_path):
+ from cabledyn import DeckModel
+
+ text = _with_section(
+ _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")),
+ "VIV DIAMETER",
+ "TypeName Dviv",
+ "chain 0.9",
+ )
+ DeckFile.from_text(text)
+ path = tmp_path / "dia.dat"
+ path.write_text(text, encoding="utf-8")
+ assert DeckModel.load(path).line_types["chain"].viv_diameter == 0.9
+ saved = tmp_path / "saved.dat"
+ DeckModel.load(path).save(saved)
+ assert DeckModel.load(saved).line_types["chain"].viv_diameter == 0.9
+
+
+@pytest.mark.parametrize(
+ "lift, rows, message",
+ [
+ (True, ("chain 0.9 1.0",), "rows must be: TypeName Dviv"),
+ (True, ("cable 0.9",), 'undefined LINE TYPE "cable"'),
+ (True, ("chain 0.9", "chain 0.8"), 'names LINE TYPE "chain" twice'),
+ (True, ("chain 0.0",), "Dviv > 0, at most 1e15"),
+ (True, ("chain -0.9",), "Dviv > 0, at most 1e15"),
+ (False, ("chain 0.9",), "give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row"),
+ ],
+)
+def test_viv_diameter_rows_follow_the_native_checks(lift, rows, message):
+ text = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")) if lift else _DYNAMIC
+ with pytest.raises(DeckFormatError, match=re.escape(message)):
+ DeckFile.from_text(_with_section(text, "VIV DIAMETER", *rows))
+
+
+def test_viv_diameter_takes_a_wake_oscillator_type():
+ text = _with_section(_DYNAMIC, "WAKE OSCILLATOR", "chain 0.3")
+ DeckFile.from_text(_with_section(text, "VIV DIAMETER", "chain 0.9"))
+
+
+def test_viv_frame_rows_are_read_and_kept(tmp_path):
+ from cabledyn import DeckModel
+
+ text = _with_section(
+ _with_section(_DYNAMIC, "WAKE OSCILLATOR", "chain 0.3"),
+ "VIV FRAME",
+ "TypeName Tf",
+ "chain 8",
+ )
+ DeckFile.from_text(text)
+ path = tmp_path / "frame.dat"
+ path.write_text(text, encoding="utf-8")
+ assert DeckModel.load(path).line_types["chain"].viv_frame_tf == 8.0
+ saved = tmp_path / "saved.dat"
+ DeckModel.load(path).save(saved)
+ assert DeckModel.load(saved).line_types["chain"].viv_frame_tf == 8.0
+
+
+@pytest.mark.parametrize(
+ "wake, rows, message",
+ [
+ (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"),
+ (False, ("chain 8",), "give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row"),
+ ],
+)
+def test_viv_frame_rows_follow_the_native_checks(wake, rows, message):
+ text = _with_section(_DYNAMIC, "WAKE OSCILLATOR", "chain 0.3") if wake else _DYNAMIC
+ with pytest.raises(DeckFormatError, match=re.escape(message)):
+ DeckFile.from_text(_with_section(text, "VIV FRAME", *rows))
+
+
+_DAMP_BASE = _with_section(
+ _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")),
+ "VIV AMPLITUDE",
+ "chain 0.0 0.8",
+ "chain 1.0 0.4",
+)
+
+
+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"))
+ DeckFile.from_text(_with_section(lift_only, "VIV FRAME", "chain 8"))
+ DeckFile.from_text(_with_section(_DAMP_BASE, "VIV FRAME", "chain 8"))
+ damped = _with_section(_DAMP_BASE, "VIV DAMPING", "chain 0.31 0.89")
+ DeckFile.from_text(_with_section(damped, "VIV FRAME", "chain 8"))
+
+
+@pytest.mark.parametrize(
+ "rows, expected",
+ [
+ (("chain 0.31 0.89",), (0.31, 0.89)),
+ (("TypeName a b c", "chain 0 0 1"), (0.0, 0.0, 1.0)),
+ ],
+)
+def test_viv_damping_rows_are_read_and_kept(tmp_path, rows, expected):
+ from cabledyn import DeckModel
+
+ text = _with_section(_DAMP_BASE, "VIV DAMPING", *rows)
+ DeckFile.from_text(text)
+ path = tmp_path / "damp.dat"
+ path.write_text(text, encoding="utf-8")
+ assert DeckModel.load(path).line_types["chain"].viv_damping == expected
+ saved = tmp_path / "saved.dat"
+ DeckModel.load(path).save(saved)
+ assert DeckModel.load(saved).line_types["chain"].viv_damping == expected
+
+
+@pytest.mark.parametrize(
+ "base, rows, message",
+ [
+ (None, ("chain 0.31",), "rows must be: TypeName a b [c]"),
+ (None, ("chain 0.31 0.89 0.0 1.0",), "rows must be: TypeName a b [c]"),
+ (None, ("chain 0.31 x",), "a, b and c must be plain numbers"),
+ (None, ("cable 0.31 0.89",), 'undefined LINE TYPE "cable"'),
+ (None, ("chain 0.31 0.89", "chain 0 0 1"), 'names LINE TYPE "chain" twice'),
+ (None, ("chain -0.1 0.89",), "a, b and c >= 0, at most 1e15"),
+ (None, ("chain 0.31 0.89 -1",), "a, b and c >= 0, at most 1e15"),
+ ("no-table", ("chain 0.31 0.89",), "give the type Cl > 0 and a VIV AMPLITUDE table"),
+ ("ei0", ("chain 0.31 0.89",), "acts on finite-EI cables (EI > 0) only"),
+ ],
+)
+def test_viv_damping_rows_follow_the_native_checks(base, rows, message):
+ text = _DAMP_BASE
+ if base == "no-table":
+ text = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8"))
+ elif base == "ei0":
+ text = _edit(text, ("1.674e9 -1.0 1.0e4 1.37", "1.674e9 -1.0 0.0 1.37"))
+ with pytest.raises(DeckFormatError, match=re.escape(message)):
+ DeckFile.from_text(_with_section(text, "VIV DAMPING", *rows))
+
+
+def test_viv_amplitude_channel_needs_a_table():
+ text = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8"))
+ text = _edit(text, ("FairTen1\n", "FairTen1\nVIVAmp1N2\n"))
+ with pytest.raises(DeckFormatError, match="has no VIV AMPLITUDE table"):
+ DeckFile.from_text(text)
+ DeckFile.from_text(_with_section(text, "VIV AMPLITUDE", "chain 0.0 0.8", "chain 1.0 0.4"))
+ with pytest.raises(DeckFormatError, match="bad VIV amplitude channel"):
+ DeckFile.from_text(
+ _with_section(
+ _edit(text, ("VIVAmp1N2\n", "VIVAmp9N2\n")),
+ "VIV AMPLITUDE",
+ "chain 0.0 0.8",
+ "chain 1.0 0.4",
+ )
+ )
+
+
+def test_wake_oscillator_cl0_zero_is_off_and_needs_no_finite_line():
+ # CL0 0 switches nothing on, so it is accepted on an EI = 0 line and next to a lift type
+ text = _edit(_DYNAMIC, ("1.674e9 -1.0 1.0e4 1.37", "1.674e9 -1.0 0.0 1.37"))
+ DeckFile.from_text(_with_section(text, "WAKE OSCILLATOR", "chain 0.0"))
+
+
+def test_wake_oscillator_acts_on_an_ei0_line():
+ # native init_one_model installs the wake oscillator on EI = 0 lines as on finite-EI cables
+ text = _edit(_DYNAMIC, ("1.674e9 -1.0 1.0e4 1.37", "1.674e9 -1.0 0.0 1.37"))
+ DeckFile.from_text(_with_section(text, "WAKE OSCILLATOR", "chain 0.3 0.2 0.3 12"))
+
+
def test_viv_is_accepted_on_the_coupled_route():
text = _edit(_STATIC, (_VIV_ROW, _VIV_ROW + " 0.8"))
DeckFile.from_text(text)
@@ -4842,6 +5171,12 @@ def test_finite_ei_viv_is_accepted_on_the_multibody_march():
DeckFile.from_text(_example("buoy_clamped_cable.dat", (row, row + " 0.8")))
+def test_cd_out_dt_option_is_non_negative():
+ DeckFile.from_text(_edit(_STATIC, ("50.0 WtrDpth\n", "50.0 WtrDpth\n0.1 CDOutDt\n")))
+ with pytest.raises(DeckFormatError, match="CDOutDt"):
+ DeckFile.from_text(_edit(_STATIC, ("50.0 WtrDpth\n", "50.0 WtrDpth\n-0.1 CDOutDt\n")))
+
+
def test_viv_rms_window_option_is_non_negative():
base = _edit(_STATIC, (_VIV_ROW, _VIV_ROW + " 0.8"))
DeckFile.from_text(_edit(base, ("50.0 WtrDpth\n", "50.0 WtrDpth\n0.25 VIVrmsWindow\n")))
@@ -4871,3 +5206,42 @@ def test_as_laid_statics_refused_on_a_finite_ei_line_between_two_moving_points()
with pytest.raises(DeckFormatError, match="has a moving End B"):
DeckFile.from_text(deck)
DeckFile.from_text(deck.replace("asLaid staticsFriction", "none staticsFriction"))
+
+
+def test_viv_stochastic_rows_are_read_and_kept(tmp_path):
+ from cabledyn import DeckModel
+
+ lift_only = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8"))
+ text = _with_section(
+ lift_only, "VIV STOCHASTIC", "TypeName sigma c Nf seed", "chain 0.016 0.07 100 3"
+ )
+ DeckFile.from_text(text)
+ path = tmp_path / "sto.dat"
+ path.write_text(text, encoding="utf-8")
+ assert DeckModel.load(path).line_types["chain"].viv_stochastic == (0.016, 0.07, 100.0, 3.0)
+ saved = tmp_path / "saved.dat"
+ DeckModel.load(path).save(saved)
+ assert DeckModel.load(saved).line_types["chain"].viv_stochastic == (0.016, 0.07, 100.0, 3.0)
+ DeckFile.from_text(_with_section(lift_only, "VIV STOCHASTIC", "chain 0.016 0.07"))
+
+
+@pytest.mark.parametrize(
+ "lift, wake, rows, message",
+ [
+ (True, False, ("chain 0.016",), "rows must be: TypeName sigma c [Nf [seed]]"),
+ (True, False, ("cable 0.016 0.07",), 'undefined LINE TYPE "cable"'),
+ (True, False, ("chain 0.016 0.07", "chain 0.02 0.07"), 'names LINE TYPE "chain" twice'),
+ (True, False, ("chain 0.016 1.5",), "0 < c <= 1"),
+ (True, False, ("chain -0.1 0.07",), "0 <= sigma <= 1e3"),
+ (True, False, ("chain 0.016 0.07 10.5",), "Nf must be an integer from 1 to 1000"),
+ (True, False, ("chain 0.016 0.07 100 -1",), "seed must be an integer"),
+ (False, False, ("chain 0.016 0.07",), "give the type LINE TYPES Cl > 0 and no WAKE"),
+ (False, True, ("chain 0.016 0.07",), "give the type LINE TYPES Cl > 0 and no WAKE"),
+ ],
+)
+def test_viv_stochastic_rows_follow_the_native_checks(lift, wake, rows, message):
+ text = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")) if lift else _DYNAMIC
+ if wake:
+ text = _with_section(text, "WAKE OSCILLATOR", "chain 0.3")
+ with pytest.raises(DeckFormatError, match=re.escape(message)):
+ DeckFile.from_text(_with_section(text, "VIV STOCHASTIC", *rows))
diff --git a/python/tests/test_deck_native_parity.py b/python/tests/test_deck_native_parity.py
index 29f8c802..3f02b2f0 100644
--- a/python/tests/test_deck_native_parity.py
+++ b/python/tests/test_deck_native_parity.py
@@ -953,6 +953,115 @@ def test_stiffener_rows_are_native(row, message):
_rejects(_example("lazy_wave_bend_stiffener.dat", (_STIFFENER_ROOT, row)), message)
+_BARE_ROW = "bare 0.160 36.70 4.69e8 0.0 1.99e4 1.2 0.1 1.0 0.0"
+
+
+@pytest.mark.parametrize(
+ "ei",
+ ["1.99e4|250.0", "1.99e4|0", "1.99e4|-0.02|1.5", "1.99e4|-0.02|0.5|2.0"],
+)
+def test_bending_damping_forms_are_accepted(ei):
+ DeckFile.from_text(
+ _example("lazy_wave_bend_stiffener.dat", (_BARE_ROW, _BARE_ROW.replace("1.99e4", ei, 1)))
+ )
+
+
+@pytest.mark.parametrize(
+ ("ei", "message"),
+ [
+ ("1.99e4|-0.02|1|2|3", "takes EI, EI|Bb, EI|-zeta|f or EI|-zeta|f1|f2"),
+ ("1.99e4|0.02|0.5|2.0", "EI|-zeta|f1|f2 takes a damping ratio 0 < zeta < 1"),
+ ("1.99e4|-0.02|0.5|0", "frequencies f1 and f2 of EI|-zeta|f1|f2 must be positive"),
+ ("0.0|-0.02|0.5|2.0", "bending damping (EI|Bb) needs a finite-EI cable"),
+ ("1.99e4|-250.0", "a negative bending damping is -zeta and needs the frequency"),
+ ("1.99e4|0.02|1.5", "takes a damping ratio 0 < zeta < 1, written negative"),
+ ("1.99e4|-1.5|1.5", "takes a damping ratio 0 < zeta < 1, written negative"),
+ ("1.99e4|-0.02|0", "of EI|-zeta|f must be positive"),
+ ("0.0|250.0", "bending damping (EI|Bb) needs a finite-EI cable"),
+ ("0.0|-0.05|0.5", "bending damping (EI|Bb) needs a finite-EI cable"),
+ ],
+)
+def test_bending_damping_rows_are_native(ei, message):
+ text = _example("lazy_wave_bend_stiffener.dat", (_BARE_ROW, _BARE_ROW.replace("1.99e4", ei, 1)))
+ _rejects(text, re.escape(message))
+
+
+_VIV_EI0 = "-0.8 0.0 1.2"
+# the cross-flow VIV example as a finite-EI cable (EI 1 N m^2)
+_VIV_CABLE = _example("viv_taut_line_crossflow.dat", (_VIV_EI0, "-0.8 1.0 1.2"))
+
+
+@pytest.mark.parametrize(
+ "rows",
+ [
+ ("riser 0.85 0.15",),
+ ("riser 0.85",),
+ ("riser 0",),
+ ("RISER 0.5 0.0",),
+ ("riser 0.85 0.15 1.0",),
+ ("riser 0 0.15 0",),
+ ],
+)
+def test_inline_viv_rows_are_accepted(rows):
+ DeckFile.from_text(_section(_VIV_CABLE, "VIV", "TypeName ClX alpha", "(-) (-) (-)", *rows))
+
+
+@pytest.mark.parametrize(
+ ("rows", "message"),
+ [
+ (("riser 0.85 0.15 7 1",), "VIV rows must be: TypeName ClX [alpha [Chh]]"),
+ (("cable 0.85",), 'VIV row names undefined LINE TYPE "cable"'),
+ (("riser 0.85", "riser 0.5"), 'VIV names LINE TYPE "riser" twice'),
+ (("riser 0.85 x",), "VIV ClX, alpha and Chh must be plain numbers"),
+ (("riser 0.85 0.15 y",), "VIV ClX, alpha and Chh must be plain numbers"),
+ (("riser 0.85 0.15 -1",), "Chh must be non-negative"),
+ (("riser 0 0.15 1",), "needs its in-line VIV (ClX > 0)"),
+ (("riser -0.1",), "ClX must be non-negative"),
+ (("riser 2.0e15",), "ClX must be non-negative"),
+ (("riser 0.85 1.0",), "alpha must satisfy 0 <= alpha < 1"),
+ (("riser 0.85 -0.1",), "alpha must satisfy 0 <= alpha < 1"),
+ ],
+)
+def test_inline_viv_rows_are_native(rows, message):
+ _rejects(_section(_VIV_CABLE, "VIV", *rows), re.escape(message))
+
+
+def test_inline_viv_needs_the_crossflow_lift():
+ text = _edit(_VIV_CABLE, ("0.0 0.8 0.08 0.18", "0.0 0.0 0.08 0.18"))
+ _rejects(
+ _section(text, "VIV", "riser 0.85"),
+ re.escape("needs its cross-flow lift (LINE TYPES Cl > 0)"),
+ )
+
+
+@pytest.mark.parametrize("row", ["riser 0.85", "riser 0.0"])
+def test_inline_viv_acts_on_an_ei0_line(row):
+ DeckFile.from_text(_section(_example("viv_taut_line_crossflow.dat"), "VIV", row))
+
+
+@pytest.mark.parametrize(
+ ("channel", "message"),
+ [
+ ("VIVPow1", None),
+ ("DragPow1", None),
+ ("DampPow1", None),
+ ("vivpow01n26", None),
+ ("DampPow1N51", None),
+ ("VIVPow0", "bad load power channel"),
+ ("DragPow7", "bad load power channel"),
+ ("DampPowx", "bad load power channel"),
+ ("VIVPow1N0", "node numbers start at 1 = End A"),
+ ("DragPow1N52", "node exceeds the line node count"),
+ ],
+)
+def test_load_power_channels_are_native(channel, message):
+ text = _example("viv_taut_line_crossflow.dat", ('"FairTen1"', f'"FairTen1"\n"{channel}"'))
+ if message is None:
+ DeckFile.from_text(text)
+ else:
+ _rejects(text, re.escape(message))
+
+
def test_stiffener_needs_a_finite_ei_line():
text = _section(_HELD, "STIFFENERS", "1 A 1.0 0.5 0.5 0.3 5.0e7 1150")
_rejects(text, "STIFFENERS name line 1, which is not a finite-EI line")
@@ -2035,7 +2144,8 @@ def test_torsion_scope_rules_follow_the_native_checks():
'point; line 1 ends on a "free" point',
)
# one restrained end only, or none, is ignored: the same verdict as the six-column rows (here
- # the multibody march's, which ends no finite-EI cable on a Free point)
+ # both run: the Free End B is the line's free end, promote_free_cable_ends, and the one-end
+ # restraint is noted, not solved)
one_end = _edit(_torsion_two_moving("1 A Pinned 1 0 0 Free 0 0 1 0\n"), _NO_TORSION_OUTPUTS)
six = _edit(
_torsion_two_moving("1 A Pinned 1 0 0\n"),
@@ -2043,7 +2153,7 @@ def test_torsion_scope_rules_follow_the_native_checks():
_NO_TORSION_OUTPUTS,
)
for deck in (six, one_end):
- _rejects(deck, "a cable end on a Free/Connect point or a Point3 buoy")
+ DeckFile.from_text(deck)
both_free = _edit(
_TORSION,
(_TORSION_ROW_A, "1 A Rigid 1 0 0 Free 0 0 1 0\n"),
@@ -2879,3 +2989,87 @@ def test_dtm_bound_matches_the_driver(dt, accepted, ei, tmp_path):
assert _accepted(deck) == accepted
if not accepted:
assert "dtM must be at least 1e-100 s" in completed.stderr
+
+
+# ------------------------------------------------------------------ a free cable end
+
+_FREE_END_DECK = """--------------------- CableDyn Input File ---------------------------------
+free cable end
+----------------------- LINE TYPES ------------------------------------------
+TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t
+(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-)
+cable 0.048 2.8 1.0e8 0.0 3000 1.2 0.0 1.0 0.0
+----------------------- POINTS ----------------------------------------------
+ID Attachment X Y Z M V CdA CA
+(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
+1 Coupled 0.0 0.0 -0.5 0 0 0 0
+2 Free 0.0 0.0 -7.5 {clump}
+{extra}----------------------- LINES -----------------------------------------------
+ID LineType AttachA AttachB UnstrLen NumSegs Outputs
+(-) (-) (-) (-) (m) (-) (-)
+1 cable 1 2 7.0 70 -
+{endconn}---------------------- OPTIONS ----------------------------------------------
+1025 rhoW
+9.80665 g
+20 WtrDpth
+0.005 dtM
+0.1 TMax
+---------------------- OUTPUTS -----------------------------------------------
+FairTen1
+Point2pz
+END
+------------------------- need this line --------------------------------------
+"""
+_CLAMPED_B = (
+ "--------------------- END CONNECTIONS ----------------------------------\n"
+ "LineID End Stiffness EzX EzY EzZ\n(-) (-) (N-m/rad) (-) (-) (-)\n1 B Rigid 0 0 1\n"
+)
+
+
+@pytest.mark.parametrize(
+ ("clump", "extra", "endconn", "message"),
+ [
+ ("200 0.02548 0.06 1.0", "", "", None),
+ ("0 0 0 0", "", "", None),
+ (
+ "200 0.02548 0.06 1.0",
+ "",
+ _CLAMPED_B.replace("1 B Rigid 0 0 1", "1 B 0.0 0 0 1"),
+ None,
+ ),
+ ("200 0.02548 0.06 1.0", "", _CLAMPED_B, "non-pinned END CONNECTIONS need End B"),
+ ("10 0.5 0.06 1.0", "", "", "not supported on the multibody march"),
+ (
+ "200 0.02548 0.06 1.0",
+ "3 Free 5.0 0.0 -5.0 10 0 0 0\n",
+ "",
+ "not supported on the multibody march",
+ ),
+ ],
+)
+def test_free_cable_end_matches_the_driver(clump, extra, endconn, message, tmp_path):
+ # a finite-EI line on a Free End B: the line's free end, the point's loads an end attachment
+ text = _FREE_END_DECK.format(clump=clump, extra=extra, endconn=endconn)
+ if message is None:
+ DeckFile.from_text(text)
+ else:
+ _rejects(text, message)
+ if not _PARITY_DRIVER or not Path(_PARITY_DRIVER).is_file():
+ return
+ deck = tmp_path / "free_end.dat"
+ deck.write_text(text, encoding="utf-8")
+ completed = subprocess.run(
+ [_PARITY_DRIVER, str(deck), str(tmp_path / "free_end")],
+ capture_output=True,
+ text=True,
+ errors="replace",
+ cwd=tmp_path,
+ timeout=600,
+ env={**os.environ, "OMP_NUM_THREADS": "1", "OPENBLAS_NUM_THREADS": "1"},
+ check=False,
+ )
+ if message is None:
+ assert completed.returncode == 0, completed.stderr[-600:]
+ else:
+ assert completed.returncode == 1, completed.stderr[-600:]
+ assert message in completed.stderr
diff --git a/python/tests/test_end_to_end.py b/python/tests/test_end_to_end.py
index ac271af1..580a0794 100644
--- a/python/tests/test_end_to_end.py
+++ b/python/tests/test_end_to_end.py
@@ -23,12 +23,14 @@
DriverExecutionError,
StaticProfile,
compare_histories,
+ current_steps,
fft_filter,
generate_deck_cases,
line_geometry,
parameter_grid,
resample,
run_study,
+ viv_response,
)
from cabledyn import cli as run_cli
from cabledyn.post_cli import main as post_main
@@ -255,6 +257,203 @@ def test_generated_study_runs_on_the_real_driver(tmp_path):
]
+# The in-line VIV example with its type's lift Cl 0.8 and its VIV section turned into a WAKE
+# OSCILLATOR section (its row riser 0.85 0.15 then reads CL0 0.85, St 0.15).
+_WAKE_LIFT = ("1.0 0.0 0.8 0.08 0.18", "1.0 0.0 0.0 0.08 0.18")
+_WAKE_SECTION = (
+ "--------------------- VIV -----",
+ "--------------------- WAKE OSCILLATOR -----",
+)
+_WAKE_PARITY = [
+ ("wake-accepted", [_WAKE_LIFT, _WAKE_SECTION], True),
+ ("wake-keeps-lift", [_WAKE_SECTION], False),
+ (
+ "wake-st-zero",
+ [_WAKE_LIFT, _WAKE_SECTION, ("riser 0.85 0.15", "riser 0.85 0.0")],
+ False,
+ ),
+ (
+ "wake-row-too-long",
+ [_WAKE_LIFT, _WAKE_SECTION, ("riser 0.85 0.15", "riser 0.3 0.2 0.3 12 1")],
+ False,
+ ),
+ (
+ "wake-ei0-line",
+ [_WAKE_LIFT, _WAKE_SECTION, ("-0.8 1.0 1.2", "-0.8 0.0 1.2")],
+ True,
+ ),
+]
+
+
+_AMP_OPTIONS = "--------------------- OPTIONS -----"
+_AMP_CHANNEL = ('"DampPow1"', '"DampPow1"\n"VIVAmp1N26"')
+
+
+def _amp_table(*rows: str) -> tuple[str, str]:
+ """The edit that puts a VIV AMPLITUDE section with ``rows`` before OPTIONS."""
+ block = "--------------------- VIV AMPLITUDE -----\n" + "".join(f"{row}\n" for row in rows)
+ return _AMP_OPTIONS, block + _AMP_OPTIONS
+
+
+_AMP_PARITY = [
+ ("amp-accepted", [_amp_table("riser 0.0 0.8 1.0", "riser 0.5 0.4 1.5")], True),
+ ("amp-channel", [_amp_table("riser 0.0 0.8", "riser 0.5 0.4"), _AMP_CHANNEL], True),
+ ("amp-channel-no-table", [_AMP_CHANNEL], False),
+ ("amp-one-row", [_amp_table("riser 0.0 0.8")], False),
+ ("amp-not-increasing", [_amp_table("riser 0.5 0.8", "riser 0.5 0.4")], False),
+ (
+ "amp-no-lift",
+ [
+ _WAKE_LIFT,
+ _WAKE_SECTION,
+ ("riser 0.85 0.15", "riser 0.3"),
+ _amp_table("riser 0.0 0.8", "riser 0.5 0.4"),
+ ],
+ False,
+ ),
+]
+
+
+def _dia_rows(*rows: str) -> tuple[str, str]:
+ """The edit that puts a VIV DIAMETER section with ``rows`` before OPTIONS."""
+ block = "--------------------- VIV DIAMETER -----\n" + "".join(f"{row}\n" for row in rows)
+ return _AMP_OPTIONS, block + _AMP_OPTIONS
+
+
+_DIA_PARITY = [
+ ("dia-accepted", [_dia_rows("riser 0.3")], True),
+ ("dia-zero", [_dia_rows("riser 0.0")], False),
+ ("dia-repeated", [_dia_rows("riser 0.3", "riser 0.2")], False),
+ ("dia-three-columns", [_dia_rows("riser 0.3 1.0")], False),
+ (
+ "dia-wake-type",
+ [
+ _WAKE_LIFT,
+ _WAKE_SECTION,
+ ("riser 0.85 0.15", "riser 0.3"),
+ _dia_rows("riser 0.3"),
+ ],
+ True,
+ ),
+ (
+ "dia-no-viv",
+ [_WAKE_LIFT, ("riser 0.85 0.15", ""), _dia_rows("riser 0.3")],
+ False,
+ ),
+]
+
+_AMP_PARITY += _DIA_PARITY
+
+
+def _frame_rows(*rows: str) -> tuple[str, str]:
+ """The edit that puts a VIV FRAME section with ``rows`` before OPTIONS."""
+ block = "--------------------- VIV FRAME -----\n" + "".join(f"{row}\n" for row in rows)
+ return _AMP_OPTIONS, block + _AMP_OPTIONS
+
+
+_WAKE_RISER = ("riser 0.85 0.15", "riser 0.3")
+_FRAME_PARITY = [
+ ("frame-accepted", [_WAKE_LIFT, _WAKE_SECTION, _WAKE_RISER, _frame_rows("riser 8")], True),
+ ("frame-zero", [_WAKE_LIFT, _WAKE_SECTION, _WAKE_RISER, _frame_rows("riser 0")], True),
+ ("frame-negative", [_WAKE_LIFT, _WAKE_SECTION, _WAKE_RISER, _frame_rows("riser -1")], False),
+ (
+ "frame-three-columns",
+ [_WAKE_LIFT, _WAKE_SECTION, _WAKE_RISER, _frame_rows("riser 8 1")],
+ False,
+ ),
+ ("frame-sync-type", [_frame_rows("riser 8")], True),
+ ("frame-no-viv", [_WAKE_LIFT, ("riser 0.85 0.15", ""), _frame_rows("riser 8")], False),
+ (
+ "frame-amp-type",
+ [_amp_table("riser 0.0 0.8 1.0", "riser 0.5 0.4 1.5"), _frame_rows("riser 8")],
+ True,
+ ),
+]
+
+_AMP_PARITY += _FRAME_PARITY
+
+
+def _damp_rows(*rows: str) -> tuple[str, str]:
+ """The edit that puts a VIV DAMPING section with ``rows`` before OPTIONS."""
+ block = "--------------------- VIV DAMPING -----\n" + "".join(f"{row}\n" for row in rows)
+ return _AMP_OPTIONS, block + _AMP_OPTIONS
+
+
+_DAMP_TABLE = _amp_table("riser 0.0 0.8 1.0", "riser 0.5 0.4 1.5")
+_DAMP_PARITY = [
+ ("damp-accepted", [_DAMP_TABLE, _damp_rows("riser 0.31 0.89")], True),
+ ("damp-inline-only", [_DAMP_TABLE, _damp_rows("riser 0 0 1")], True),
+ ("damp-no-table", [_damp_rows("riser 0.31 0.89")], False),
+ ("damp-negative", [_DAMP_TABLE, _damp_rows("riser 0.31 -0.89")], False),
+ ("damp-one-value", [_DAMP_TABLE, _damp_rows("riser 0.31")], False),
+ ("damp-repeated", [_DAMP_TABLE, _damp_rows("riser 0.31 0.89", "riser 0 0 1")], False),
+ ("damp-frame", [_DAMP_TABLE, _damp_rows("riser 0.31 0.89"), _frame_rows("riser 8")], True),
+ (
+ "damp-ei0-line",
+ [
+ ("-0.8 1.0 1.2", "-0.8 0.0 1.2"),
+ _DAMP_TABLE,
+ _damp_rows("riser 0.31 0.89"),
+ ],
+ False,
+ ),
+]
+
+_AMP_PARITY += _DAMP_PARITY
+
+
+@pytest.mark.parametrize(
+ ("label", "edits", "accepted"), _AMP_PARITY, ids=[item[0] for item in _AMP_PARITY]
+)
+def test_viv_amplitude_validator_agrees_with_the_native_reader(
+ driver, tmp_path, label, edits, accepted
+):
+ text = (EXAMPLES / "viv_taut_cable_inline.dat").read_text(encoding="utf-8")
+ for old, new in edits:
+ assert old in text, old
+ text = text.replace(old, new, 1)
+ deck = tmp_path / f"{label}.dat"
+ deck.write_text(text.replace("90.0 TMax", "2.0 TMax"), encoding="utf-8")
+ try:
+ DeckFile.read(deck)
+ python_accepts = True
+ except DeckFormatError:
+ python_accepts = False
+ try:
+ driver.run(deck, label, timeout=300)
+ native_accepts = True
+ except DriverExecutionError as exc:
+ assert exc.returncode == 1, exc.stderr # a deck error, not a solve failure
+ native_accepts = False
+ assert python_accepts == native_accepts == accepted
+
+
+@pytest.mark.parametrize(
+ ("label", "edits", "accepted"), _WAKE_PARITY, ids=[item[0] for item in _WAKE_PARITY]
+)
+def test_wake_oscillator_validator_agrees_with_the_native_reader(
+ driver, tmp_path, label, edits, accepted
+):
+ text = (EXAMPLES / "viv_taut_cable_inline.dat").read_text(encoding="utf-8")
+ for old, new in edits:
+ assert old in text, old
+ text = text.replace(old, new, 1)
+ deck = tmp_path / f"{label}.dat"
+ deck.write_text(text.replace("90.0 TMax", "2.0 TMax"), encoding="utf-8")
+ try:
+ DeckFile.read(deck)
+ python_accepts = True
+ except DeckFormatError:
+ python_accepts = False
+ try:
+ driver.run(deck, label, timeout=300)
+ native_accepts = True
+ except DriverExecutionError as exc:
+ assert exc.returncode == 1, exc.stderr # a deck error, not a solve failure
+ native_accepts = False
+ assert python_accepts == native_accepts == accepted
+
+
@pytest.mark.parametrize(
("label", "example", "old", "new", "accepted"), _PARITY, ids=[item[0] for item in _PARITY]
)
@@ -279,3 +478,54 @@ def test_deck_validator_agrees_with_the_native_reader(
assert exc.returncode == 1, exc.stderr # a deck error, not a solve failure
native_accepts = False
assert python_accepts == native_accepts == accepted
+
+
+def test_viv_response_of_the_inline_example(driver, tmp_path):
+ # the line positions of examples/viv_taut_cable_inline.dat (Outputs p for its V flag)
+ text = (EXAMPLES / "viv_taut_cable_inline.dat").read_text(encoding="utf-8")
+ deck = tmp_path / "viv_inline.dat"
+ deck.write_text(
+ text.replace("1 1 2 V", "1 1 2 p"), encoding="utf-8"
+ )
+ result = driver.run(deck, "out/viv", timeout=600)
+ history = result.read_line_positions(1)
+ response = viv_response(history, flow=(0.0, 0.15, 0.0), diameter=0.1, start=60.0)
+ mid, quarter = 25, 12
+ # the deck's own statement: mid-span cross-flow A/D 0.82 at 0.29 Hz, quarter-span in-line
+ # A/D 0.19 at twice the frequency
+ assert response.amplitude_over_diameter("cross_flow")[mid] == pytest.approx(0.82, abs=0.02)
+ assert response.amplitude_over_diameter("in_line")[quarter] == pytest.approx(0.19, abs=0.02)
+ f_cf = response.frequency("cross_flow")
+ assert f_cf == pytest.approx(0.29, abs=0.01)
+ assert response.frequency("in_line") / f_cf == pytest.approx(2.0, abs=0.15)
+ # inside the synchronisation band cF +/- dF = 0.18 +/- 0.08
+ assert 0.10 < response.nondimensional_frequency()[mid] < 0.26
+ assert response.modal_amplitudes("cross_flow").dominant_mode == 1
+ assert response.modal_amplitudes("in_line").dominant_mode == 2
+ assert response.travelling_wave_index("cross_flow") < 0.2
+
+
+def test_stepped_current_continues_the_response(driver, tmp_path):
+ # the in-line VIV example under a current stepped 0.10 -> 0.18 -> 0.10 m/s in one run
+ steps = current_steps([0.10, 0.18, 0.10], hold=60.0, ramp=5.0)
+ text = (EXAMPLES / "viv_taut_cable_inline.dat").read_text(encoding="utf-8")
+ text = text.replace("1 1 2 V", "1 1 2 p")
+ lines = []
+ for line in text.splitlines():
+ if line.startswith("uniform 0.0 0.15 0.0 current"):
+ line = "2 Currents"
+ elif line.startswith("90.0 TMax"):
+ line = f"{steps.duration} TMax"
+ lines.append(line)
+ deck = tmp_path / "stepped.dat"
+ deck.write_text("\n".join(lines) + "\n", encoding="utf-8")
+ steps.write(tmp_path)
+ result = driver.run(deck, "out/stepped", timeout=600)
+ first, middle, last = steps.responses(result.read_line_positions(1), diameter=0.1, settle=30.0)
+ # the lock-in frequency follows the current up and comes back with it
+ assert middle.frequency("cross_flow") > first.frequency("cross_flow") + 0.03
+ assert last.frequency("cross_flow") == pytest.approx(first.frequency("cross_flow"), abs=0.01)
+ assert (
+ middle.amplitude_over_diameter("cross_flow").max()
+ > first.amplitude_over_diameter("cross_flow").max()
+ )
diff --git a/python/tests/test_study.py b/python/tests/test_study.py
index 61cdeb71..1bba8092 100644
--- a/python/tests/test_study.py
+++ b/python/tests/test_study.py
@@ -315,3 +315,39 @@ def test_study_argument_validation(tmp_path, kwargs, message):
output_directory=tmp_path / "results",
**kwargs,
)
+
+
+@pytest.mark.parametrize(
+ ("jobs", "omp", "passed", "recorded"),
+ [
+ (2, None, "1", "1"), # parallel cases default to one OpenMP thread each
+ (2, "", "1", "1"), # an empty value counts as unset
+ (2, "3", None, "3"), # the caller's count is passed on unchanged
+ (1, None, None, None), # one case at a time keeps the environment
+ ],
+)
+def test_study_gives_parallel_cases_one_openmp_thread(
+ tmp_path, monkeypatch, jobs, omp, passed, recorded
+):
+ if omp is None:
+ monkeypatch.delenv("OMP_NUM_THREADS", raising=False)
+ else:
+ monkeypatch.setenv("OMP_NUM_THREADS", omp)
+ manifest = _case_manifest(tmp_path)
+ driver = _driver(tmp_path)
+ original_run = driver.run
+ seen: list[object] = []
+ lock = threading.Lock()
+
+ def recording_run(*args, **kwargs):
+ with lock:
+ seen.append(kwargs.get("env"))
+ return original_run(*args, **kwargs)
+
+ driver.run = recording_run # type: ignore[method-assign]
+ result = run_study(manifest, driver=driver, output_directory=tmp_path / "results", jobs=jobs)
+ assert result.passed
+ expected = None if passed is None else {"OMP_NUM_THREADS": passed}
+ assert seen == [expected, expected]
+ payload = json.loads(result.study_manifest.read_text(encoding="utf-8"))
+ assert payload["omp_num_threads"] == recorded
diff --git a/python/tests/test_viv.py b/python/tests/test_viv.py
new file mode 100644
index 00000000..c7ffa1e6
--- /dev/null
+++ b/python/tests/test_viv.py
@@ -0,0 +1,351 @@
+# SPDX-License-Identifier: Apache-2.0
+"""VIV response diagnostics (cabledyn.viv) on synthetic line motions with known answers."""
+
+from __future__ import annotations
+
+import csv
+import math
+from pathlib import Path
+
+import numpy as np
+import pytest
+
+from cabledyn import LineNodeHistory, VIVResponse, current_steps, viv_response
+from cabledyn.results import TimeHistory
+
+L = 100.0
+D = 0.1
+N_NODES = 41
+F = 0.5 # cross-flow frequency [Hz]
+DT = 0.01
+T = 40.0 # 20 cross-flow periods
+FLOW = (0.0, 0.5, 0.0)
+
+
+def _history(displacement, *, time=None, depth=-50.0, lateral=0.0) -> LineNodeHistory:
+ """A straight line along +x at y = lateral, z = depth with displacement(t, s) -> (dy, dz)."""
+ t = np.arange(0.0, T, DT) if time is None else time
+ s = np.linspace(0.0, L, N_NODES)
+ dy, dz = displacement(t[:, None], s[None, :])
+ x = np.broadcast_to(s, dy.shape)
+ xyz = np.stack((x, lateral + dy, depth + dz), axis=2).reshape(t.size, -1)
+ channels = ["Time(s)"] + [f"Node{n}{a}(m)" for n in range(1, N_NODES + 1) for a in "XYZ"]
+ return LineNodeHistory(
+ Path("synthetic.Line1.p.out"), "", tuple(channels), None, np.column_stack((t, xyz))
+ )
+
+
+def _standing(t, s, a_cf=0.08, a_il=0.02, phase_cf=0.3, phase_il=1.0):
+ """Cross-flow (z) mode 1 at F, in-line (y) mode 2 at 2 F."""
+ dz = a_cf * np.sin(np.pi * s / L) * np.cos(2.0 * np.pi * F * t + phase_cf)
+ dy = a_il * np.sin(2.0 * np.pi * s / L) * np.cos(4.0 * np.pi * F * t + phase_il)
+ return dy, dz
+
+
+def test_local_frame_follows_the_tangent_and_the_flow():
+ response = viv_response(_history(_standing), flow=FLOW, diameter=D)
+ assert isinstance(response, VIVResponse)
+ assert np.allclose(response.tangent, [1.0, 0.0, 0.0])
+ assert np.allclose(response.in_line_axis, [0.0, 1.0, 0.0])
+ # (e_x, e_y, t) right-handed: cross-flow = t x in-line = +z
+ assert np.allclose(response.cross_flow_axis, [0.0, 0.0, 1.0])
+ assert np.allclose(response.normal_speed, 0.5)
+ assert response.arc_length[-1] == pytest.approx(L)
+
+
+def test_amplitudes_frequencies_and_the_nondimensional_frequency():
+ response = viv_response(_history(_standing), flow=FLOW, diameter=D)
+ mid, quarter = N_NODES // 2, N_NODES // 4
+ assert response.rms_over_diameter("cross_flow")[mid] == pytest.approx(0.08 / math.sqrt(2) / D)
+ assert response.amplitude_over_diameter("cross_flow")[mid] == pytest.approx(0.8, rel=1e-3)
+ assert response.amplitude_over_diameter("in_line")[quarter] == pytest.approx(0.2, rel=1e-3)
+ assert response.frequency("cross_flow") == pytest.approx(F, abs=1e-3)
+ assert response.frequency("in_line") == pytest.approx(2.0 * F, abs=1e-3)
+ assert response.frequencies("cross_flow")[mid] == pytest.approx(F, abs=1e-3)
+ # the pinned end nodes do not move
+ assert math.isnan(response.frequencies("cross_flow")[0])
+ assert np.allclose(response.nondimensional_frequency(), F * D / 0.5, rtol=1e-3)
+
+
+def test_modal_amplitudes_find_the_modes():
+ response = viv_response(_history(_standing), flow=FLOW, diameter=D)
+ cross = response.modal_amplitudes("cross_flow", n_modes=6)
+ assert cross.dominant_mode == 1
+ assert cross.rms_over_diameter[0] == pytest.approx(0.08 / math.sqrt(2) / D, rel=1e-9)
+ assert np.all(cross.rms_over_diameter[1:] < 1e-9)
+ assert cross.residual < 1e-9
+ assert cross.coefficients.shape == (response.time.size, 6)
+ inline = response.modal_amplitudes("in_line")
+ assert inline.dominant_mode == 2
+ s = response.arc_length
+ custom = response.modal_amplitudes("cross_flow", shapes=[np.sin(2 * np.pi * s / L)])
+ assert custom.mode_numbers == (1,) and custom.residual == pytest.approx(1.0, rel=1e-6)
+
+
+def _main_output(displacement, nodes) -> TimeHistory:
+ """The L1Np[xyz] channels of some nodes of the _history line, as a main output."""
+ whole = _history(displacement)
+ channels = ["Time(s)"]
+ columns = [whole.time]
+ for node in nodes:
+ for axis in "XYZ":
+ channels.append(f"L1N{node}p{axis.lower()}")
+ columns.append(whole.column(f"Node{node}{axis}(m)"))
+ return TimeHistory(Path("run.out"), "", tuple(channels), None, np.column_stack(columns))
+
+
+def test_default_shapes_need_the_whole_line():
+ interior = viv_response(_main_output(_standing, range(5, 38)), flow=FLOW, diameter=D, line_id=1)
+ assert not interior.whole_line
+ # the sines would vanish at nodes 5 and 37 instead of the line's ends: refused
+ with pytest.raises(ValueError, match="the default shapes need the whole line"):
+ interior.modal_amplitudes("cross_flow")
+ # shapes at the nodes held are fitted as given
+ s = np.linspace(0.0, L, N_NODES)[4:37]
+ fit = interior.modal_amplitudes("cross_flow", shapes=[np.sin(np.pi * s / L)])
+ assert fit.rms_over_diameter[0] == pytest.approx(0.08 / math.sqrt(2) / D, rel=1e-9)
+ assert fit.residual < 1e-9
+ assert viv_response(_history(_standing), flow=FLOW, diameter=D).whole_line
+
+
+def test_dependent_shapes_are_refused():
+ # ten uniform nodes: sin(9 pi s/S) vanishes at every node, sin(10 pi s/S) = -sin(8 pi s/S)
+ n = 10
+ t = np.arange(0.0, T, DT)
+ s = np.linspace(0.0, L, n)
+ dz = 0.05 * np.sin(8.0 * np.pi * s / L)[None, :] * np.cos(2.0 * np.pi * F * t)[:, None]
+ xyz = np.stack((np.broadcast_to(s, dz.shape), 0.0 * dz, -50.0 + dz), axis=2)
+ channels = ["Time(s)"] + [f"Node{k}{a}(m)" for k in range(1, n + 1) for a in "XYZ"]
+ history = LineNodeHistory(
+ Path("coarse.Line1.p.out"),
+ "",
+ tuple(channels),
+ None,
+ np.column_stack((t, xyz.reshape(t.size, -1))),
+ )
+ response = viv_response(history, flow=FLOW, diameter=D)
+ with pytest.raises(ValueError, match=r"10 shapes are not independent .*\(rank 8\)"):
+ response.modal_amplitudes("cross_flow", n_modes=10)
+ eight = response.modal_amplitudes("cross_flow", n_modes=8)
+ assert eight.dominant_mode == 8
+ assert eight.rms_over_diameter[7] == pytest.approx(0.05 / math.sqrt(2) / D, rel=1e-9)
+ assert eight.residual < 1e-9
+
+
+def test_travelling_wave_index_is_nan_without_motion():
+ still = viv_response(_history(lambda t, s: (0.0 * t * s, 0.0 * t * s)), flow=FLOW, diameter=D)
+ assert math.isnan(still.frequency("cross_flow"))
+ assert math.isnan(still.travelling_wave_index("cross_flow"))
+ assert math.isnan(still.travelling_wave_index("in_line"))
+ along = viv_response(_history(_standing), flow=(1.0, 0.0, 0.0), diameter=D)
+ assert math.isnan(along.travelling_wave_index("cross_flow"))
+ # still nodes at coordinates with no exact binary form keep a round-off offset from their
+ # mean: they have no frequency, on a still line and at the pinned ends of a moving one
+ for depth in (-50.1, -0.3, -1234.567):
+ calm = viv_response(
+ _history(lambda t, s: (0.0 * t * s, 0.0 * t * s), depth=depth),
+ flow=FLOW,
+ diameter=D,
+ )
+ assert math.isnan(calm.frequency("cross_flow"))
+ assert np.all(np.isnan(calm.frequencies("cross_flow")))
+ assert math.isnan(calm.travelling_wave_index("cross_flow"))
+ moving = viv_response(_history(_standing, depth=depth), flow=FLOW, diameter=D)
+ ends = moving.frequencies("cross_flow")[[0, -1]]
+ assert np.all(np.isnan(ends))
+ assert moving.frequency("cross_flow") == pytest.approx(F, abs=1e-3)
+ # cross-flow motion only, at a lateral coordinate with no exact binary form: no in-line
+ # motion, so no orbit phase
+ flat = viv_response(
+ _history(
+ lambda t, s: (
+ 0.0 * t * s,
+ 0.08 * np.sin(np.pi * s / L) * np.cos(2 * np.pi * F * t),
+ ),
+ depth=depth,
+ lateral=-0.3,
+ ),
+ flow=FLOW,
+ diameter=D,
+ )
+ assert math.isnan(flat.phase_difference(N_NODES // 2 + 1))
+ assert np.all(flat.complex_shape("in_line", 2.0 * F) == 0.0)
+
+
+def test_main_output_nodes_keep_their_numbers(tmp_path):
+ whole = viv_response(_history(_standing), flow=FLOW, diameter=D)
+ held = (5, 10, 21, 37)
+ some = viv_response(_main_output(_standing, held), flow=FLOW, diameter=D, line_id=1)
+ assert some.node_numbers == held
+ assert whole.node_numbers == tuple(range(1, N_NODES + 1))
+ # a node is taken by its number: node 21 is the mid-span node of the whole line
+ for a, b in zip(some.orbit(21), whole.orbit(21), strict=True):
+ assert np.array_equal(a, b)
+ assert some.phase_difference(10) == pytest.approx(whole.phase_difference(10), abs=1e-9)
+ with pytest.raises(ValueError, match=r"one of the nodes held, \[5, 10, 21, 37\]"):
+ some.orbit(1)
+ with pytest.raises(ValueError, match="from 1 to 41"):
+ whole.orbit(42)
+ with (some.export(tmp_path / "some.csv")).open(encoding="utf-8") as stream:
+ rows = list(csv.reader(stream))
+ assert [row[0] for row in rows[1:]] == [str(node) for node in held]
+
+
+def test_travelling_wave_index_separates_standing_and_travelling_waves():
+ standing = viv_response(_history(_standing), flow=FLOW, diameter=D)
+ assert standing.travelling_wave_index("cross_flow") < 1e-6
+
+ def travelling(t, s):
+ dz = 0.05 * np.cos(2.0 * np.pi * F * t - 2.0 * np.pi * 4.0 * s / L)
+ return np.zeros_like(dz), dz
+
+ wave = viv_response(_history(travelling), flow=FLOW, diameter=D)
+ assert wave.travelling_wave_index("cross_flow") > 0.95
+
+
+def test_complex_shape_and_phase_difference():
+ response = viv_response(_history(_standing), flow=FLOW, diameter=D)
+ mid, quarter = N_NODES // 2, N_NODES // 4
+ shape = response.complex_shape("cross_flow")
+ assert abs(shape[mid]) == pytest.approx(0.08, rel=1e-3)
+ assert np.angle(shape[mid]) == pytest.approx(0.3, abs=1e-3)
+ # theta = phi_x - 2 phi_y = 1.0 - 0.6 rad
+ assert response.phase_difference(quarter + 1) == pytest.approx(math.degrees(0.4), abs=0.1)
+ x, y = response.orbit(quarter + 1)
+ assert x.shape == y.shape == response.time.shape
+ assert math.isnan(response.phase_difference(1))
+
+
+def test_flow_along_the_line_leaves_no_frame():
+ response = viv_response(_history(_standing), flow=(0.4, 0.0, 0.0), diameter=D)
+ assert np.all(np.isnan(response.in_line_axis)) and np.all(response.normal_speed == 0.0)
+ assert np.all(np.isnan(response.frequencies("cross_flow")))
+ assert math.isnan(response.frequency("cross_flow"))
+ assert np.all(np.isnan(response.nondimensional_frequency()))
+ with pytest.raises(ValueError, match="fewer nodes with a flow frame"):
+ response.modal_amplitudes()
+
+
+def test_window_and_export(tmp_path):
+ response = viv_response(_history(_standing), flow=FLOW, diameter=D, start=10.0, stop=30.0)
+ assert response.time[0] == pytest.approx(10.0) and response.time[-1] <= 30.0
+ target = response.export(tmp_path / "viv.csv")
+ with target.open(encoding="utf-8") as stream:
+ rows = list(csv.reader(stream))
+ assert rows[0][:3] == ["Node", "ArcLength_[m]", "NormalSpeed_[m/s]"]
+ assert len(rows) == N_NODES + 1
+ assert rows[1][7] == "" # the pinned End A node has no frequency
+ with pytest.raises(FileExistsError):
+ response.export(target)
+
+
+@pytest.mark.parametrize(
+ ("kwargs", "message"),
+ [
+ ({"flow": (0.0, 0.0)}, "finite, non-zero 3-vector"),
+ ({"flow": (0.0, 0.0, 0.0)}, "finite, non-zero 3-vector"),
+ ({"diameter": 0.0}, "diameter must be finite and positive"),
+ ({"start": 39.97}, "at least eight samples"),
+ ({"line_id": 1}, "line_id does not apply"),
+ ],
+)
+def test_arguments_are_validated(kwargs, message):
+ arguments = {"flow": FLOW, "diameter": D, **kwargs}
+ with pytest.raises(ValueError, match=message):
+ viv_response(_history(_standing), **arguments)
+
+
+def test_non_uniform_sampling_is_refused():
+ time = np.cumsum(np.full(100, DT))
+ time[50:] += 0.003
+ with pytest.raises(ValueError, match="uniform sampling"):
+ viv_response(_history(_standing, time=time), flow=FLOW, diameter=D)
+
+
+def test_methods_validate_direction_and_node():
+ response = viv_response(_history(_standing), flow=FLOW, diameter=D)
+ with pytest.raises(ValueError, match="direction must be one of"):
+ response.rms_over_diameter("axial")
+ with pytest.raises(ValueError, match="node must be an integer from 1 to 41"):
+ response.orbit(0)
+ with pytest.raises(ValueError, match="n_modes must be a positive integer"):
+ response.modal_amplitudes(n_modes=0)
+ with pytest.raises(ValueError, match="shapes must have shape"):
+ response.modal_amplitudes(shapes=np.ones((2, 3)))
+
+
+def test_current_steps_schedule_and_file(tmp_path):
+ steps = current_steps([0.1, 0.2, 0.1], hold=20.0, ramp=5.0, direction=(0.0, 2.0, 0.0))
+ np.testing.assert_allclose(steps.starts, [0.0, 25.0, 50.0])
+ assert steps.duration == pytest.approx(70.0)
+ np.testing.assert_allclose(steps.direction, [0.0, 1.0, 0.0])
+ assert steps.windows(15.0) == ((15.0, 20.0), (40.0, 45.0), (65.0, 70.0))
+ path = steps.write(tmp_path, depths=(-100.0, 0.0))
+ assert path.name == "current_profile_dynamic.txt"
+ lines = path.read_text(encoding="ascii").splitlines()
+ assert lines[4].split() == ["-100", "0"]
+ rows = np.array([[float(v) for v in line.split()] for line in lines[6:]])
+ # t ux(z1 z2) uy(z1 z2) uz(z1 z2): held, ramped over 5 s, held, and the last speed two
+ # ramps past TMax
+ np.testing.assert_allclose(rows[:, 0], [0.0, 20.0, 25.0, 45.0, 50.0, 70.0, 80.0])
+ np.testing.assert_allclose(rows[:, 3], [0.1, 0.1, 0.2, 0.2, 0.1, 0.1, 0.1])
+ assert np.all(rows[:, [1, 2, 5, 6]] == 0.0) and np.all(rows[:, 3] == rows[:, 4])
+ with pytest.raises(FileExistsError):
+ steps.write(tmp_path)
+ with pytest.raises(ValueError, match="settle"):
+ steps.windows(20.0)
+
+
+@pytest.mark.parametrize(
+ ("kwargs", "message"),
+ [
+ ({"speeds": []}, "speeds must be"),
+ ({"speeds": [0.1, 0.0]}, "speeds must be"),
+ ({"ramp": 0.0}, "hold and ramp"),
+ ({"hold": 22.0}, "whole number of ramps"),
+ ({"direction": (0.0, 0.0, 0.0)}, "direction must be"),
+ ],
+)
+def test_current_steps_validation(kwargs, message):
+ arguments = {"speeds": [0.1, 0.2], "hold": 20.0, "ramp": 5.0, **kwargs}
+ with pytest.raises(ValueError, match=message):
+ current_steps(**arguments)
+
+
+def _resampled_speed(times, speeds, t):
+ # the native rule (CD_Current_Grid_Resample, CD_Current_Grid_Velocity): dt the smallest
+ # interval, floor(t_last/dt) + 1 samples at k dt, the upper index modulo the sample count
+ # and both indices the first sample over the last interval
+ dt = np.diff(times).min()
+ samples = np.interp(np.arange(int(np.floor(times[-1] / dt)) + 1) * dt, times, speeds)
+ q = t / dt
+ n = np.floor(q).astype(int)
+ upper = (n + 1) % samples.size
+ lower = np.maximum(upper - 1, 0)
+ return samples[lower] * (1.0 - (q - n)) + samples[upper] * (q - n)
+
+
+@pytest.mark.parametrize(
+ ("speeds", "hold", "ramp"),
+ [([0.5, 1.0], 0.3, 0.1), ([0.1, 0.2, 0.3], 20.0, 5.0), ([0.4], 1.2, 0.4)],
+)
+def test_current_steps_file_holds_the_last_speed_to_tmax(tmp_path, speeds, hold, ramp):
+ steps = current_steps(speeds, hold=hold, ramp=ramp)
+ lines = steps.write(tmp_path).read_text(encoding="ascii").splitlines()
+ rows = np.array([[float(v) for v in line.split()] for line in lines[6:]])
+ t = np.linspace(steps.windows(0.0)[-1][0], steps.duration, 401)
+ np.testing.assert_allclose(_resampled_speed(rows[:, 0], rows[:, 3], t), speeds[-1])
+ if speeds[0] != speeds[-1]:
+ # without the guard row the table would return to the first speed within the last hold
+ old = _resampled_speed(rows[:-1, 0], rows[:-1, 3], t)
+ assert old[-1] == pytest.approx(speeds[0])
+
+
+def test_current_steps_responses_take_each_hold():
+ steps = current_steps([0.5, 0.25], hold=15.0, ramp=5.0)
+ responses = steps.responses(_history(_standing), diameter=D, settle=5.0)
+ assert len(responses) == 2
+ assert responses[1].time[0] == pytest.approx(25.0)
+ assert np.allclose(responses[0].normal_speed, 0.5) and np.allclose(
+ responses[1].normal_speed, 0.25
+ )
diff --git a/release/check_release_metadata.py b/release/check_release_metadata.py
index e0636349..ed3b8ebe 100644
--- a/release/check_release_metadata.py
+++ b/release/check_release_metadata.py
@@ -26,8 +26,8 @@ def capture(relative_path: str, pattern: str, label: str) -> str:
return match.group(1)
-# Spellings that name a CableDyn release: "CableDyn 0.4.2", "CableDyn v0.4.2", "v0.4.2",
-# "cabledyn-0.4.2-py3-none-any.whl", ".../releases/tag/v0.4.2" and "libcabledyn.so.0.4.2".
+# Spellings that name a CableDyn release: "CableDyn 0.4.3", "CableDyn v0.4.3", "v0.4.3",
+# "cabledyn-0.4.3-py3-none-any.whl", ".../releases/tag/v0.4.3" and "libcabledyn.so.0.4.3".
VERSION_REFERENCE = re.compile(
r"(?i)(?:cabledyn[ _-]+v?|cabledyn-|releases/tag/v|libcabledyn\.(?:so\.)?|(? Minor extension level of ABI 1: 1 adds the in-process object queries, 2 the host-coupling
!> calls (initialization at host positions, state save/restore, the coupled layout query), 3
!> the host rotations (initialization for a host that turns its coupled points, their
diff --git a/src/CableDyn_CAPI.h b/src/CableDyn_CAPI.h
index 9d01580c..fd60e974 100644
--- a/src/CableDyn_CAPI.h
+++ b/src/CableDyn_CAPI.h
@@ -45,7 +45,7 @@
#define CABLEDYN_CAPI_VERSION_MAJOR 0
#define CABLEDYN_CAPI_VERSION_MINOR 4
-#define CABLEDYN_CAPI_VERSION_PATCH 2
+#define CABLEDYN_CAPI_VERSION_PATCH 3
#define CABLEDYN_CAPI_ABI_VERSION 1
#ifdef __cplusplus
diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90
index ad250b7a..7e54eab4 100644
--- a/src/CableDyn_DeckDriver.f90
+++ b/src/CableDyn_DeckDriver.f90
@@ -59,11 +59,13 @@ MODULE CableDyn_DeckDriver
CD_Get_Model_EndForces, &
CD_Update_Model_CoupledMotion, CD_Update_Model_Hydro_Fields, &
CD_Recompute_Model_Acceleration, CD_Step_Model, CD_Step_Model_Recovering, CD_MODEL_OK, &
- CD_Audit_Model_Step, CD_Set_Model_VIV, CD_Get_Model_VIV_Lift
+ CD_Audit_Model_Step, CD_Set_Model_VIV, CD_Get_Model_VIV_Lift, CD_Get_Model_Load_Power, &
+ CD_Get_Model_VIV_Amplitude
USE CableDyn_System, ONLY: CD_SystemType, CD_SystemPointType, CD_LineEndpointBinding, &
CD_Init_System_From_Points, CD_End_System, CD_System_Line_NDOF, &
CD_System_Line_NElem, CD_Get_System_Point_State, CD_Get_System_Line_State, &
CD_Get_System_Line_Tension, CD_Get_System_Line_VIV_Lift, &
+ CD_Get_System_Line_Load_Power, &
CD_Update_System_Point_Fluid_Fields, &
CD_Get_System_CoupledMotion, CD_Update_System_Point_States, &
CD_Calc_System_CoupledLoads, CD_Step_System, CD_Step_System_DynamicPoints, &
@@ -77,7 +79,7 @@ MODULE CableDyn_DeckDriver
USE CableDyn_HermiteCable, ONLY: CD_HermiteCable_Curvature, &
CD_HermiteCable_Peak_Curvature, CD_HermiteCable_Axial_Resultant, &
CD_HermiteCable_Axial_Resultant_Range, CD_HermiteCable_Element, CD_HCABLE_OK, &
- CD_HCABLE_BADINPUT, CD_HermiteCable_Gauss_Rule
+ CD_HCABLE_BADINPUT, CD_HermiteCable_Gauss_Rule, CD_HermiteCable_Rayleigh_Pair
USE CableDyn_HermiteCableStatic, ONLY: CD_HermiteCable_Static_Solve_AutoMesh, CD_HermiteCable_Static_Solve, &
CD_HermiteCable_Prolong_Arc, CD_HermiteCable_Kink_Advice, &
CD_HermiteCable_Element_Ratio, CD_HC_OSCILLATION_REL_TOL, &
@@ -95,7 +97,9 @@ MODULE CableDyn_DeckDriver
CD_HCSTAT_NOCONVERGE, CD_HC_COMPRESSION_OSCILLATION, &
CD_HC_COMPRESSION_STRICT
USE CableDyn_HermiteCableDynamic, ONLY: CD_HCDYN_OK, CD_HCDYN_TENSILE_OFF, CD_HCDYN_TENSILE_WARN, &
- CD_HCDYN_TENSILE_ERROR, &
+ CD_HermiteCable_Point_Immersion, CD_HermiteCable_Point_Radius, &
+ CD_HCDYN_TENSILE_ERROR, CD_HermiteCable_Dyn_Load_Power, &
+ CD_HermiteCable_Dyn_VIV_Amplitude, &
CD_HermiteCable_Axial_Damping_Resultant, &
CD_HermiteCable_Axial_Damping_Element, CD_HermiteCable_Dyn_End_Force, &
CD_HermiteCable_Dyn_Node_Values, CD_HermiteCable_Dyn_Node_Recovery, &
@@ -122,7 +126,8 @@ MODULE CableDyn_DeckDriver
CD_Vessel_RAO_Motion, CD_Vessel_Ramp, CD_VESSEL_OK
USE CableDyn_OpenFAST_HermiteFMF, ONLY: CD_HFMF_ModuleType, CD_HFMF_Init, CD_HFMF_Set_Drag, &
CD_HFMF_Set_Section_Reference, CD_HFMF_Section_Curvature, &
- CD_HFMF_Set_Axial_Damping, &
+ CD_HFMF_Set_Axial_Damping, CD_HFMF_Set_Bending_Damping, &
+ CD_HFMF_Set_Mass_Damping, &
CD_HFMF_Set_AddedMass, CD_HFMF_Set_ModifiedNewton, &
CD_HFMF_Set_Tensile_Monitor, CD_HFMF_Get_Tensile_Diagnostics, &
CD_HFMF_Get_Recovery_Diagnostics, &
@@ -135,7 +140,9 @@ MODULE CableDyn_DeckDriver
CD_HFMF_SetCoupledKinematics, CD_HFMF_GetCoupledKinematics, &
CD_HFMF_Set_Moving_End_B, CD_HFMF_GetEndBKinematics, &
CD_HFMF_End, CD_HFMF_OK
- USE CableDyn_VIV, ONLY: CD_VIV_DEFAULT_DF, CD_VIV_DEFAULT_CF, CD_VIV_NM
+ USE CableDyn_VIV, ONLY: CD_VIV_DEFAULT_DF, CD_VIV_DEFAULT_CF, CD_VIV_NM, CD_VIV_DEFAULT_IL_ALPHA, &
+ CD_VIV_WAKE_DEFAULT_ST, CD_VIV_WAKE_DEFAULT_EPS, CD_VIV_WAKE_DEFAULT_A, CD_VIV_AMP_MAXP, &
+ CD_VIV_STO_DEFAULT_NF, CD_VIV_STO_MAXF
USE CableDyn_Hydro, ONLY: CD_Airy_Wave_Kinematics_Precomputed, CD_Component_Wave_Kinematics, &
CD_Current_Profile_Velocity, CD_CurrentGridType, CD_Current_Grid_Resample, &
CD_Current_Grid_Velocity, &
@@ -261,6 +268,9 @@ MODULE CableDyn_DeckDriver
! Both reuse the same private evaluators the standalone .out writers use, so a coupled run
! and the standalone driver report identical channel values on a shared configuration.
PUBLIC :: CD_Eval_Aggregate_Channel, CD_Channel_Unit
+ ! The line-wide values one output row of channels shares per finite-EI cable (the rows argument
+ ! of CD_Eval_Aggregate_Channel), cleared before each row.
+ PUBLIC :: CD_ChannelRow, CD_Channel_Row_Reset
! The deck node of a node of a finite-EI cable's final mesh (the static-profile DeckNode column).
PUBLIC :: CD_Cable_Deck_Node
! In-process object queries of the C API (CableDyn_CAPI): segment tensions in the .t.out
@@ -411,6 +421,14 @@ MODULE CableDyn_DeckDriver
! damping l0 sqrt(GJ Irn), resolved on the final mesh (and again at the lengths active line
! control sets)
REAL(wp) :: bt = CD_ZERO
+ ! bending damping Bb [N m^2 s] of the EI column's second part (EI|Bb): the moment Bb times the
+ ! curvature rate (CD_HermiteCable_Bending_Damping), resolved from EI|-zeta|f (zeta at the
+ ! frequency f [Hz] of a bending mode, Bb = zeta EI/(pi f)) when the row gives a ratio
+ REAL(wp) :: bb = CD_ZERO
+ ! mass-proportional (Rayleigh alpha) transverse damping [1/s] of a finite-EI cable, the force
+ ! ralpha m on the velocity normal to the tangent (CD_HermiteCable_Mass_Damping); with bb, resolved
+ ! from EI|-zeta|f1|f2 (zeta at f1 and f2 [Hz], CD_HermiteCable_Rayleigh_Pair)
+ REAL(wp) :: ralpha = CD_ZERO
REAL(wp) :: i_rt = CD_ZERO, i_rn = CD_ZERO
REAL(wp) :: cdn = CD_ZERO, cdt = CD_ZERO, can = CD_ZERO, cat = CD_ZERO
! Viscoelastic stiffness (MoorDyn ElasticMod): the EA column's bar-separated
@@ -441,6 +459,46 @@ MODULE CableDyn_DeckDriver
! non-dimensional shedding frequency. A row with Cl only takes MoorDyn's dF = 0.08 and
! cF = 0.18.
REAL(wp) :: cl = CD_ZERO, viv_df = CD_VIV_DEFAULT_DF, viv_cf = CD_VIV_DEFAULT_CF
+ ! In-line VIV (the optional VIV section, a row per type: TypeName ClX [alpha]; Ulveseter et
+ ! al., Mar. Struct. 60, 2018): the in-line shedding coefficient C_vx (0 = off) and the
+ ! frequency band alpha of its phase about twice the cross-flow one; has_viv_row marks a type
+ ! the section names.
+ REAL(wp) :: clx = CD_ZERO, il_alpha = CD_VIV_DEFAULT_IL_ALPHA, chh = CD_ZERO
+ LOGICAL :: has_viv_row = .FALSE.
+ ! Wake-oscillator VIV (the optional WAKE OSCILLATOR section, a row per type: TypeName CL0
+ ! [St [eps [A]]]; Facchinetti et al., J. Fluids Struct. 19, 2004): the reference lift
+ ! coefficient C_L0 (0 = off), Strouhal number, van der Pol eps and acceleration coupling A;
+ ! 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
+ ! [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
+ ! synchronisation band centre (0: constant), the top c of its flat spectrum as a fraction of
+ ! the centre, the number of components Nf and the seed of their start phases; has_vivs_row
+ ! marks a type the section names.
+ REAL(wp) :: sto_sigma = CD_ZERO, sto_c = CD_ZERO
+ INTEGER :: sto_nf = CD_VIV_STO_DEFAULT_NF, sto_seed = 0
+ LOGICAL :: has_vivs_row = .FALSE.
+ LOGICAL :: has_wake_row = .FALSE.
+ ! Amplitude-dependent VIV coefficients (the optional VIV AMPLITUDE section, rows TypeName AD Cv
+ ! [CdAmp]): amp_n rows of (A/D, C_v, drag factor) in amp_tab, A/D increasing; amp_cols the
+ ! token count of the type's rows (3 or 4, the drag factor 1 with 3).
+ INTEGER :: amp_n = 0, amp_cols = 0
+ REAL(wp) :: amp_tab(3, CD_VIV_AMP_MAXP) = CD_ZERO
+ ! The diameter of the VIV model (the optional VIV DIAMETER section, a row per type: TypeName
+ ! Dviv): 0 takes the type's Diam; has_vivd_row marks a type the section names.
+ REAL(wp) :: viv_dv = CD_ZERO
+ LOGICAL :: has_vivd_row = .FALSE.
+ ! The cross-flow hydrodynamic damping of Thorsen et al. (2016) (the optional VIV DAMPING section,
+ ! a row per type: TypeName a b [c]), C_dy = a + b y0/D; cdy_a < 0 without a row.
+ REAL(wp) :: cdy_a = -1.0_wp, cdy_b = CD_ZERO, cdy_c = CD_ZERO
! Deck file line of the row (0 when not read from a file), for error messages.
INTEGER :: deck_line = 0
END TYPE
@@ -466,6 +524,10 @@ MODULE CableDyn_DeckDriver
! the Body attachment of a Point3 BODY: stepped as a Free point with the BODY Mass/Vol/CdA/Ca
! (copied into mass, vol, cda, ca above), its seabed contact included
LOGICAL :: point3 = .FALSE.
+ ! a Free point that ends exactly one finite-EI line (its End B) on a standalone deck of
+ ! finite-EI lines: the line's End B is free and the point's Mass/Volume/CdA/CA ride on it as
+ ! an end attachment (promote_free_cable_ends); ptype reads 'fixed' for the static seed only
+ LOGICAL :: free_cable_end = .FALSE.
INTEGER :: deck_line = 0 ! deck file line of the row, for error messages
END TYPE
@@ -563,6 +625,9 @@ MODULE CableDyn_DeckDriver
! the deck's written NodeB (MoorDyn's AttachB) is then End A, otherwise End B. Active line
! control reads it for a line with no single host-driven end.
LOGICAL :: ends_swapped = .FALSE.
+ ! End B on a Free point (promote_free_cable_ends): its position is free in the static
+ ! equilibrium and the dynamics, the point's loads acting as an end attachment
+ LOGICAL :: free_end_b = .FALSE.
! ATTACHMENTS (finite-EI lines): one column per discrete attachment -- arc length from
! End A [m], mass [kg], displaced volume [m^3], drag area CdA [m^2], added-mass Ca [-],
! axial drag area CdAx [m^2] (rows 1-6).
@@ -766,6 +831,9 @@ MODULE CableDyn_DeckDriver
! OpenFAST supercycling (dtM > DT): extrapolate the coupled loads between dtM solves from the
! last two (CableDyn_LoadPredictor); FALSE holds the last solve's loads
LOGICAL :: predict_loads = .TRUE.
+ ! OPTION CDOutDt [s]: the interval of the coupled .CD.out rows, a whole multiple of the
+ ! CableDyn step; 0 (the default) writes a row after every committed step
+ REAL(wp) :: cd_out_dt = CD_ZERO
! Opt-in adaptive mesh for COUPLED finite-EI cables: when set, a cable whose static IC is
! diagnosed under-resolved (CD_HermiteCable_Resolution_Metrics fragile) is refined by
! warm-started cubic-Hermite prolongation before the coupled dynamic run. Default FALSE keeps
@@ -858,6 +926,40 @@ MODULE CableDyn_DeckDriver
! Range graphs and touchdown channels of the run (sized by range_setup_planned; every
! row samples the lines that need it before the channels are evaluated).
TYPE(CD_RangeSet) :: rset
+ ! The node load powers of each line (VIVPow, DragPow, DampPow and their per-length
+ ! channels), evaluated once per row by the row's first load power channel of that line
+ ! (lp_row stamps, lp_off offsets into the node arrays).
+ INTEGER, ALLOCATABLE :: lp_off(:), lp_row(:)
+ REAL(wp), ALLOCATABLE :: line_pv(:), line_pd(:), line_pm(:)
+ END TYPE
+
+ TYPE :: CD_ChannelRow
+ !! The line-wide values of one finite-EI cable at the state of one output row: the row's
+ !! first channel of the cable that needs one evaluates it, and the cable's other channels of
+ !! the row read it, so a row costs one line-wide evaluation per kind of value, not one per
+ !! channel. Each value is the one the channel would evaluate itself, bit for bit. A row is
+ !! valid for one state only: CD_Channel_Row_Reset clears it before every row.
+ !! valid: the node load powers (CD_HermiteCable_Dyn_Load_Power)
+ LOGICAL :: valid = .FALSE.
+ REAL(wp), ALLOCATABLE :: pv(:), pd(:), pm(:)
+ ! the torsion state Theta and torque (CD_HermiteCable_Dyn_Torsion_State)
+ LOGICAL :: tors_valid = .FALSE.
+ REAL(wp) :: theta = CD_ZERO, torque = CD_ZERO
+ ! the element twists (CD_HermiteCable_Dyn_Element_Twist)
+ LOGICAL :: etw_valid = .FALSE.
+ REAL(wp), ALLOCATABLE :: etw(:)
+ ! the twists of the torsional end springs (CD_HermiteCable_Dyn_End_Twist)
+ LOGICAL :: etw2_valid = .FALSE.
+ REAL(wp) :: etw2(2) = CD_ZERO
+ ! the node torques (CD_HermiteCable_Dyn_Node_Torque)
+ LOGICAL :: ntq_valid = .FALSE.
+ REAL(wp), ALLOCATABLE :: ntq(:)
+ ! the section curvature components (CD_HFMF_Section_Curvature)
+ LOGICAL :: sc_valid = .FALSE.
+ REAL(wp), ALLOCATABLE :: kxa(:), kya(:)
+ ! the smoothed VIV amplitude estimates (CD_HermiteCable_Dyn_VIV_Amplitude)
+ LOGICAL :: amp_valid = .FALSE.
+ REAL(wp), ALLOCATABLE :: amp(:)
END TYPE
TYPE :: LineStepWorkspace
@@ -1214,6 +1316,8 @@ MODULE CableDyn_DeckDriver
LOGICAL :: cable_load_feedback = .TRUE.
! Deck OPTION predictLoads (the OpenFAST shell; see CD_AGG_ModuleType%predict_loads)
LOGICAL :: predict_loads = .TRUE.
+ ! Deck OPTION CDOutDt (the OpenFAST shell; see CD_AGG_ModuleType%cd_out_dt)
+ REAL(wp) :: cd_out_dt = CD_ZERO
! OPTION maxStrain, for the per-step plausibility guard of the coupled EI=0 lines.
REAL(wp) :: max_strain = 0.5_wp
REAL(wp), ALLOCATABLE :: host_current_profile_z(:)
@@ -1873,8 +1977,13 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
REAL(wp), ALLOCATABLE :: gas(:), gj(:), rho_a(:), i_rt(:), i_rn(:), w(:), nodes_ref(:, :), q0(:), q_static(:)
REAL(wp), ALLOCATABLE :: q_sequence(:)
REAL(wp), ALLOCATABLE :: curv(:), cdn(:), cdt(:), can(:), cat(:), catenary_pos(:)
- REAL(wp), ALLOCATABLE :: viv_cl(:), viv_cf(:), viv_df(:)
- REAL(wp), ALLOCATABLE :: ba_raw(:), ba(:), dry_b(:)
+ REAL(wp), ALLOCATABLE :: viv_cl(:), viv_cf(:), viv_df(:), viv_clx(:), viv_al(:), viv_hh(:)
+ REAL(wp), ALLOCATABLE :: viv_tix(:), viv_amp3(:, :, :), viv_dva(:), cdy_a(:), cdy_b(:), cdy_c(:)
+ INTEGER, ALLOCATABLE :: viv_ampn(:)
+ REAL(wp), ALLOCATABLE :: wo_cl0(:), wo_st(:), wo_eps(:), wo_a(:), wo_tf(:)
+ ! the VIV STOCHASTIC (sigma, c, Nf, seed) per element (finite_viv_sto)
+ REAL(wp), ALLOCATABLE :: viv_sto(:, :)
+ REAL(wp), ALLOCATABLE :: ba_raw(:), ba(:), dry_b(:), bb_el(:), ra_el(:)
REAL(wp) :: mode1_omega
REAL(wp), ALLOCATABLE :: contact_kn(:), contact_cn(:)
REAL(wp) :: anchor(3), fairlead(3), res, tvec(3), tnrm, contact_z, seed_z, seed_floor_a, seed_floor_b
@@ -2216,6 +2325,8 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
IF (LEN_TRIM(fine_note) > 0 .AND. standalone_mode) WRITE (error_unit, '(A)') ' Note: '//TRIM(fine_note)//'.'
ALLOCATE (ba_raw(SIZE(l0)))
CALL finite_raw_ba_array(ln, sections, types, ba_raw)
+ ALLOCATE (bb_el(SIZE(l0)), ra_el(SIZE(l0)))
+ CALL finite_bb_array(ln, sections, types, bb_el, ra_el)
nnode = SIZE(l0) + 1
ndof = 6*nnode
ALLOCATE (w(SIZE(l0)), nodes_ref(3, nnode), q0(ndof))
@@ -3267,12 +3378,41 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
! property of the original element containing its reference-arc midpoint.
ALLOCATE (cdn(SIZE(l0)), cdt(SIZE(l0)), can(SIZE(l0)), cat(SIZE(l0)))
CALL finite_hydro_arrays(ln, sections, types, diam, cdn, cdt, can, cat)
- ALLOCATE (viv_cl(SIZE(l0)), viv_cf(SIZE(l0)), viv_df(SIZE(l0)))
- CALL finite_viv_arrays(ln, sections, types, viv_cl, viv_cf, viv_df)
+ ALLOCATE (viv_cl(SIZE(l0)), viv_cf(SIZE(l0)), viv_df(SIZE(l0)), viv_clx(SIZE(l0)), viv_al(SIZE(l0)), &
+ viv_hh(SIZE(l0)))
+ CALL finite_viv_arrays(ln, sections, types, viv_cl, viv_cf, viv_df, viv_clx, viv_al, viv_hh)
+ ALLOCATE (wo_cl0(SIZE(l0)), wo_st(SIZE(l0)), wo_eps(SIZE(l0)), wo_a(SIZE(l0)), wo_tf(SIZE(l0)))
+ CALL finite_wake_arrays(ln, sections, types, wo_cl0, wo_st, wo_eps, wo_a, wo_tf)
+ ALLOCATE (viv_tix(SIZE(l0)))
+ CALL viv_amp_type_index(ln, sections, types, viv_tix)
+ ALLOCATE (viv_dva(SIZE(l0)))
+ CALL finite_viv_diameters(ln, sections, types, viv_dva)
+ ALLOCATE (cdy_a(SIZE(l0)), cdy_b(SIZE(l0)), cdy_c(SIZE(l0)))
+ CALL finite_viv_cdy(ln, sections, types, cdy_a, cdy_b, cdy_c)
+ ALLOCATE (viv_sto(4, SIZE(l0)))
+ CALL finite_viv_sto(ln, sections, types, viv_sto)
IF (SIZE(l0_am) /= SIZE(l0)) THEN
+ BLOCK
+ INTEGER, ALLOCATABLE :: parent(:)
+ CALL reference_arc_parents(l0, l0_am, parent)
+ viv_sto = viv_sto(:, parent)
+ END BLOCK
+ CALL remap_elem_by_reference_arc(viv_tix, l0, l0_am)
+ CALL remap_elem_by_reference_arc(viv_dva, l0, l0_am)
+ CALL remap_elem_by_reference_arc(cdy_a, l0, l0_am)
+ CALL remap_elem_by_reference_arc(cdy_b, l0, l0_am)
+ CALL remap_elem_by_reference_arc(cdy_c, l0, l0_am)
+ CALL remap_elem_by_reference_arc(wo_cl0, l0, l0_am)
+ CALL remap_elem_by_reference_arc(wo_st, l0, l0_am)
+ CALL remap_elem_by_reference_arc(wo_eps, l0, l0_am)
+ CALL remap_elem_by_reference_arc(wo_a, l0, l0_am)
+ CALL remap_elem_by_reference_arc(wo_tf, l0, l0_am)
CALL remap_elem_by_reference_arc(viv_cl, l0, l0_am)
CALL remap_elem_by_reference_arc(viv_cf, l0, l0_am)
CALL remap_elem_by_reference_arc(viv_df, l0, l0_am)
+ CALL remap_elem_by_reference_arc(viv_clx, l0, l0_am)
+ CALL remap_elem_by_reference_arc(viv_al, l0, l0_am)
+ CALL remap_elem_by_reference_arc(viv_hh, l0, l0_am)
CALL remap_elem_by_reference_arc(rho_a, l0, l0_am)
CALL remap_elem_by_reference_arc(diam, l0, l0_am)
CALL remap_elem_by_reference_arc(cdn, l0, l0_am)
@@ -3280,6 +3420,8 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
CALL remap_elem_by_reference_arc(can, l0, l0_am)
CALL remap_elem_by_reference_arc(cat, l0, l0_am)
CALL remap_elem_by_reference_arc(ba_raw, l0, l0_am)
+ CALL remap_elem_by_reference_arc(bb_el, l0, l0_am)
+ CALL remap_elem_by_reference_arc(ra_el, l0, l0_am)
IF (ALLOCATED(ei_cable)) CALL remap_elem_by_reference_arc(ei_cable, l0, l0_am)
END IF
! The node output channels read deck nodes: map each onto the final mesh (set on the cable
@@ -3325,8 +3467,14 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
! collapse of the endpoint tangent norm. Release the interior and tangent DOFs at
! dynamic hand-off; only the two endpoint translations remain constrained. The
! planar equilibrium is still an exact three-dimensional initial state by symmetry.
- ALLOCATE (dynamic_fixed_dofs(6))
- dynamic_fixed_dofs = [1, 2, 3, ndof - 5, ndof - 4, ndof - 3]
+ IF (ln%free_end_b) THEN
+ ! a free End B (a Free point, promote_free_cable_ends): End A alone is held
+ ALLOCATE (dynamic_fixed_dofs(3))
+ dynamic_fixed_dofs = [ndof - 5, ndof - 4, ndof - 3]
+ ELSE
+ ALLOCATE (dynamic_fixed_dofs(6))
+ dynamic_fixed_dofs = [1, 2, 3, ndof - 5, ndof - 4, ndof - 3]
+ END IF
IF (has_att) THEN
w_bare = w_bare_deck
IF (SIZE(l0) /= SIZE(l0_deck_att)) CALL remap_elem_by_reference_arc(w_bare, l0_deck_att, l0)
@@ -3415,6 +3563,45 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
' attachment(s) lumped at the nearest nodes (largest arc offset ', att_offset, ' m)'
CALL report_note(note_text)
END IF
+ IF (ln%free_end_b) THEN
+ ! The static solve held End B at the Free point's deck position (the seed); release it: the
+ ! full-load equilibrium with End B's position free, its loads the end attachment's (the
+ ! point's weight, buoyancy and current drag) and the line's own.
+ BLOCK
+ INTEGER, ALLOCATABLE :: fixed_rel(:), node_rel(:)
+ REAL(wp), ALLOCATABLE :: att_rel(:, :)
+ REAL(wp) :: rel_floor
+ fixed_rel = PACK(fixed_dofs, fixed_dofs > 3)
+ IF (has_att) THEN
+ node_rel = att_node
+ att_rel = ln%att
+ ELSE
+ ALLOCATE (node_rel(0), att_rel(6, 0))
+ END IF
+ CALL attachment_static_polish(l0, ea, ei, w, w, diam, node_rel, att_rel, q_static, fixed_rel, &
+ contact_enabled, contact_z, frame_cs, endconn_k, endconn_d0_local, &
+ endconn_mode, opts, static_tol, ErrStat, ErrMsg, bathymetry, cur_obj, &
+ tol_floor=COUPLED_STATIC_TOL, floor_res=rel_floor, release=.TRUE.)
+ IF (ErrStat /= CD_DECKDRV_OK) THEN
+ ErrMsg = 'CableDyn_DeckDriver: line '//TRIM(int_to_str(ln%id))//': static equilibrium of the free '// &
+ 'End B (released from the Free point''s deck position): '//TRIM(ErrMsg)
+ RETURN
+ END IF
+ fixed_dofs = fixed_rel
+ ! a net-heavy point at a free end that comes to rest on the seabed would sink into the line's
+ ! contact (an attachment has no seabed contact of its own): refused by name
+ IF (contact_enabled .AND. q_static(3) <= contact_z) THEN
+ IF (ANY(node_rel == 1 .AND. att_rel(2, :) - opts%rhoW*att_rel(3, :) > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'line '//TRIM(int_to_str(ln%id))//': the free End B comes to rest on '// &
+ 'the seabed with the net weight of its Free point, which has no seabed contact of its '// &
+ 'own on a finite-EI line; shorten the line, or end it on a Fixed point there'); RETURN
+ END IF
+ END IF
+ WRITE (note_text, '(A,I0,A,3ES12.4,A)') 'line ', ln%id, ': free End B at rest at (', &
+ q_static(1:3), ') m in the line frame'
+ CALL report_note(note_text)
+ END BLOCK
+ END IF
! Dynamic step controls: the deck's dynamic_solver relative tolerance and iteration budget
! (default 1e-8 and 30) on every route, standalone or coupled, so that a cable driven by the
! same motion steps to the same state on each. The tolerance is not a coupling-force accuracy
@@ -3454,6 +3641,18 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
CALL fail(ErrStat, ErrMsg, 'finite-EI cable axial-damping wiring failed: '//TRIM(em)); RETURN
END IF
END IF
+ IF (ANY(bb_el > CD_ZERO)) THEN
+ CALL CD_HFMF_Set_Bending_Damping(cable, bb_el, es, em)
+ IF (es /= CD_HFMF_OK) THEN
+ CALL fail(ErrStat, ErrMsg, 'finite-EI cable bending-damping wiring failed: '//TRIM(em)); RETURN
+ END IF
+ END IF
+ IF (ANY(ra_el > CD_ZERO)) THEN
+ CALL CD_HFMF_Set_Mass_Damping(cable, ra_el, es, em)
+ IF (es /= CD_HFMF_OK) THEN
+ CALL fail(ErrStat, ErrMsg, 'finite-EI cable mass-damping wiring failed: '//TRIM(em)); RETURN
+ END IF
+ END IF
IF (ANY(endconn_mode /= CD_ENDCONN_PINNED)) THEN
! a connected moving End B is attached to its own parent (end_b_d0_parent), as End A to its
IF (moving_b .AND. endconn_mode(1) /= CD_ENDCONN_PINNED .AND. endconn_mode(2) /= CD_ENDCONN_PINNED) THEN
@@ -3566,23 +3765,58 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
! lines do (init_one_model), and of the coupling step dt where the deck gives none: a
! coupled host may step the cable at a dt adjusted from the deck dtM.
IF (PRESENT(install_viv)) THEN
- IF (install_viv .AND. ANY(viv_cl > CD_ZERO)) THEN
+ IF (install_viv .AND. ANY(wo_cl0 > CD_ZERO) .AND. ANY(viv_cl > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'line '//TRIM(int_to_str(ln%id))//': a line takes one VIV model, but its '// &
+ 'types mix the synchronisation lift (LINE TYPES Cl > 0) and the wake oscillator (WAKE '// &
+ 'OSCILLATOR section)'); RETURN
+ END IF
+ IF (install_viv .AND. (ANY(viv_cl > CD_ZERO) .OR. ANY(wo_cl0 > CD_ZERO))) THEN
! MoorDyn's phase seed counts the deck nodes from the deck's End A, with its node tangent
! towards the deck's End B; CD_Deck_VIV_Phase_Seed takes it node by node to the model's
! 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)
ELSE
CALL CD_Deck_VIV_Phase_Seed(cable%line%l0, ln%ends_swapped, seed, zero=opts%viv_phase_zero)
END IF
- CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, viv_cl, viv_cf, viv_df, &
- MERGE(opts%viv_rms_window, &
- REAL(CD_VIV_NM, wp)*MERGE(opts%dtM, dt, opts%has_dtm), &
- opts%viv_rms_window > CD_ZERO), es, em, phase_seed=seed, &
- tangent_reversed=.NOT. ln%ends_swapped)
+ ! the VIV AMPLITUDE tables, left unallocated (absent below) on a line without one
+ CALL viv_amp_tables(types, viv_tix, viv_amp3, viv_ampn)
+ ! with the in-line VIV of the VIV section where a type has ClX > 0
+ IF (ANY(wo_cl0 > CD_ZERO)) THEN
+ ! the wake oscillator: cl is C_L0, the band unused
+ CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, wo_cl0, viv_cf, viv_df, &
+ MERGE(opts%viv_rms_window, &
+ REAL(CD_VIV_NM, wp)*MERGE(opts%dtM, dt, opts%has_dtm), &
+ opts%viv_rms_window > CD_ZERO), es, em, phase_seed=seed, &
+ tangent_reversed=.NOT. ln%ends_swapped, &
+ wake=RESHAPE([wo_st, wo_eps, wo_a, wo_tf], [4, SIZE(wo_st)], &
+ ORDER=[2, 1]), &
+ dviv=viv_dva)
+ ELSE IF (ANY(viv_clx > CD_ZERO)) THEN
+ CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, viv_cl, viv_cf, viv_df, &
+ MERGE(opts%viv_rms_window, &
+ REAL(CD_VIV_NM, wp)*MERGE(opts%dtM, dt, opts%has_dtm), &
+ opts%viv_rms_window > CD_ZERO), 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, 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_cycle=frame_cyc)
+ ELSE
+ CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, viv_cl, viv_cf, viv_df, &
+ MERGE(opts%viv_rms_window, &
+ REAL(CD_VIV_NM, wp)*MERGE(opts%dtM, dt, opts%has_dtm), &
+ opts%viv_rms_window > CD_ZERO), es, em, phase_seed=seed, &
+ 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_cycle=frame_cyc)
+ END IF
END BLOCK
IF (es /= CD_HCDYN_OK) THEN
CALL fail(ErrStat, ErrMsg, 'finite-EI cable VIV wiring failed: '//TRIM(em)); RETURN
@@ -3594,8 +3828,9 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
CALL fail(ErrStat, ErrMsg, 'finite-EI cable added-mass wiring failed: '//TRIM(em)); RETURN
END IF
IF (has_att) THEN
- CALL CD_HFMF_Set_Attachments(cable, att_node, ln%att(2, :), ln%att(3, :), ln%att(4, :), ln%att(6, :), &
- ln%att(5, :), opts%rhoW, opts%g, es, em)
+ CALL CD_HFMF_Set_Attachments(cable, att_node, ln%att(2, :), ln%att(3, :), ln%att(4, :), &
+ MAX(ln%att(6, :), CD_ZERO), ln%att(5, :), opts%rhoW, opts%g, es, em, &
+ isotropic=ln%att(6, :) < CD_ZERO, point_load=ln%att(6, :) < CD_ZERO)
IF (es /= CD_HFMF_OK) THEN
CALL fail(ErrStat, ErrMsg, 'finite-EI cable attachment wiring failed: '//TRIM(em)); RETURN
END IF
@@ -3831,13 +4066,13 @@ END SUBROUTINE torsion_note
SUBROUTINE torsion_after_attachments(est, emt)
!! The torsion stage of a line with ATTACHMENTS, on its discrete equilibrium (after the
- !! attachment polish): the attachments' net weights -(m - rho V) g e_z at their nodes (-m g
- !! e_z above the still-water level, attachment_static_weight) and, in a deck current, their
- !! drag at the twisted state as nodal loads. The drag depends on the node's position and
- !! line tangent, and the weight on the side of the surface, so the stage is repeated, each
- !! time a fresh torsion solve from the last state, with the loads of the last solution until
- !! the solution stops moving and no attachment changes side (fixed point, as in
- !! attachment_static_polish). Every pass starts from the polished state, in equilibrium
+ !! attachment polish): the attachments' net weights -(m - rho V) g e_z at their nodes, less
+ !! the buoyancy an attachment within its radius of the surface loses there
+ !! (attachment_static_weight) and, in a deck current, their drag at the twisted state as
+ !! nodal loads. The drag depends on the node's position and line tangent, and that buoyancy
+ !! on its height, so the stage is repeated, each time a fresh torsion solve from the last
+ !! state, with the loads of the last solution until the solution stops moving (fixed point).
+ !! Every pass starts from the polished state, in equilibrium
!! under the loads at that state: the change to the loads of the last solution is ramped
!! with the imposed twist, in full at the target. Taken in full from the untwisted start, the
!! drag of a twisted shape pushed a lazy wave whose untwisted state is unstable out of its
@@ -3846,26 +4081,19 @@ SUBROUTINE torsion_after_attachments(est, emt)
CHARACTER(*), INTENT(OUT) :: emt
INTEGER, PARAMETER :: MAX_FIXED_POINT = 60
REAL(wp), PARAMETER :: FIXED_POINT_TOL = 1.0e-9_wp ! m
- REAL(wp), ALLOCATABLE :: f_att(:), f_drag(:), q_prev(:), q_polished(:), f_untwisted(:)
- LOGICAL, ALLOCATABLE :: att_dry(:), att_dry_now(:)
+ REAL(wp), ALLOCATABLE :: f_att(:), f_att_now(:), f_drag(:), q_prev(:), q_polished(:), f_untwisted(:)
LOGICAL :: has_drag
- INTEGER :: fp, k_cross
- ! the first attachment a pass moved across the still-water level, which names a failure of
- ! the stage after it (as in attachment_static_polish)
- CHARACTER(512) :: cause
- CHARACTER(64) :: mv
+ INTEGER :: fp
est = CD_DECKDRV_OK
- k_cross = 0
- cause = ''
emt = ''
! every pass starts from the polished, untwisted discrete state (a pass from the last twisted
! state would first relax it, and a writhe a buckling descent left could put Theta_0 a turn
! away, on another branch)
q_polished = q_static
- ALLOCATE (f_att(SIZE(q_static)), f_drag(SIZE(q_static)), att_dry(SIZE(att_node)), att_dry_now(SIZE(att_node)))
+ ALLOCATE (f_att(SIZE(q_static)), f_att_now(SIZE(q_static)), f_drag(SIZE(q_static)))
has_drag = opts%has_current .AND. ANY(ln%att(4, :) > CD_ZERO .OR. ln%att(6, :) > CD_ZERO)
DO fp = 1, MAX_FIXED_POINT
- CALL attachment_static_weight(q_static, att_node, ln%att, opts, f_att, att_dry)
+ CALL attachment_static_weight(q_static, att_node, ln%att, opts, f_att, surface=.TRUE.)
f_drag = CD_ZERO
IF (has_drag) THEN
CALL attachment_static_drag(q_static, att_node, ln%att, opts, frame_cs, f_drag, est, emt)
@@ -3882,35 +4110,16 @@ SUBROUTINE torsion_after_attachments(est, emt)
ELSE
CALL torsion_stage(est, emt, f_untwisted, f_att + f_drag - f_untwisted)
END IF
- IF (est /= CD_DECKDRV_OK) THEN
- IF (k_cross > 0) emt = TRIM(cause)//'; '//TRIM(emt)
- RETURN
- END IF
- ! an attachment the twist moved across the still-water level: once more, with its weight on
- ! its new side
- CALL attachment_static_weight(q_static, att_node, ln%att, opts, f_att, att_dry_now)
- IF (.NOT. ALL(att_dry_now .EQV. att_dry)) THEN
- IF (k_cross == 0) THEN
- k_cross = FINDLOC(att_dry_now .NEQV. att_dry, .TRUE., DIM=1)
- WRITE (mv, '(ES9.3,A,ES9.3)') ln%att(2, k_cross), ' kg, Volume ', ln%att(3, k_cross)
- cause = 'finite-EI torsion static solve with discrete ATTACHMENTS: attachment '// &
- TRIM(int_to_str(k_cross))//' of the line (Mass '//TRIM(ADJUSTL(mv))//' m^3) crossed the '// &
- 'still-water level, where the dynamics drops its buoyancy; a point attachment that its weight '// &
- 'in air takes below the surface and its weight in water above it has no static position (move '// &
- 'it along the line or change its Mass or Volume)'
- END IF
- CYCLE
- END IF
- IF (.NOT. has_drag) RETURN
+ IF (est /= CD_DECKDRV_OK) RETURN
+ ! the weights at the twisted state: an attachment the twist moved within its radius of the
+ ! surface carries another share of its buoyancy (once more, with the loads of this state)
+ CALL attachment_static_weight(q_static, att_node, ln%att, opts, f_att_now, surface=.TRUE.)
+ IF (.NOT. has_drag .AND. ALL(f_att_now <= f_att .AND. f_att_now >= f_att)) RETURN
IF (MAXVAL(ABS(q_static - q_prev)) <= FIXED_POINT_TOL) RETURN
END DO
est = CD_DECKDRV_SOLVEFAIL
- IF (ALL(att_dry_now .EQV. att_dry)) THEN
- emt = 'finite-EI torsion static solve with discrete ATTACHMENTS: the attachment current drag did not '// &
- 'settle to a fixed point'
- ELSE
- emt = cause
- END IF
+ emt = 'finite-EI torsion static solve with discrete ATTACHMENTS: the attachment loads (current drag, '// &
+ 'buoyancy at the surface) did not settle to a fixed point'
END SUBROUTINE torsion_after_attachments
SUBROUTINE twisted_attachment_checks(est, emt)
@@ -4539,7 +4748,16 @@ LOGICAL FUNCTION symmetric_current_retry() RESULT(retry)
ALLOCATE (fixed_dofs(6))
fixed_dofs = [1, 2, 3, ndof - 5, ndof - 4, ndof - 3]
sym_broken = .TRUE.
- nrm = [-frame_cs(2), frame_cs(1)]
+ ! The cross-flow points to the left of the horizontal chord from the anchor (End B) to the
+ ! fairlead (End A), +y for a vertical chord, so the side the line leaves its plane to
+ ! follows the line, not its heading: frame_cs is the identity for any chord without a y
+ ! component, which put the cross-flow at +y for a chord along -x (to its right) and at -y
+ ! for one a round-off away from it (to its left).
+ IF (hspan > 1.0e-9_wp*MAX(1.0_wp, ABS(dxh) + ABS(dyh))) THEN
+ nrm = [-dyh, dxh]/hspan
+ ELSE
+ nrm = [CD_ZERO, CD_ONE]
+ END IF
uh = NORM2(cur_obj%velocity(1:2))
cur_obj%velocity(1:2) = cur_obj%velocity(1:2) + SYM_BREAK*uh*nrm
IF (ALLOCATED(cur_obj%profile_velocity)) THEN
@@ -5627,28 +5845,30 @@ SUBROUTINE add_share(e, share)
INTEGER, INTENT(IN) :: e
REAL(wp), INTENT(IN) :: share
cdn(e) = cdn(e) + share*att(4, k)/(diam(e)*l0(e))
- cdt(e) = cdt(e) + share*att(6, k)/(4.0_wp*QUARTER_PI*diam(e)*l0(e))
+ ! (a point's isotropic drag, CdAx < 0, smears with CdAx = CdA for the continuation start)
+ cdt(e) = cdt(e) + share*MERGE(att(4, k), att(6, k), att(6, k) < CD_ZERO)/(4.0_wp*QUARTER_PI*diam(e)*l0(e))
END SUBROUTINE add_share
END SUBROUTINE smear_attachment_drag
SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att, q, fixed_dofs, &
contact_enabled, contact_z, frame_cs, endconn_k, endconn_d0, endconn_mode, &
opts, tol, ErrStat, ErrMsg, bathymetry, cur_obj, fell_back, cdn_bare, &
- cdt_bare, tol_floor, floor_res)
+ cdt_bare, tol_floor, floor_res, release)
!! Homotopy from the smeared-attachment equilibrium q to the discrete one: in warm-started
!! Newton solves the element weights move from w_smear to w_bare while the lumped nodal
- !! forces -(m - rho V) g e_z (-m g e_z for an attachment above the still-water level,
- !! attachment_static_weight) and, in a deck current, the attachment current drag grow from
+ !! forces -(m - rho V) g e_z (attachment_static_weight), the buoyancy an attachment loses at
+ !! the still-water level (in each Newton iterate: the static solve's att_buoyancy, the
+ !! immersed fraction of the sphere of its volume) and, in a deck current, the attachment
+ !! current drag grow from
!! zero to full, with the contact, dry-buoyancy, end-connection and line current terms of
!! the builder's static problem. With cdn_bare and cdt_bare (the line's own drag
!! coefficients of cur_obj, whose cdn and cdt carry the attachments' drag smeared,
!! smear_attachment_drag) the element drag coefficients move from those of cur_obj to them
!! with the weights, so the smeared drag passes to the nodes as the smeared weight does.
!! The drag depends on the node's position (profile current,
- !! current grid) and line tangent, and the weight on the side of the surface the node is on,
- !! so each solve takes them at its incoming state and the full-load solve is repeated with
- !! those of the last solution until the solution stops moving and no attachment changes
- !! side (fixed point).
+ !! current grid) and line tangent, so each solve takes it at its incoming state and the
+ !! full-load solve is repeated with that of the last solution until the solution stops
+ !! moving (fixed point).
!!
!! The load fraction advances in steps of 1/NSTEP. A step whose damped Newton solve does
!! not converge is repeated from the last converged state with pseudo-transient
@@ -5676,6 +5896,9 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
!! the next update rule, as the line's own static solve accepts a floor at the coupled static
!! tolerance; floor_res (optional out) is the relative residual of the returned state when it
!! lies above tol, and 0 otherwise.
+ !! release (optional, default false) skips the homotopy: q is an equilibrium of the full loads
+ !! with more DOFs held than fixed_dofs holds (a free end seeded held), and the full-load solve
+ !! runs at once, at least once, then to the fixed point as above.
REAL(wp), INTENT(IN) :: l0(:), ea(:), ei(:), w_bare(:), w_smear(:), diam(:), att(:, :)
INTEGER, INTENT(IN) :: node(:), fixed_dofs(:), endconn_mode(2)
REAL(wp), INTENT(INOUT) :: q(:)
@@ -5689,6 +5912,7 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
LOGICAL, INTENT(OUT), OPTIONAL :: fell_back
REAL(wp), INTENT(IN), OPTIONAL :: cdn_bare(:), cdt_bare(:), tol_floor
REAL(wp), INTENT(OUT), OPTIONAL :: floor_res
+ LOGICAL, INTENT(IN), OPTIONAL :: release
INTEGER, PARAMETER :: NSTEP = 8, MAX_FIXED_POINT = 60
! the update rules of a solve (solve_with, static_solve)
INTEGER, PARAMETER :: NEWTON = 1, PSEUDO_TRANSIENT = 2, MERIT = 3
@@ -5700,15 +5924,11 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
INTEGER, PARAMETER :: NEWTON_RETRY_ITER = 40, MAX_FAILED_STEPS = 64
REAL(wp), PARAMETER :: FIXED_POINT_TOL = 1.0e-9_wp ! m
REAL(wp), ALLOCATABLE :: f_att(:), f_drag(:), dry(:), knnode(:), wl(:), q_out(:), curv(:)
+ ! each attachment's buoyancy rho g V and the radius of its sphere at the surface
+ REAL(wp), ALLOCATABLE :: att_b(:), att_r(:)
REAL(wp) :: lam, lam_done, dlam, res, change
INTEGER :: i, ne, fp, n_failed, n_ok, grow_after
- LOGICAL :: has_drag, converged, newton_failed, grown
- ! which attachments are above the still-water level: in the state the last solve took its
- ! loads at, and in the state it returned
- LOGICAL, ALLOCATABLE :: att_dry(:), att_dry_now(:)
- ! the first attachment a solve moved across the still-water level (0: none), which names a
- ! failure of the polish after it
- INTEGER :: k_cross
+ LOGICAL :: has_drag, converged, newton_failed, grown, release_
! The damped Newton failure of the first failed solve, and of the last one.
CHARACTER(1024) :: first_msg, last_msg
CHARACTER(48) :: step_buf, lam_buf
@@ -5742,9 +5962,12 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
n_failed = 0
ne = SIZE(l0)
ALLOCATE (f_att(6*(ne + 1)), f_drag(6*(ne + 1)), dry(ne), q_out(SIZE(q)), curv(ne + 1))
- ALLOCATE (att_dry(SIZE(node)), att_dry_now(SIZE(node)))
- CALL attachment_static_weight(q, node, att, opts, f_att, att_dry)
- k_cross = 0
+ CALL attachment_static_weight(q, node, att, opts, f_att)
+ ALLOCATE (att_b(SIZE(node)), att_r(SIZE(node)))
+ DO i = 1, SIZE(node)
+ att_b(i) = opts%rhoW*opts%g*att(3, i)
+ att_r(i) = CD_HermiteCable_Point_Radius(att(3, i), att(4, i))
+ END DO
has_drag = opts%has_current .AND. ANY(att(4, :) > CD_ZERO .OR. att(6, :) > CD_ZERO)
dry = opts%rhoW*opts%g*QUARTER_PI*diam**2
IF (contact_enabled) THEN
@@ -5760,6 +5983,10 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
n_ok = 0
grow_after = 2
grown = .FALSE.
+ release_ = .FALSE.
+ IF (PRESENT(release)) release_ = release
+ IF (release_) lam_done = CD_ONE
+ wl = w_bare ! the full-load weights (the homotopy sets its own per step)
DO WHILE (lam_done < CD_ONE)
lam = MIN(CD_ONE, lam_done + dlam)
wl = w_bare + (CD_ONE - lam)*(w_smear - w_bare)
@@ -5790,12 +6017,12 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
WRITE (lam_buf, '(F8.6)') lam_done
IF (dlam < MIN_STEP) THEN
WRITE (step_buf, '(ES9.2)') MIN_STEP
- CALL fail_solve(ErrStat, ErrMsg, surface_note('; ')//TRIM(first_msg)//'; the homotopy stopped at '// &
+ CALL fail_solve(ErrStat, ErrMsg, TRIM(first_msg)//'; the homotopy stopped at '// &
'load fraction '//TRIM(ADJUSTL(lam_buf))//', where load steps down to '// &
TRIM(ADJUSTL(step_buf))//' did not converge either')
ELSE
WRITE (step_buf, '(I0)') MAX_FAILED_STEPS
- CALL fail_solve(ErrStat, ErrMsg, surface_note('; ')//TRIM(first_msg)//'; the homotopy stopped at '// &
+ CALL fail_solve(ErrStat, ErrMsg, TRIM(first_msg)//'; the homotopy stopped at '// &
'load fraction '//TRIM(ADJUSTL(lam_buf))//' after '//TRIM(step_buf)// &
' load steps had failed')
END IF
@@ -5803,54 +6030,21 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
END IF
END IF
END DO
- ! An attachment whose node the last solve moved across the still-water level was loaded with
- ! the weight of the other side: the full-load solve is repeated (below) until none does. A
- ! line below the surface (or wholly above it) without attachment drag is done.
- CALL attachment_static_weight(q, node, att, opts, f_att, att_dry_now)
- IF (.NOT. has_drag .AND. ALL(att_dry_now .EQV. att_dry)) RETURN
+ ! The weights are constant and the buoyancy at the surface is part of each solve: without
+ ! attachment drag the homotopy's last solve is the equilibrium.
+ IF (.NOT. release_ .AND. .NOT. has_drag) RETURN
DO fp = 1, MAX_FIXED_POINT
CALL solve_with(CD_ONE, converged, change)
IF (ErrStat /= CD_DECKDRV_OK) RETURN
IF (.NOT. converged) THEN
- CALL fail_solve(ErrStat, ErrMsg, surface_note('; ')//TRIM(last_msg)// &
- ' (attachment current drag and surface fixed point)')
+ CALL fail_solve(ErrStat, ErrMsg, TRIM(last_msg)//' (attachment current drag fixed point)')
RETURN
END IF
- CALL attachment_static_weight(q, node, att, opts, f_att, att_dry_now)
- ! the weight is constant on either side of the surface: with no attachment changing side the
- ! solve took the weights of its own solution, and without drag it is the equilibrium
- IF (ALL(att_dry_now .EQV. att_dry) .AND. (.NOT. has_drag .OR. change <= FIXED_POINT_TOL)) RETURN
+ IF (.NOT. has_drag .OR. change <= FIXED_POINT_TOL) RETURN
END DO
- IF (ALL(att_dry_now .EQV. att_dry)) THEN
- CALL fail_solve(ErrStat, ErrMsg, 'finite-EI static solve with discrete ATTACHMENTS: the attachment '// &
- 'current drag did not settle to a fixed point')
- ELSE
- IF (k_cross == 0) k_cross = FINDLOC(att_dry_now .NEQV. att_dry, .TRUE., DIM=1)
- CALL fail_solve(ErrStat, ErrMsg, surface_note(''))
- END IF
+ CALL fail_solve(ErrStat, ErrMsg, 'finite-EI static solve with discrete ATTACHMENTS: the attachment '// &
+ 'current drag did not settle to a fixed point')
CONTAINS
- FUNCTION surface_note(sep) RESULT(msg)
- !! The cause of a failed polish in which a solve moved an attachment across the still-water
- !! level (k_cross; empty without one), followed by sep: a point attachment that its weight
- !! in air takes below the surface and its weight in water above it (a net-buoyant module
- !! that would float, or any module whose node lies nearer the surface than the deflection
- !! its buoyancy rho V g gives the line) has no static position. Without this the failure
- !! read as a homotopy that stopped (a 200 kg, 2 m^3 module on a slack cable, which the
- !! solves carried above and below the surface in turn).
- CHARACTER(*), INTENT(IN) :: sep
- CHARACTER(:), ALLOCATABLE :: msg
- CHARACTER(64) :: mv
- msg = ''
- IF (k_cross < 1) RETURN
- WRITE (mv, '(ES9.3,A,ES9.3)') att(2, k_cross), ' kg, Volume ', att(3, k_cross)
- msg = 'finite-EI static solve with discrete ATTACHMENTS: attachment '//TRIM(int_to_str(k_cross))// &
- ' of the line (Mass '//TRIM(ADJUSTL(mv))//' m^3) crossed the still-water level, where the '// &
- 'dynamics drops its buoyancy; a point attachment that its weight in air takes below the surface '// &
- 'and its weight in water above it has no static position (move it along the line or change its '// &
- 'Mass or Volume)'
- msg = msg//sep
- END FUNCTION surface_note
-
SUBROUTINE solve_with(scale, ok, dq_max)
!! One warm-started solve at load fraction scale, with the attachment current drag
!! evaluated on the incoming state: the damped Newton iteration and, when it does not
@@ -5868,12 +6062,6 @@ SUBROUTINE solve_with(scale, ok, dq_max)
CHARACTER(48) :: num_buf
ok = .FALSE.
max_it = [MERGE(NEWTON_RETRY_ITER, 200, newton_failed), 200, 200]
- ! the attachments' weights on the side of the surface of the incoming state (the first one the
- ! last solve moved across the surface is recorded for the failure message)
- CALL attachment_static_weight(q, node, att, opts, f_att, att_dry_now)
- IF (k_cross == 0 .AND. .NOT. ALL(att_dry_now .EQV. att_dry)) &
- k_cross = FINDLOC(att_dry_now .NEQV. att_dry, .TRUE., DIM=1)
- att_dry = att_dry_now
f_drag = CD_ZERO
IF (has_drag) THEN
CALL attachment_static_drag(q, node, att, opts, frame_cs, f_drag, es, em)
@@ -5934,7 +6122,8 @@ SUBROUTINE static_solve(mode_s, tol_s, scale, max_it, it, es, em)
endconn_mode=endconn_mode, waterline_z=CD_ZERO, dry_buoyancy=dry, &
water_weight=opts%rhoW*opts%g, current=cur_l, &
backtracking=mode_s == MERIT, merit_line_search=mode_s == MERIT, &
- pseudo_transient=mode_s == PSEUDO_TRANSIENT)
+ pseudo_transient=mode_s == PSEUDO_TRANSIENT, att_node=node, &
+ att_buoyancy=scale*att_b, att_radius=att_r)
ELSE
CALL CD_HermiteCable_Static_Solve(l0, ea, ei, wl, q, fixed_dofs, contact_z, CD_ZERO, 1, max_it(mode_s), &
tol_s, 0.7_wp, q_out, curv, res, it, es, em, &
@@ -5945,7 +6134,8 @@ SUBROUTINE static_solve(mode_s, tol_s, scale, max_it, it, es, em)
endconn_mode=endconn_mode, waterline_z=CD_ZERO, dry_buoyancy=dry, &
water_weight=opts%rhoW*opts%g, current=cur_l, &
backtracking=mode_s == MERIT, merit_line_search=mode_s == MERIT, &
- pseudo_transient=mode_s == PSEUDO_TRANSIENT)
+ pseudo_transient=mode_s == PSEUDO_TRANSIENT, att_node=node, &
+ att_buoyancy=scale*att_b, att_radius=att_r)
END IF
END SUBROUTINE static_solve
END SUBROUTINE attachment_static_polish
@@ -5961,13 +6151,16 @@ SUBROUTINE attachment_static_drag(q, node, att, opts, frame_cs, f, ErrStat, ErrM
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
INTEGER :: k, base, es
- REAL(wp) :: ug(3), ul(3), fd(3)
+ REAL(wp) :: ug(3), ul(3), fd(3), wf, dwf
CHARACTER(1024) :: em
ErrStat = CD_DECKDRV_OK; ErrMsg = ''
DO k = 1, SIZE(node)
IF (.NOT. (att(4, k) > CD_ZERO .OR. att(6, k) > CD_ZERO)) CYCLE
base = 6*(node(k) - 1)
- IF (q(base + 3) > CD_ZERO) CYCLE
+ ! the immersed fraction of the attachment's sphere at the still-water level, as the
+ ! dynamics scales its drag (attachment_residual of the cubic-Hermite model)
+ CALL CD_HermiteCable_Point_Immersion(-q(base + 3), CD_HermiteCable_Point_Radius(att(3, k), att(4, k)), wf, dwf)
+ IF (.NOT. (wf > CD_ZERO)) CYCLE
! the node's global position (the solve frame is the global one turned by frame_cs)
ug = deck_current_velocity(opts, [frame_cs(1)*q(base + 1) - frame_cs(2)*q(base + 2), &
frame_cs(2)*q(base + 1) + frame_cs(1)*q(base + 2), q(base + 3)], &
@@ -5976,36 +6169,47 @@ SUBROUTINE attachment_static_drag(q, node, att, opts, frame_cs, f, ErrStat, ErrM
CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN
END IF
ul = [frame_cs(1)*ug(1) + frame_cs(2)*ug(2), -frame_cs(2)*ug(1) + frame_cs(1)*ug(2), ug(3)]
- CALL CD_HermiteCable_Attachment_Drag(ul, q(base + 4:base + 6), opts%rhoW, att(4, k), att(6, k), fd, es, em)
+ CALL CD_HermiteCable_Attachment_Drag(ul, q(base + 4:base + 6), opts%rhoW, att(4, k), MAX(att(6, k), CD_ZERO), &
+ fd, es, em, isotropic=att(6, k) < CD_ZERO)
IF (es /= CD_HCDYN_OK) THEN
CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN
END IF
- f(base + 1:base + 3) = f(base + 1:base + 3) + fd
+ f(base + 1:base + 3) = f(base + 1:base + 3) + wf*fd
END DO
END SUBROUTINE attachment_static_drag
- SUBROUTINE attachment_static_weight(q, node, att, opts, f, dry)
+ SUBROUTINE attachment_static_weight(q, node, att, opts, f, surface)
!! The attachments' weight at rest as nodal loads (f, the generalized load vector of the
- !! cable solve, set here): -(m - rho V) g e_z at the node of an attachment at or below the
- !! still-water level and -m g e_z above it, as the dynamics loads it (attachment_residual of
- !! the cubic-Hermite model: above the free surface its weight only, no buoyancy, and no drag,
- !! which attachment_static_drag skips there too). Without it the static start kept the
- !! buoyancy of an attachment above the surface: a 500 kg, 0.2 m^3 module 3 m above it on a
- !! cable hung from 5 m above the surface moved the fairlead load by up to 6.1 % in the first
- !! second.
- !! dry(k): attachment k is above the surface in q.
+ !! cable solve, set here): the net weight -(m - rho V) g e_z at the node of each attachment.
+ !! With surface (default false) also the buoyancy an attachment loses at the still-water
+ !! level at its height in q, -rho g V (1 - wf) e_z, wf the immersed fraction of the sphere of
+ !! its volume (CD_HermiteCable_Point_Immersion), as the dynamics loads it (attachment_residual
+ !! of the cubic-Hermite model); exactly -m g e_z from its radius above the surface, nothing
+ !! more from its radius below it. Without surface the static solve adds that share in each
+ !! Newton iterate (att_buoyancy of CD_HermiteCable_Static_Solve). Without it the static start
+ !! kept the buoyancy of an attachment above the surface: a 500 kg, 0.2 m^3 module 3 m above it
+ !! on a cable hung from 5 m above the surface moved the fairlead load by up to 6.1 % in the
+ !! first second.
REAL(wp), INTENT(IN) :: q(:), att(:, :)
INTEGER, INTENT(IN) :: node(:)
TYPE(DeckOptions), INTENT(IN) :: opts
REAL(wp), INTENT(OUT) :: f(:)
- LOGICAL, INTENT(OUT) :: dry(:)
+ LOGICAL, INTENT(IN), OPTIONAL :: surface
INTEGER :: k, base
+ REAL(wp) :: wf, dwf
+ LOGICAL :: surface_
+ surface_ = .FALSE.
+ IF (PRESENT(surface)) surface_ = surface
f = CD_ZERO
DO k = 1, SIZE(node)
base = 6*(node(k) - 1)
- dry(k) = q(base + 3) > CD_ZERO
- IF (dry(k)) THEN
+ wf = CD_ONE
+ IF (surface_) CALL CD_HermiteCable_Point_Immersion(-q(base + 3), CD_HermiteCable_Point_Radius(att(3, k), &
+ att(4, k)), wf, dwf)
+ IF (.NOT. (wf > CD_ZERO)) THEN
f(base + 3) = f(base + 3) - att(2, k)*opts%g
+ ELSE IF (wf < CD_ONE) THEN
+ f(base + 3) = f(base + 3) - (att(2, k) - wf*opts%rhoW*att(3, k))*opts%g
ELSE
f(base + 3) = f(base + 3) - (att(2, k) - opts%rhoW*att(3, k))*opts%g
END IF
@@ -7894,7 +8098,8 @@ SUBROUTINE CD_Init_Deck_HermiteCable(deck_path, dt, cable, coupled_node, ErrStat
'use the aggregate facade with its external SeaState field'); RETURN
END IF
IF (line_has_viv(lines(1), types, sections)) THEN
- CALL fail(ErrStat, ErrMsg, 'CD_Init_Deck_HermiteCable: VIV (LINE TYPES Cl > 0) acts with an ambient '// &
+ CALL fail(ErrStat, ErrMsg, 'CD_Init_Deck_HermiteCable: VIV (LINE TYPES Cl > 0, or a wake oscillator) acts '// &
+ 'with an ambient '// &
'fluid field, which this single-cable entry does not apply; use the aggregate facade'); RETURN
END IF
IF (opts%has_bathymetry_file) THEN
@@ -8185,6 +8390,7 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi
agg%n_turbines = nturb
agg%cable_load_feedback = opts%cable_load_feedback
agg%predict_loads = opts%predict_loads
+ agg%cd_out_dt = opts%cd_out_dt
agg%max_strain = opts%max_strain
! The standalone driver retains DeckOptions and evaluates a WaveKinMod-1 Fourier
@@ -9470,6 +9676,7 @@ SUBROUTINE CD_End_Deck_Aggregate(agg)
agg%host_current_enabled = .FALSE.
agg%cable_load_feedback = .TRUE.
agg%predict_loads = .TRUE.
+ agg%cd_out_dt = CD_ZERO
agg%max_strain = 0.5_wp
IF (ALLOCATED(agg%host_current_profile_z)) DEALLOCATE (agg%host_current_profile_z)
IF (ALLOCATED(agg%host_current_profile_velocity)) DEALLOCATE (agg%host_current_profile_velocity)
@@ -10337,7 +10544,15 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er
REAL(wp), ALLOCATABLE :: ba(:), fluid_velocity(:, :), fluid_acceleration(:, :), drag_waterline(:)
REAL(wp), ALLOCATABLE :: hydro_diam(:), hydro_cdn(:), hydro_cdt(:), hydro_can(:), hydro_cat(:)
REAL(wp), ALLOCATABLE :: ve_ead(:), ve_bas(:), ve_bad(:), ve_ambl(:), ve_vbet(:)
- REAL(wp), ALLOCATABLE :: viv_cl(:), viv_cf(:), viv_df(:)
+ REAL(wp), ALLOCATABLE :: viv_cl(:), viv_cf(:), viv_df(:), viv_clx(:), viv_al(:), viv_hh(:)
+ REAL(wp), ALLOCATABLE :: viv_tix(:), viv_amp3(:, :, :), viv_dia(:)
+ ! the WAKE OSCILLATOR rows per element (C_L0, St, eps, A, Tf; C_L0 0 where none)
+ REAL(wp), ALLOCATABLE :: viv_wo(:, :)
+ ! the VIV FRAME filter time per element (0 where none)
+ REAL(wp), ALLOCATABLE :: viv_ftf(:)
+ ! the VIV STOCHASTIC (sigma, c, Nf, seed) per element (viv_sto_row; sigma 0 where none)
+ REAL(wp), ALLOCATABLE :: viv_sto(:, :)
+ INTEGER, ALLOCATABLE :: viv_ampn(:)
LOGICAL, ALLOCATABLE :: syr_el(:)
REAL(wp) :: anchor(3), fairlead(3), mode1_omega
REAL(wp), PARAMETER :: factors(4) = [0.25_wp, 0.5_wp, 0.75_wp, CD_ONE]
@@ -10376,10 +10591,19 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er
ALLOCATE (ba(SIZE(l0)), hydro_diam(SIZE(l0)), hydro_cdn(SIZE(l0)), hydro_cdt(SIZE(l0)), &
hydro_can(SIZE(l0)), hydro_cat(SIZE(l0)), ve_ead(SIZE(l0)), ve_bas(SIZE(l0)), &
ve_bad(SIZE(l0)), ve_ambl(SIZE(l0)), ve_vbet(SIZE(l0)), viv_cl(SIZE(l0)), viv_cf(SIZE(l0)), &
- viv_df(SIZE(l0)), syr_el(SIZE(l0)))
+ viv_df(SIZE(l0)), syr_el(SIZE(l0)), viv_clx(SIZE(l0)), viv_al(SIZE(l0)), viv_hh(SIZE(l0)), &
+ viv_tix(SIZE(l0)), viv_dia(SIZE(l0)), viv_wo(5, SIZE(l0)), viv_ftf(SIZE(l0)), viv_sto(4, SIZE(l0)))
+ viv_sto = CD_ZERO
+ viv_tix = CD_ZERO
+ viv_wo = CD_ZERO
+ viv_ftf = CD_ZERO
+ viv_dia = CD_ZERO
viv_cl = CD_ZERO
viv_cf = CD_ZERO
viv_df = CD_ZERO
+ viv_clx = CD_ZERO
+ viv_al = CD_ZERO
+ viv_hh = CD_ZERO
ve_ead = CD_ZERO
ve_bas = CD_ZERO
ve_bad = CD_ZERO
@@ -10436,15 +10660,51 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er
hydro_can(e) = types(line_section_type(sections, ln%id, i))%can
hydro_cat(e) = types(line_section_type(sections, ln%id, i))%cat
viv_cl(e) = types(line_section_type(sections, ln%id, i))%cl
+ IF (types(line_section_type(sections, ln%id, i))%wo_cl0 > CD_ZERO) THEN
+ viv_wo(:, e) = [types(line_section_type(sections, ln%id, i))%wo_cl0, &
+ types(line_section_type(sections, ln%id, i))%wo_st, &
+ types(line_section_type(sections, ln%id, i))%wo_eps, &
+ types(line_section_type(sections, ln%id, i))%wo_a, &
+ types(line_section_type(sections, ln%id, i))%viv_tf]
+ END IF
+ IF (types(line_section_type(sections, ln%id, i))%cdy_a >= CD_ZERO) THEN
+ CALL fail(ErrStat, ErrMsg, 'line '//TRIM(int_to_str(ln%id))//': the cross-flow damping (VIV '// &
+ 'DAMPING section) acts on finite-EI cables (EI > 0) only'); RETURN
+ END IF
viv_cf(e) = types(line_section_type(sections, ln%id, i))%viv_cf
viv_df(e) = types(line_section_type(sections, ln%id, i))%viv_df
+ viv_clx(e) = types(line_section_type(sections, ln%id, i))%clx
+ viv_al(e) = types(line_section_type(sections, ln%id, i))%il_alpha
+ viv_hh(e) = types(line_section_type(sections, ln%id, i))%chh
+ IF (types(line_section_type(sections, ln%id, i))%amp_n > 0) viv_tix(e) = REAL(line_section_type(sections, &
+ ln%id, i), wp)
+ ! the VIV DIAMETER of the type, else its Diam
+ viv_dia(e) = MERGE(types(line_section_type(sections, ln%id, i))%viv_dv, hydro_diam(e), &
+ types(line_section_type(sections, ln%id, i))%viv_dv > CD_ZERO)
syr_el(e) = types(line_section_type(sections, ln%id, i))%is_syrope
+ viv_ftf(e) = types(line_section_type(sections, ln%id, i))%viv_tf
+ viv_sto(:, e) = viv_sto_row(types(line_section_type(sections, ln%id, i)), ln%id)
END DO
END DO
syr_el = syr_el(SIZE(syr_el):1:-1)
viv_cl = viv_cl(SIZE(viv_cl):1:-1)
viv_cf = viv_cf(SIZE(viv_cf):1:-1)
viv_df = viv_df(SIZE(viv_df):1:-1)
+ viv_clx = viv_clx(SIZE(viv_clx):1:-1)
+ viv_al = viv_al(SIZE(viv_al):1:-1)
+ viv_hh = viv_hh(SIZE(viv_hh):1:-1)
+ viv_tix = viv_tix(SIZE(viv_tix):1:-1)
+ viv_dia = viv_dia(SIZE(viv_dia):1:-1)
+ viv_wo = viv_wo(:, SIZE(viv_wo, 2):1:-1)
+ viv_ftf = viv_ftf(SIZE(viv_ftf):1:-1)
+ viv_sto = viv_sto(:, SIZE(viv_sto, 2):1:-1)
+ IF (ANY(viv_wo(1, :) > CD_ZERO) .AND. ANY(viv_cl > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'line '//TRIM(int_to_str(ln%id))//': a line takes one VIV model, but its '// &
+ 'types mix the synchronisation lift (LINE TYPES Cl > 0) and the wake oscillator (WAKE '// &
+ 'OSCILLATOR section)'); RETURN
+ END IF
+ ! the wake oscillator: the lift coefficient passed on is C_L0
+ IF (ANY(viv_wo(1, :) > CD_ZERO)) viv_cl = viv_wo(1, :)
ba = ba(SIZE(ba):1:-1)
ve_ead = ve_ead(SIZE(ve_ead):1:-1)
ve_bas = ve_bas(SIZE(ve_bas):1:-1)
@@ -10733,9 +10993,27 @@ 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)
- CALL CD_Set_Model_VIV(model, opts%rhoW, viv_cl, hydro_diam, viv_cf, viv_df, tw, es, em, &
- phase_seed=seed, tangent_reversed=.NOT. ln%ends_swapped)
+ ! the VIV AMPLITUDE tables, left unallocated (absent below) on a line without one
+ CALL viv_amp_tables(types, viv_tix, viv_amp3, viv_ampn)
+ ! with the in-line VIV of the VIV section where a type has ClX > 0
+ IF (ANY(viv_wo(1, :) > CD_ZERO)) THEN
+ ! the wake oscillator: cl is C_L0, the band unused
+ 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, wake=viv_wo(2:5, :))
+ ELSE IF (ANY(viv_clx > CD_ZERO)) THEN
+ 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, 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, tf_cycle=frame_cyc)
+ END IF
END BLOCK
IF (es == CD_MODEL_OK) CALL CD_Recompute_Model_Acceleration(model, es, em)
IF (es /= CD_MODEL_OK) THEN
@@ -11473,6 +11751,27 @@ SUBROUTINE finite_raw_ba_array(ln, sections, types, ba_raw)
ba_raw = ba_raw(SIZE(ba_raw):1:-1)
END SUBROUTINE finite_raw_ba_array
+ SUBROUTINE finite_bb_array(ln, sections, types, bb, ralpha)
+ !! The line types' bending damping Bb [N m^2 s] and mass-proportional damping alpha [1/s] on
+ !! the deck elements (internal order).
+ TYPE(DeckLine), INTENT(IN) :: ln
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ REAL(wp), INTENT(OUT) :: bb(:), ralpha(:)
+ INTEGER :: i, j, e
+ e = 0
+ DO i = 1, SIZE(sections)
+ IF (sections(i)%line_id /= ln%id) CYCLE
+ DO j = 1, sections(i)%nsegs
+ e = e + 1
+ bb(e) = types(sections(i)%ltype)%bb
+ ralpha(e) = types(sections(i)%ltype)%ralpha
+ END DO
+ END DO
+ bb = bb(SIZE(bb):1:-1)
+ ralpha = ralpha(SIZE(ralpha):1:-1)
+ END SUBROUTINE finite_bb_array
+
SUBROUTINE finite_line_type_ei(ln, sections, types, ei)
!! The line types' own bending stiffness on the deck elements (internal order), without
!! any STIFFENERS sleeve.
@@ -11525,13 +11824,13 @@ SUBROUTINE finite_hydro_arrays(ln, sections, types, diam, cdn, cdt, can, cat)
cat = cat(SIZE(cat):1:-1)
END SUBROUTINE finite_hydro_arrays
- SUBROUTINE finite_viv_arrays(ln, sections, types, cl, cf, df)
- !! Expand the section VIV columns (Cl dF cF) to finite-EI element arrays, in the element
- !! order of finite_hydro_arrays.
+ SUBROUTINE finite_viv_arrays(ln, sections, types, cl, cf, df, clx, il_alpha, chh)
+ !! Expand the section VIV columns (Cl dF cF) and the VIV section's in-line ClX and alpha and
+ !! higher-harmonic Chh to finite-EI element arrays, in the element order of finite_hydro_arrays.
TYPE(DeckLine), INTENT(IN) :: ln
TYPE(DeckSection), INTENT(IN) :: sections(:)
TYPE(DeckLineType), INTENT(IN) :: types(:)
- REAL(wp), INTENT(OUT) :: cl(:), cf(:), df(:)
+ REAL(wp), INTENT(OUT) :: cl(:), cf(:), df(:), clx(:), il_alpha(:), chh(:)
INTEGER :: i, j, e, tidx
e = 0
@@ -11543,13 +11842,147 @@ SUBROUTINE finite_viv_arrays(ln, sections, types, cl, cf, df)
cl(e) = types(tidx)%cl
cf(e) = types(tidx)%viv_cf
df(e) = types(tidx)%viv_df
+ clx(e) = types(tidx)%clx
+ il_alpha(e) = types(tidx)%il_alpha
+ chh(e) = types(tidx)%chh
END DO
END DO
cl = cl(SIZE(cl):1:-1)
cf = cf(SIZE(cf):1:-1)
df = df(SIZE(df):1:-1)
+ clx = clx(SIZE(clx):1:-1)
+ il_alpha = il_alpha(SIZE(il_alpha):1:-1)
+ chh = chh(SIZE(chh):1:-1)
END SUBROUTINE finite_viv_arrays
+ SUBROUTINE finite_wake_arrays(ln, sections, types, cl0, st, eps, a, tf)
+ !! Expand the WAKE OSCILLATOR rows (CL0, St, eps, A, Tf) to finite-EI element arrays, in the
+ !! element order of finite_hydro_arrays.
+ TYPE(DeckLine), INTENT(IN) :: ln
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ REAL(wp), INTENT(OUT) :: cl0(:), st(:), eps(:), a(:), tf(:)
+ INTEGER :: i, j, e, tidx
+
+ e = 0
+ DO i = 1, SIZE(sections)
+ IF (sections(i)%line_id /= ln%id) CYCLE
+ tidx = sections(i)%ltype
+ DO j = 1, sections(i)%nsegs
+ e = e + 1
+ cl0(e) = types(tidx)%wo_cl0
+ st(e) = types(tidx)%wo_st
+ eps(e) = types(tidx)%wo_eps
+ a(e) = types(tidx)%wo_a
+ tf(e) = types(tidx)%viv_tf
+ END DO
+ END DO
+ cl0 = cl0(SIZE(cl0):1:-1)
+ st = st(SIZE(st):1:-1)
+ eps = eps(SIZE(eps):1:-1)
+ a = a(SIZE(a):1:-1)
+ tf = tf(SIZE(tf):1:-1)
+ END SUBROUTINE finite_wake_arrays
+
+ SUBROUTINE viv_amp_type_index(ln, sections, types, tix)
+ !! The LINE TYPES index of every element of a line whose type has a VIV AMPLITUDE table (0
+ !! elsewhere), as a real per-element field for remap_elem_by_reference_arc, in the element order
+ !! of finite_hydro_arrays (the deck order reversed).
+ TYPE(DeckLine), INTENT(IN) :: ln
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ REAL(wp), INTENT(OUT) :: tix(:)
+ INTEGER :: i, j, e, tidx
+ e = 0
+ DO i = 1, SIZE(sections)
+ IF (sections(i)%line_id /= ln%id) CYCLE
+ tidx = sections(i)%ltype
+ DO j = 1, sections(i)%nsegs
+ e = e + 1
+ tix(e) = CD_ZERO
+ IF (types(tidx)%amp_n > 0) tix(e) = REAL(tidx, wp)
+ END DO
+ END DO
+ tix = tix(SIZE(tix):1:-1)
+ END SUBROUTINE viv_amp_type_index
+
+ SUBROUTINE finite_viv_cdy(ln, sections, types, ca, cb, cc)
+ !! The VIV DAMPING (a, b, c) of every element's line type (a = -1 where the type has none), in the
+ !! element order of finite_hydro_arrays (the deck order reversed).
+ TYPE(DeckLine), INTENT(IN) :: ln
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ REAL(wp), INTENT(OUT) :: ca(:), cb(:), cc(:)
+ INTEGER :: i, j, e
+ e = 0
+ DO i = 1, SIZE(sections)
+ IF (sections(i)%line_id /= ln%id) CYCLE
+ DO j = 1, sections(i)%nsegs
+ e = e + 1
+ ca(e) = types(sections(i)%ltype)%cdy_a
+ cb(e) = types(sections(i)%ltype)%cdy_b
+ cc(e) = types(sections(i)%ltype)%cdy_c
+ END DO
+ END DO
+ ca = ca(SIZE(ca):1:-1)
+ cb = cb(SIZE(cb):1:-1)
+ cc = cc(SIZE(cc):1:-1)
+ END SUBROUTINE finite_viv_cdy
+
+ SUBROUTINE finite_viv_diameters(ln, sections, types, dv)
+ !! The VIV DIAMETER of every element's line type (0 where the type has none, the drag diameter
+ !! then), in the element order of finite_hydro_arrays (the deck order reversed).
+ TYPE(DeckLine), INTENT(IN) :: ln
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ REAL(wp), INTENT(OUT) :: dv(:)
+ INTEGER :: i, j, e
+ e = 0
+ DO i = 1, SIZE(sections)
+ IF (sections(i)%line_id /= ln%id) CYCLE
+ DO j = 1, sections(i)%nsegs
+ e = e + 1
+ dv(e) = types(sections(i)%ltype)%viv_dv
+ END DO
+ END DO
+ dv = dv(SIZE(dv):1:-1)
+ END SUBROUTINE finite_viv_diameters
+
+ SUBROUTINE viv_amp_tables(types, tix, amp, ampn)
+ !! Allocate and fill the per-element amplitude tables (CD_Set_Model_VIV and
+ !! CD_HermiteCable_Dyn_Set_VIV amp, amp_n) from the element type indices of
+ !! viv_amp_type_index; left unallocated (so absent in those calls) when no element has one.
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ REAL(wp), INTENT(IN) :: tix(:)
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: amp(:, :, :)
+ INTEGER, ALLOCATABLE, INTENT(OUT) :: ampn(:)
+ INTEGER :: e, t
+ IF (.NOT. ANY(tix > 0.5_wp)) RETURN
+ ALLOCATE (amp(3, CD_VIV_AMP_MAXP, SIZE(tix)), ampn(SIZE(tix)))
+ amp = CD_ZERO
+ ampn = 0
+ DO e = 1, SIZE(tix)
+ t = NINT(tix(e))
+ IF (t < 1) CYCLE
+ ampn(e) = types(t)%amp_n
+ amp(:, :, e) = types(t)%amp_tab
+ END DO
+ END SUBROUTINE viv_amp_tables
+
+ LOGICAL FUNCTION line_has_viv_amp(ln, types, sections) RESULT(has)
+ !! Whether a section of the line uses a line type with a VIV AMPLITUDE table.
+ TYPE(DeckLine), INTENT(IN) :: ln
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ INTEGER :: j
+ has = .FALSE.
+ DO j = 1, SIZE(sections)
+ IF (sections(j)%line_id /= ln%id) CYCLE
+ IF (sections(j)%ltype < 1 .OR. sections(j)%ltype > SIZE(types)) CYCLE
+ IF (types(sections(j)%ltype)%amp_n > 0) has = .TRUE.
+ END DO
+ END FUNCTION line_has_viv_amp
+
LOGICAL FUNCTION line_has_viv(ln, types, sections) RESULT(has)
!! Whether a section of the line uses a line type with a VIV lift coefficient Cl > 0.
TYPE(DeckLine), INTENT(IN) :: ln
@@ -11561,6 +11994,7 @@ LOGICAL FUNCTION line_has_viv(ln, types, sections) RESULT(has)
IF (sections(j)%line_id /= ln%id) CYCLE
IF (sections(j)%ltype < 1 .OR. sections(j)%ltype > SIZE(types)) CYCLE
IF (types(sections(j)%ltype)%cl > CD_ZERO) has = .TRUE.
+ IF (types(sections(j)%ltype)%wo_cl0 > CD_ZERO) has = .TRUE.
END DO
END FUNCTION line_has_viv
@@ -13661,6 +14095,27 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti
CHARACTER(DECK_RECLEN), ALLOCATABLE :: stf_rows(:)
INTEGER, ALLOCATABLE :: stf_lines(:)
INTEGER :: n_stf
+ CHARACTER(DECK_RECLEN), ALLOCATABLE :: viv_rows(:)
+ INTEGER, ALLOCATABLE :: viv_lines(:)
+ INTEGER :: n_viv
+ CHARACTER(DECK_RECLEN), ALLOCATABLE :: wake_rows(:)
+ INTEGER, ALLOCATABLE :: wake_lines(:)
+ INTEGER :: n_wake
+ CHARACTER(DECK_RECLEN), ALLOCATABLE :: vamp_rows(:)
+ INTEGER, ALLOCATABLE :: vamp_lines(:)
+ INTEGER :: n_vamp
+ CHARACTER(DECK_RECLEN), ALLOCATABLE :: vdia_rows(:)
+ CHARACTER(DECK_RECLEN), ALLOCATABLE :: vdmp_rows(:)
+ INTEGER, ALLOCATABLE :: vdmp_lines(:)
+ INTEGER :: n_vdmp
+ INTEGER, ALLOCATABLE :: vdia_lines(:)
+ INTEGER :: n_vdia
+ CHARACTER(DECK_RECLEN), ALLOCATABLE :: vfrm_rows(:)
+ INTEGER, ALLOCATABLE :: vfrm_lines(:)
+ INTEGER :: n_vfrm
+ CHARACTER(DECK_RECLEN), ALLOCATABLE :: vsto_rows(:)
+ INTEGER, ALLOCATABLE :: vsto_lines(:)
+ INTEGER :: n_vsto
CHARACTER(2*NAMELEN), ALLOCATABLE :: channel_keys(:)
LOGICAL :: ext_march, types_stock_cols, rodtypes_legacy_cols, turb_ok, static_finite_ok, tors_marched
INTEGER :: unit, ios, section, nt, nb, nrt, nr, np, nlin, nsec, neq, nch, nfl, nct, nec, lineno
@@ -13678,7 +14133,8 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti
SEC_SECTIONS = 5, SEC_OPTIONS = 6, SEC_OUTPUTS = 7, SEC_RODTYPES = 8, SEC_RODS = 9, &
SEC_EQUIV = 10, SEC_FAILURE = 11, SEC_CONTROL = 12, SEC_SYROPE_IC = 13, &
SEC_ENDCONN = 14, SEC_TURBINES = 15, SEC_EXTLOADS = 16, SEC_ATTACH = 17, &
- SEC_STIFF = 18
+ SEC_STIFF = 18, SEC_VIV = 19, SEC_WAKE = 20, SEC_VIVAMP = 21, SEC_VIVDIA = 22, &
+ SEC_VIVDAMP = 23, SEC_VIVFRAME = 25, SEC_VIVSTO = 26
ErrStat = 0; ErrMsg = ''
ext_march = .FALSE.
@@ -13700,6 +14156,20 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti
n_att = 0
ALLOCATE (stf_rows(0), stf_lines(0))
n_stf = 0
+ ALLOCATE (viv_rows(0), viv_lines(0))
+ n_viv = 0
+ ALLOCATE (wake_rows(0), wake_lines(0))
+ ALLOCATE (vamp_rows(0), vamp_lines(0))
+ n_vamp = 0
+ ALLOCATE (vdia_rows(0), vdia_lines(0))
+ ALLOCATE (vdmp_rows(0), vdmp_lines(0))
+ n_vdmp = 0
+ ALLOCATE (vfrm_rows(0), vfrm_lines(0))
+ n_vfrm = 0
+ ALLOCATE (vsto_rows(0), vsto_lines(0))
+ n_vsto = 0
+ n_vdia = 0
+ n_wake = 0
nt = 0; nb = 0; nrt = 0; nr = 0; np = 0; nlin = 0; nsec = 0; neq = 0; nch = 0; nfl = 0; nct = 0; nec = 0
section = SEC_NONE
ALLOCATE (channel_lines(0))
@@ -13825,6 +14295,69 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti
END IF
stf_rows(n_stf) = line(1:MIN(LEN(line), DECK_RECLEN))
stf_lines(n_stf) = lineno
+ CASE (SEC_VIV)
+ IF (.NOT. has_numeric_token(line)) CYCLE
+ n_viv = n_viv + 1
+ IF (n_viv > SIZE(viv_rows)) THEN
+ viv_rows = [viv_rows, [(REPEAT(' ', DECK_RECLEN), i_ch=1, 8)]]
+ viv_lines = [viv_lines, [(0, i_ch=1, 8)]]
+ END IF
+ viv_rows(n_viv) = line(1:MIN(LEN(line), DECK_RECLEN))
+ viv_lines(n_viv) = lineno
+ CASE (SEC_WAKE)
+ IF (.NOT. has_numeric_token(line)) CYCLE
+ n_wake = n_wake + 1
+ IF (n_wake > SIZE(wake_rows)) THEN
+ wake_rows = [wake_rows, [(REPEAT(' ', DECK_RECLEN), i_ch=1, 8)]]
+ wake_lines = [wake_lines, [(0, i_ch=1, 8)]]
+ END IF
+ wake_rows(n_wake) = line(1:MIN(LEN(line), DECK_RECLEN))
+ wake_lines(n_wake) = lineno
+ CASE (SEC_VIVAMP)
+ IF (.NOT. has_numeric_token(line)) CYCLE
+ n_vamp = n_vamp + 1
+ IF (n_vamp > SIZE(vamp_rows)) THEN
+ vamp_rows = [vamp_rows, [(REPEAT(' ', DECK_RECLEN), i_ch=1, 8)]]
+ vamp_lines = [vamp_lines, [(0, i_ch=1, 8)]]
+ END IF
+ vamp_rows(n_vamp) = line(1:MIN(LEN(line), DECK_RECLEN))
+ vamp_lines(n_vamp) = lineno
+ CASE (SEC_VIVDAMP)
+ IF (.NOT. has_numeric_token(line)) CYCLE
+ n_vdmp = n_vdmp + 1
+ IF (n_vdmp > SIZE(vdmp_rows)) THEN
+ vdmp_rows = [vdmp_rows, [(REPEAT(' ', DECK_RECLEN), i_ch=1, 8)]]
+ vdmp_lines = [vdmp_lines, [(0, i_ch=1, 8)]]
+ END IF
+ vdmp_rows(n_vdmp) = line(1:MIN(LEN(line), DECK_RECLEN))
+ vdmp_lines(n_vdmp) = lineno
+ CASE (SEC_VIVFRAME)
+ IF (.NOT. has_numeric_token(line)) CYCLE
+ n_vfrm = n_vfrm + 1
+ IF (n_vfrm > SIZE(vfrm_rows)) THEN
+ vfrm_rows = [vfrm_rows, [(REPEAT(' ', DECK_RECLEN), i_ch=1, 8)]]
+ vfrm_lines = [vfrm_lines, [(0, i_ch=1, 8)]]
+ END IF
+ vfrm_rows(n_vfrm) = line(1:MIN(LEN(line), DECK_RECLEN))
+ vfrm_lines(n_vfrm) = lineno
+ CASE (SEC_VIVSTO)
+ IF (.NOT. has_numeric_token(line)) CYCLE
+ n_vsto = n_vsto + 1
+ IF (n_vsto > SIZE(vsto_rows)) THEN
+ vsto_rows = [vsto_rows, [(REPEAT(' ', DECK_RECLEN), i_ch=1, 8)]]
+ vsto_lines = [vsto_lines, [(0, i_ch=1, 8)]]
+ END IF
+ vsto_rows(n_vsto) = line(1:MIN(LEN(line), DECK_RECLEN))
+ vsto_lines(n_vsto) = lineno
+ CASE (SEC_VIVDIA)
+ IF (.NOT. has_numeric_token(line)) CYCLE
+ n_vdia = n_vdia + 1
+ IF (n_vdia > SIZE(vdia_rows)) THEN
+ vdia_rows = [vdia_rows, [(REPEAT(' ', DECK_RECLEN), i_ch=1, 8)]]
+ vdia_lines = [vdia_lines, [(0, i_ch=1, 8)]]
+ END IF
+ vdia_rows(n_vdia) = line(1:MIN(LEN(line), DECK_RECLEN))
+ vdia_lines(n_vdia) = lineno
CASE (SEC_OPTIONS)
CALL apply_option(line, opts, ErrStat, ErrMsg)
CASE (SEC_OUTPUTS)
@@ -13922,6 +14455,61 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti
RETURN
END IF
END DO
+ DO i_ch = 1, n_viv
+ CALL apply_type_viv(viv_rows(i_ch), types, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) THEN
+ CALL add_row_context('deck', viv_lines(i_ch), viv_rows(i_ch), ErrMsg)
+ RETURN
+ END IF
+ END DO
+ DO i_ch = 1, n_wake
+ CALL apply_type_wake(wake_rows(i_ch), types, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) THEN
+ CALL add_row_context('deck', wake_lines(i_ch), wake_rows(i_ch), ErrMsg)
+ RETURN
+ END IF
+ END DO
+ DO i_ch = 1, n_vamp
+ CALL apply_type_viv_amp(vamp_rows(i_ch), types, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) THEN
+ CALL add_row_context('deck', vamp_lines(i_ch), vamp_rows(i_ch), ErrMsg)
+ RETURN
+ END IF
+ END DO
+ DO i_ch = 1, n_vdia
+ CALL apply_type_viv_diam(vdia_rows(i_ch), types, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) THEN
+ CALL add_row_context('deck', vdia_lines(i_ch), vdia_rows(i_ch), ErrMsg)
+ RETURN
+ END IF
+ END DO
+ DO i_ch = 1, n_vdmp
+ CALL apply_type_viv_damp(vdmp_rows(i_ch), types, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) THEN
+ CALL add_row_context('deck', vdmp_lines(i_ch), vdmp_rows(i_ch), ErrMsg)
+ RETURN
+ END IF
+ END DO
+ DO i_ch = 1, n_vfrm
+ CALL apply_type_viv_frame(vfrm_rows(i_ch), types, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) THEN
+ CALL add_row_context('deck', vfrm_lines(i_ch), vfrm_rows(i_ch), ErrMsg)
+ RETURN
+ END IF
+ END DO
+ DO i_ch = 1, n_vsto
+ CALL apply_type_viv_sto(vsto_rows(i_ch), types, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) THEN
+ CALL add_row_context('deck', vsto_lines(i_ch), vsto_rows(i_ch), ErrMsg)
+ RETURN
+ END IF
+ END DO
+ DO i_ch = 1, SIZE(types)
+ IF (types(i_ch)%amp_n == 1) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE gives LINE TYPE "'//TRIM(types(i_ch)%name)//'" one row: a '// &
+ 'table needs at least two'); RETURN
+ END IF
+ END DO
! Caller-supplied environment overrides land HERE -- before equivalent-buoyancy
! conversion and validation -- so both run under the environment the model is
@@ -14005,6 +14593,7 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti
END IF
END DO
CALL normalize_stock_endpoint_order(points, lines, sections, types)
+ CALL promote_free_cable_ends(points, lines, sections, types, opts, SIZE(bodies), SIZE(rods), ext_march)
tors_marched = ext_march
IF (PRESENT(static_run)) tors_marched = ext_march .AND. .NOT. static_run
! A static check marches no step, so it needs no dtM: on the routes no caller marches
@@ -15588,6 +16177,20 @@ SUBROUTINE set_section(secname, section, ErrStat, ErrMsg)
section = 17
CASE ('STIFFENERS', 'STIFFENER', 'BEND STIFFENERS', 'BEND STIFFENER')
section = 18
+ CASE ('VIV', 'VORTEX-INDUCED VIBRATION', 'VORTEX INDUCED VIBRATION')
+ section = 19
+ CASE ('VIV AMPLITUDE', 'VIV AMPLITUDES')
+ section = 21
+ CASE ('VIV DIAMETER', 'VIV DIAMETERS')
+ section = 22
+ CASE ('VIV DAMPING')
+ section = 23
+ CASE ('VIV FRAME', 'VIV FRAMES')
+ section = 25
+ CASE ('VIV STOCHASTIC')
+ section = 26
+ CASE ('WAKE OSCILLATOR', 'WAKE OSCILLATORS', 'WAKE')
+ section = 20
CASE DEFAULT
IF (LEN_TRIM(secname) > NAMELEN) THEN
CALL fail(ErrStat, ErrMsg, 'unknown deck section "'//secname(1:NAMELEN)//'..."')
@@ -15615,6 +16218,99 @@ SUBROUTINE sniff_types_header(line, stock_cols)
END IF
END SUBROUTINE sniff_types_header
+ SUBROUTINE parse_ei_column(ei_str, t, ErrStat, ErrMsg)
+ !! The LINE TYPES EI column: EI, EI|Bb with Bb >= 0 the bending damping [N m^2 s] (the moment
+ !! Bb times the curvature rate), EI|-zeta|f with 0 < zeta < 1 the damping ratio of a bending
+ !! mode of frequency f [Hz] whose energy is all bending, Bb = zeta EI/(pi f), or EI|-zeta|f1|f2,
+ !! the Rayleigh pair of the bending damping Bb and the mass-proportional damping alpha [1/s]
+ !! that holds zeta at f1 and f2 (CD_HermiteCable_Rayleigh_Pair). Damping needs a finite-EI
+ !! cable (EI > 0).
+ CHARACTER(*), INTENT(IN) :: ei_str
+ TYPE(DeckLineType), INTENT(INOUT) :: t
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER :: bars(3), nbar, k, ios
+ REAL(wp) :: second, freq, freq2
+ REAL(wp), PARAMETER :: PI_L = 3.14159265358979323846_wp
+ CHARACTER(*), PARAMETER :: FORMS = 'EI, EI|Bb, EI|-zeta|f or EI|-zeta|f1|f2'
+ ErrStat = 0; ErrMsg = ''
+ t%bb = CD_ZERO
+ t%ralpha = CD_ZERO
+ second = CD_ZERO
+ freq = CD_ZERO
+ freq2 = CD_ZERO
+ ! the bar positions; a fourth bar is refused
+ nbar = 0
+ bars = 0
+ DO k = 1, LEN_TRIM(ei_str)
+ IF (ei_str(k:k) /= '|') CYCLE
+ IF (nbar == 3) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'" takes '//FORMS); RETURN
+ END IF
+ nbar = nbar + 1
+ bars(nbar) = k
+ END DO
+ SELECT CASE (nbar)
+ CASE (0)
+ READ (ei_str, *, IOSTAT=ios) t%ei
+ CASE (1)
+ READ (ei_str(1:bars(1) - 1), *, IOSTAT=ios) t%ei
+ IF (ios == 0) READ (ei_str(bars(1) + 1:), *, IOSTAT=ios) second
+ CASE (2)
+ READ (ei_str(1:bars(1) - 1), *, IOSTAT=ios) t%ei
+ IF (ios == 0) READ (ei_str(bars(1) + 1:bars(2) - 1), *, IOSTAT=ios) second
+ IF (ios == 0) READ (ei_str(bars(2) + 1:), *, IOSTAT=ios) freq
+ CASE DEFAULT
+ READ (ei_str(1:bars(1) - 1), *, IOSTAT=ios) t%ei
+ IF (ios == 0) READ (ei_str(bars(1) + 1:bars(2) - 1), *, IOSTAT=ios) second
+ IF (ios == 0) READ (ei_str(bars(2) + 1:bars(3) - 1), *, IOSTAT=ios) freq
+ IF (ios == 0) READ (ei_str(bars(3) + 1:), *, IOSTAT=ios) freq2
+ END SELECT
+ IF (ios /= 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'" is not '//FORMS); RETURN
+ END IF
+ IF (.NOT. (IEEE_IS_FINITE(t%ei) .AND. IEEE_IS_FINITE(second) .AND. IEEE_IS_FINITE(freq) .AND. &
+ IEEE_IS_FINITE(freq2))) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'" must be finite'); RETURN
+ END IF
+ SELECT CASE (nbar)
+ CASE (0)
+ RETURN
+ CASE (1)
+ IF (second < CD_ZERO) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'": a negative bending damping is '// &
+ '-zeta and needs the frequency it holds at, EI|-zeta|f'); RETURN
+ END IF
+ t%bb = second
+ CASE (2)
+ IF (.NOT. (second < CD_ZERO .AND. second > -CD_ONE)) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'": EI|-zeta|f takes a damping '// &
+ 'ratio 0 < zeta < 1, written negative'); RETURN
+ END IF
+ IF (.NOT. (freq > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'": the frequency f of '// &
+ 'EI|-zeta|f must be positive [Hz]'); RETURN
+ END IF
+ t%bb = -second*t%ei/(PI_L*freq)
+ CASE DEFAULT
+ IF (.NOT. (second < CD_ZERO .AND. second > -CD_ONE)) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'": EI|-zeta|f1|f2 takes a '// &
+ 'damping ratio 0 < zeta < 1, written negative'); RETURN
+ END IF
+ IF (.NOT. (freq > CD_ZERO .AND. freq2 > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES EI column "'//TRIM(ei_str)//'": the frequencies f1 and f2 of '// &
+ 'EI|-zeta|f1|f2 must be positive [Hz]'); RETURN
+ END IF
+ CALL CD_HermiteCable_Rayleigh_Pair(-second, freq, freq2, t%ei, t%bb, t%ralpha)
+ END SELECT
+ ! a damping asked for (a ratio form, or Bb > 0) needs a finite EI: on EI = 0 the ratio form would
+ ! resolve to Bb = 0 and the request would pass unnoticed
+ IF ((nbar >= 2 .OR. t%bb > CD_ZERO) .AND. .NOT. (t%ei > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'LINE TYPES '//TRIM(t%name)//': bending damping (EI|Bb) needs a '// &
+ 'finite-EI cable (EI > 0)'); RETURN
+ END IF
+ END SUBROUTINE parse_ei_column
+
SUBROUTINE parse_gj_column(gj_str, t, ErrStat, ErrMsg)
!! The 14-column row's GJ column: GJ, GJ|K with K the torque-tension coupling [N m]
!! (M = GJ tau + K eps, T = EA eps + K tau; K > 0 when stretching the cable twists it in the
@@ -15664,55 +16360,67 @@ SUBROUTINE append_type(line, types, nt, stock_cols, ErrStat, ErrMsg)
TYPE(DeckLineType) :: t
! EA may hold SYROPE:|alpha|beta, so it gets a path-length buffer
CHARACTER(CD_DECK_PATHLEN) :: ea_str
- CHARACTER(NAMELEN) :: ba_str, gj_str
+ CHARACTER(NAMELEN) :: ba_str, gj_str, ei_str
INTEGER :: ios, ntok
ErrStat = 0; ErrMsg = ''
ntok = count_tokens(line)
- IF (ntok /= 10 .AND. ntok /= 11 .AND. ntok /= 13 .AND. ntok /= 14) THEN
+ IF (ntok /= 10 .AND. ntok /= 11 .AND. ntok /= 13 .AND. ntok /= 14 .AND. ntok /= 15 .AND. ntok /= 17) THEN
CALL fail(ErrStat, ErrMsg, 'LINE TYPES row needs 10 cols '// &
- '(Name Diam MassDenInAir EA BA/-zeta EI Cd_n Cd_t Ca_n Ca_t), 11 or 13 cols (the same '// &
- 'followed by MoorDyn''s VIV columns Cl [dF cF]) or 14 cols '// &
- '(Name Diam MassDenInAir EA BA/-zeta EI GAs GJ Irt Irn Cd_n Cd_t Ca_n Ca_t)'); RETURN
+ '(Name Diam MassDenInAir EA BA/-zeta EI Cd_n Cd_t Ca_n Ca_t) or 14 cols '// &
+ '(Name Diam MassDenInAir EA BA/-zeta EI GAs GJ Irt Irn Cd_n Cd_t Ca_n Ca_t), either '// &
+ 'followed by MoorDyn''s VIV columns Cl [dF cF] (11, 13, 15 or 17 cols)'); RETURN
END IF
! EA and BA read as STRINGS: MoorDyn's viscoelastic syntax carries
! bar-separated parts (Es|Ed[|alpha], Bs|Bd) that a numeric read cannot see.
IF (ntok == 10) THEN
IF (stock_cols) THEN
! stock MoorDyn header order: Cd Ca CdAx CaAx = (Cd_n, Ca_n, Cd_t, Ca_t)
- READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, t%ei, t%cdn, t%can, t%cdt, t%cat
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%cdn, t%can, t%cdt, t%cat
ELSE
- READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, t%ei, t%cdn, t%cdt, t%can, t%cat
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%cdn, t%cdt, t%can, t%cat
END IF
ELSE IF (ntok == 11 .OR. ntok == 13) THEN
! MoorDyn v2's optional cross-flow VIV columns after the ten standard ones: Cl, or
! Cl dF cF (MoorDyn.f90 line-type parse; dF and cF default to 0.08 and 0.18)
IF (stock_cols) THEN
IF (ntok == 11) THEN
- READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, t%ei, t%cdn, t%can, t%cdt, t%cat, t%cl
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%cdn, t%can, t%cdt, t%cat, t%cl
ELSE
- READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, t%ei, t%cdn, t%can, t%cdt, t%cat, &
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%cdn, t%can, t%cdt, t%cat, &
t%cl, t%viv_df, t%viv_cf
END IF
ELSE
IF (ntok == 11) THEN
- READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, t%ei, t%cdn, t%cdt, t%can, t%cat, t%cl
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%cdn, t%cdt, t%can, t%cat, t%cl
ELSE
- READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, t%ei, t%cdn, t%cdt, t%can, t%cat, &
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%cdn, t%cdt, t%can, t%cat, &
t%cl, t%viv_df, t%viv_cf
END IF
END IF
ELSE
IF (stock_cols) THEN
- CALL fail(ErrStat, ErrMsg, 'the 14-column LINE TYPES row is a CableDyn form (... Cd_n Cd_t '// &
- 'Ca_n Ca_t); it does not combine with a stock-order header (Cd Ca CdAx CaAx)'); RETURN
+ CALL fail(ErrStat, ErrMsg, 'the 14-column LINE TYPES row (15 or 17 with VIV) is a CableDyn form '// &
+ '(... Cd_n Cd_t Ca_n Ca_t); it does not combine with a stock-order header (Cd Ca CdAx CaAx)')
+ RETURN
+ END IF
+ ! the CableDyn finite-EI row, with MoorDyn's VIV columns Cl or Cl dF cF after it
+ IF (ntok == 14) THEN
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%gas, gj_str, t%i_rt, t%i_rn, &
+ t%cdn, t%cdt, t%can, t%cat
+ ELSE IF (ntok == 15) THEN
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%gas, gj_str, t%i_rt, t%i_rn, &
+ t%cdn, t%cdt, t%can, t%cat, t%cl
+ ELSE
+ READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, ei_str, t%gas, gj_str, t%i_rt, t%i_rn, &
+ t%cdn, t%cdt, t%can, t%cat, t%cl, t%viv_df, t%viv_cf
END IF
- READ (line, *, IOSTAT=ios) t%name, t%diam, t%mass, ea_str, ba_str, t%ei, t%gas, gj_str, t%i_rt, t%i_rn, &
- t%cdn, t%cdt, t%can, t%cat
END IF
IF (ios /= 0) THEN
CALL fail(ErrStat, ErrMsg, 'malformed LINE TYPES row'); RETURN
END IF
- IF (ntok == 14) THEN
+ CALL parse_ei_column(ei_str, t, ErrStat, ErrMsg)
+ IF (ErrStat /= 0) RETURN
+ IF (ntok >= 14) THEN
CALL parse_gj_column(gj_str, t, ErrStat, ErrMsg)
IF (ErrStat /= 0) RETURN
END IF
@@ -15724,7 +16432,7 @@ SUBROUTINE append_type(line, types, nt, stock_cols, ErrStat, ErrMsg)
END IF
CALL parse_stiffness_columns(ea_str, ba_str, t, ErrStat, ErrMsg)
IF (ErrStat /= 0) RETURN
- IF (ntok == 11 .OR. ntok == 13) THEN
+ IF (ntok == 11 .OR. ntok == 13 .OR. ntok == 15 .OR. ntok == 17) THEN
CALL check_viv_columns(t, ErrStat, ErrMsg)
IF (ErrStat /= 0) RETURN
END IF
@@ -17034,6 +17742,494 @@ SUBROUTINE append_line_attachment(row, lines, ErrStat, ErrMsg)
CALL MOVE_ALLOC(grown, lines(li)%att)
END SUBROUTINE append_line_attachment
+ SUBROUTINE apply_type_viv(row, types, ErrStat, ErrMsg)
+ !! One VIV row: TypeName ClX [alpha [Chh]] -- the in-line VIV of a line type (Ulveseter et al.
+ !! 2018): the in-line shedding coefficient C_vx >= 0 (0 = off) and the frequency band
+ !! 0 <= alpha < 1 of its phase about twice the cross-flow one (default 0.15); and the
+ !! higher-harmonic coefficient C_hh >= 0 (Ulveseter et al. 2019; default 0), a force of the
+ !! lift's form at the cross-flow plus in-line phase. The in-line phase rate is slaved to the
+ !! cross-flow one, so ClX > 0 needs the type's LINE TYPES lift Cl > 0, and Chh > 0 needs
+ !! ClX > 0. A type takes one row.
+ CHARACTER(*), INTENT(IN) :: row
+ TYPE(DeckLineType), INTENT(INOUT) :: types(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ CHARACTER(DECK_RECLEN) :: tok
+ INTEGER :: it, ntok
+ REAL(wp) :: clx, alpha, chh
+ LOGICAL :: found, ok
+
+ ErrStat = 0; ErrMsg = ''
+ ntok = count_tokens(row)
+ IF (ntok < 2 .OR. ntok > 4) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV rows must be: TypeName ClX [alpha [Chh]]'); RETURN
+ END IF
+ CALL get_token(row, 1, tok, found)
+ it = find_type(types, TRIM(tok))
+ IF (it == 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV row names undefined LINE TYPE "'//TRIM(tok)//'"'); RETURN
+ END IF
+ IF (types(it)%has_viv_row) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV names LINE TYPE "'//TRIM(types(it)%name)//'" twice'); RETURN
+ END IF
+ CALL get_token(row, 2, tok, found)
+ CALL parse_real_token(tok, clx, ok)
+ alpha = CD_VIV_DEFAULT_IL_ALPHA
+ chh = CD_ZERO
+ IF (ok .AND. ntok >= 3) THEN
+ CALL get_token(row, 3, tok, found)
+ CALL parse_real_token(tok, alpha, ok)
+ END IF
+ IF (ok .AND. ntok == 4) THEN
+ CALL get_token(row, 4, tok, found)
+ CALL parse_real_token(tok, chh, ok)
+ END IF
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV ClX, alpha and Chh must be plain numbers'); RETURN
+ END IF
+ IF (.NOT. (IEEE_IS_FINITE(clx) .AND. IEEE_IS_FINITE(alpha) .AND. IEEE_IS_FINITE(chh))) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV ClX, alpha and Chh must be finite'); RETURN
+ END IF
+ IF (clx < CD_ZERO .OR. clx > MAX_COEFFICIENT) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV in-line coefficient ClX must be non-negative (0 = in-line VIV off) and at '// &
+ 'most 1e15'); RETURN
+ END IF
+ IF (.NOT. (alpha >= CD_ZERO .AND. alpha < CD_ONE)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV in-line frequency band alpha must satisfy 0 <= alpha < 1'); RETURN
+ END IF
+ IF (chh < CD_ZERO .OR. chh > MAX_COEFFICIENT) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV higher-harmonic coefficient Chh must be non-negative (0 = off) and at '// &
+ 'most 1e15'); RETURN
+ END IF
+ IF (chh > CD_ZERO .AND. .NOT. (clx > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV higher-harmonic force of LINE TYPE "'//TRIM(types(it)%name)//'" needs its '// &
+ 'in-line VIV (ClX > 0): it runs at the cross-flow plus in-line phase'); RETURN
+ END IF
+ IF (clx > CD_ZERO .AND. .NOT. (types(it)%cl > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV in-line VIV of LINE TYPE "'//TRIM(types(it)%name)//'" needs its '// &
+ 'cross-flow lift (LINE TYPES Cl > 0): the in-line phase runs at twice the cross-flow one'); RETURN
+ END IF
+ types(it)%clx = clx
+ types(it)%il_alpha = alpha
+ types(it)%chh = chh
+ types(it)%has_viv_row = .TRUE.
+ END SUBROUTINE apply_type_viv
+
+ SUBROUTINE apply_type_wake(row, types, ErrStat, ErrMsg)
+ !! One WAKE OSCILLATOR row: TypeName CL0 [St [eps [A]]] -- the wake-oscillator VIV of a line
+ !! type (Facchinetti et al. 2004; the defaults St 0.2, eps 0.3, A 12 are theirs): the reference
+ !! lift coefficient C_L0 >= 0 (0 = off; the lift of a fixed cylinder is C_L0 U^2 rho D/2), the
+ !! Strouhal number St > 0 of the wake frequency 2 pi St U/D, the van der Pol eps > 0 and the
+ !! acceleration coupling A >= 0 (U: the flow of the type's VIV FRAME, the ambient flow without one). The wake oscillator replaces the synchronisation model, so the
+ !! type takes no LINE TYPES lift Cl (and so no in-line VIV, which needs it). A type takes one
+ !! row.
+ CHARACTER(*), INTENT(IN) :: row
+ TYPE(DeckLineType), INTENT(INOUT) :: types(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ CHARACTER(DECK_RECLEN) :: tok
+ INTEGER :: it, ntok, i
+ REAL(wp) :: v(4)
+ LOGICAL :: found, ok
+
+ ErrStat = 0; ErrMsg = ''
+ ntok = count_tokens(row)
+ IF (ntok < 2 .OR. ntok > 5) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR rows must be: TypeName CL0 [St [eps [A]]]'); RETURN
+ END IF
+ CALL get_token(row, 1, tok, found)
+ it = find_type(types, TRIM(tok))
+ IF (it == 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR row names undefined LINE TYPE "'//TRIM(tok)//'"'); RETURN
+ END IF
+ IF (types(it)%has_wake_row) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR names LINE TYPE "'//TRIM(types(it)%name)//'" twice'); RETURN
+ END IF
+ v = [CD_ZERO, CD_VIV_WAKE_DEFAULT_ST, CD_VIV_WAKE_DEFAULT_EPS, CD_VIV_WAKE_DEFAULT_A]
+ ok = .TRUE.
+ DO i = 2, ntok
+ IF (.NOT. ok) EXIT
+ CALL get_token(row, i, tok, found)
+ CALL parse_real_token(tok, v(i - 1), ok)
+ END DO
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR CL0, St, eps and A must be plain numbers'); RETURN
+ END IF
+ IF (.NOT. ALL(IEEE_IS_FINITE(v))) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR CL0, St, eps and A must be finite'); RETURN
+ END IF
+ IF (v(1) < CD_ZERO .OR. v(1) > MAX_COEFFICIENT) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR lift coefficient CL0 must be non-negative (0 = off) and at '// &
+ 'most 1e15'); RETURN
+ END IF
+ IF (.NOT. (v(2) > CD_ZERO .AND. v(2) <= MAX_COEFFICIENT .AND. v(3) > CD_ZERO .AND. &
+ v(3) <= MAX_COEFFICIENT .AND. v(4) >= CD_ZERO .AND. v(4) <= MAX_COEFFICIENT)) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR needs St > 0, eps > 0 and A >= 0, each at most 1e15'); RETURN
+ END IF
+ IF (v(1) > CD_ZERO .AND. types(it)%cl > CD_ZERO) THEN
+ CALL fail(ErrStat, ErrMsg, 'WAKE OSCILLATOR of LINE TYPE "'//TRIM(types(it)%name)//'" replaces its '// &
+ 'synchronisation lift: give the type LINE TYPES Cl 0'); RETURN
+ END IF
+ types(it)%wo_cl0 = v(1)
+ types(it)%wo_st = v(2)
+ types(it)%wo_eps = v(3)
+ types(it)%wo_a = v(4)
+ types(it)%has_wake_row = .TRUE.
+ END SUBROUTINE apply_type_wake
+
+ SUBROUTINE apply_type_viv_amp(row, types, ErrStat, ErrMsg)
+ !! One VIV AMPLITUDE row: TypeName AD Cv [CdAmp] -- a row of a line type's amplitude table, the
+ !! rows of a type in increasing amplitude ratio AD = A/D >= 0, the cross-flow coefficient
+ !! Cv >= 0 that replaces the type's LINE TYPES Cl at that amplitude, and the factor CdAmp > 0
+ !! (default 1) of its normal drag coefficient; the rows of one type have the same columns. The
+ !! type needs the synchronisation lift (LINE TYPES Cl > 0). At most CD_VIV_AMP_MAXP rows a type.
+ CHARACTER(*), INTENT(IN) :: row
+ TYPE(DeckLineType), INTENT(INOUT) :: types(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ CHARACTER(DECK_RECLEN) :: tok
+ INTEGER :: it, ntok, i, n
+ REAL(wp) :: v(3)
+ LOGICAL :: found, ok
+
+ ErrStat = 0; ErrMsg = ''
+ ntok = count_tokens(row)
+ IF (ntok < 3 .OR. ntok > 4) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE rows must be: TypeName AD Cv [CdAmp]'); RETURN
+ END IF
+ CALL get_token(row, 1, tok, found)
+ it = find_type(types, TRIM(tok))
+ IF (it == 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE row names undefined LINE TYPE "'//TRIM(tok)//'"'); RETURN
+ END IF
+ IF (.NOT. (types(it)%cl > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE of LINE TYPE "'//TRIM(types(it)%name)//'" scales its '// &
+ 'synchronisation lift: give the type LINE TYPES Cl > 0'); RETURN
+ END IF
+ IF (types(it)%amp_n > 0 .AND. ntok /= types(it)%amp_cols) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV AMPLITUDE rows of LINE TYPE "'//TRIM(types(it)%name)// &
+ '" must all have the same columns'); RETURN
+ END IF
+ IF (types(it)%amp_n >= CD_VIV_AMP_MAXP) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE gives LINE TYPE "'//TRIM(types(it)%name)//'" more than 32 '// &
+ 'rows'); RETURN
+ END IF
+ v = [CD_ZERO, CD_ZERO, CD_ONE]
+ ok = .TRUE.
+ DO i = 2, ntok
+ IF (.NOT. ok) EXIT
+ CALL get_token(row, i, tok, found)
+ CALL parse_real_token(tok, v(i - 1), ok)
+ END DO
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE AD, Cv and CdAmp must be plain numbers'); RETURN
+ END IF
+ IF (.NOT. ALL(IEEE_IS_FINITE(v))) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE AD, Cv and CdAmp must be finite'); RETURN
+ END IF
+ IF (.NOT. (v(1) >= CD_ZERO .AND. v(1) <= MAX_COEFFICIENT .AND. v(2) >= CD_ZERO .AND. &
+ v(2) <= MAX_COEFFICIENT .AND. v(3) > CD_ZERO .AND. v(3) <= MAX_COEFFICIENT)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV AMPLITUDE needs AD >= 0, Cv >= 0 and CdAmp > 0, each at most 1e15'); RETURN
+ END IF
+ n = types(it)%amp_n
+ IF (n > 0) THEN
+ IF (.NOT. (v(1) > types(it)%amp_tab(1, n))) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV AMPLITUDE rows of LINE TYPE "'//TRIM(types(it)%name)// &
+ '" must increase strictly in AD'); RETURN
+ END IF
+ END IF
+ types(it)%amp_n = n + 1
+ types(it)%amp_cols = ntok
+ types(it)%amp_tab(:, n + 1) = v
+ END SUBROUTINE apply_type_viv_amp
+
+ SUBROUTINE apply_type_viv_damp(row, types, ErrStat, ErrMsg)
+ !! One VIV DAMPING row: TypeName a b [c] -- the cross-flow hydrodynamic damping of a line type,
+ !! C_dy = a + b y0/D (Thorsen et al. 2016, Eq. 1: a = 0.31 and b = 0.89, their fit to the
+ !! still-water decays of Vikestad et al. 2000), which replaces the cross-flow part of the type's
+ !! Morison drag while the in-line part stays. y0 is the amplitude estimate of the type's VIV
+ !! AMPLITUDE table, so the type needs one (and so the synchronisation lift, Cl > 0). c adds a
+ !! Morison-form cross-flow term c Cdn |w| w_y (default 0): (0, 0, 1) amplifies the in-line drag
+ !! alone. a, b, c >= 0, at most 1e15. A type takes one row.
+ CHARACTER(*), INTENT(IN) :: row
+ TYPE(DeckLineType), INTENT(INOUT) :: types(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ CHARACTER(DECK_RECLEN) :: tok
+ INTEGER :: it, n, k
+ REAL(wp) :: v(3)
+ LOGICAL :: found, ok
+
+ ErrStat = 0; ErrMsg = ''
+ n = count_tokens(row)
+ IF (n < 3 .OR. n > 4) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DAMPING rows must be: TypeName a b [c]'); RETURN
+ END IF
+ CALL get_token(row, 1, tok, found)
+ it = find_type(types, TRIM(tok))
+ IF (it == 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DAMPING row names undefined LINE TYPE "'//TRIM(tok)//'"'); RETURN
+ END IF
+ IF (types(it)%cdy_a >= CD_ZERO) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DAMPING names LINE TYPE "'//TRIM(types(it)%name)//'" twice'); RETURN
+ END IF
+ v = CD_ZERO
+ DO k = 2, n
+ CALL get_token(row, k, tok, found)
+ CALL parse_real_token(tok, v(k - 1), ok)
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DAMPING a, b and c must be plain numbers'); RETURN
+ END IF
+ END DO
+ IF (.NOT. (ALL(IEEE_IS_FINITE(v)) .AND. ALL(v >= CD_ZERO) .AND. ALL(v <= MAX_COEFFICIENT))) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DAMPING needs a, b and c >= 0, at most 1e15'); RETURN
+ END IF
+ IF (.NOT. (types(it)%cl > CD_ZERO) .OR. types(it)%amp_n <= 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DAMPING of LINE TYPE "'//TRIM(types(it)%name)//'" takes the amplitude '// &
+ 'estimate of its VIV AMPLITUDE table: give the type Cl > 0 and a VIV AMPLITUDE table'); RETURN
+ END IF
+ types(it)%cdy_a = v(1)
+ types(it)%cdy_b = v(2)
+ types(it)%cdy_c = v(3)
+ END SUBROUTINE apply_type_viv_damp
+
+ SUBROUTINE apply_type_viv_diam(row, types, ErrStat, ErrMsg)
+ !! One VIV DIAMETER row: TypeName Dviv -- the diameter of a line type's VIV model, Dviv > 0 (at
+ !! most 1e15), which the shedding frequency, the lift and in-line forces and the amplitude ratio
+ !! take in place of the type's Diam (which the drag, added mass and buoyancy keep). The type
+ !! needs VIV (LINE TYPES Cl > 0, or a WAKE OSCILLATOR row). A type takes one row.
+ CHARACTER(*), INTENT(IN) :: row
+ TYPE(DeckLineType), INTENT(INOUT) :: types(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ CHARACTER(DECK_RECLEN) :: tok
+ INTEGER :: it
+ REAL(wp) :: v
+ LOGICAL :: found, ok
+
+ ErrStat = 0; ErrMsg = ''
+ IF (count_tokens(row) /= 2) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DIAMETER rows must be: TypeName Dviv'); RETURN
+ END IF
+ CALL get_token(row, 1, tok, found)
+ it = find_type(types, TRIM(tok))
+ IF (it == 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DIAMETER row names undefined LINE TYPE "'//TRIM(tok)//'"'); RETURN
+ END IF
+ IF (types(it)%has_vivd_row) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DIAMETER names LINE TYPE "'//TRIM(types(it)%name)//'" twice'); RETURN
+ END IF
+ CALL get_token(row, 2, tok, found)
+ CALL parse_real_token(tok, v, ok)
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DIAMETER Dviv must be a plain number'); RETURN
+ END IF
+ IF (.NOT. (IEEE_IS_FINITE(v) .AND. v > CD_ZERO .AND. v <= MAX_COEFFICIENT)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DIAMETER needs Dviv > 0, at most 1e15'); RETURN
+ END IF
+ IF (.NOT. (types(it)%cl > CD_ZERO .OR. types(it)%wo_cl0 > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV DIAMETER of LINE TYPE "'//TRIM(types(it)%name)//'" sets the diameter '// &
+ 'of its VIV: give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row'); RETURN
+ END IF
+ types(it)%viv_dv = v
+ types(it)%has_vivd_row = .TRUE.
+ END SUBROUTINE apply_type_viv_diam
+
+ SUBROUTINE apply_type_viv_frame(row, types, ErrStat, ErrMsg)
+ !! 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
+ !! of the phases (the cable's velocity relative to the filtered one) and the ambient-frame
+ !! quantities: the amplitude estimate (and so the VIV AMPLITUDE coefficients) and the axes of
+ !! the VIV DAMPING split; the shedding speed stays the relative normal speed. The type needs
+ !! LINE TYPES Cl > 0 or a WAKE OSCILLATOR row. A type takes one row.
+ CHARACTER(*), INTENT(IN) :: row
+ TYPE(DeckLineType), INTENT(INOUT) :: types(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ CHARACTER(DECK_RECLEN) :: tok
+ INTEGER :: it
+ REAL(wp) :: v
+ LOGICAL :: found, ok, cyc
+
+ ErrStat = 0; ErrMsg = ''
+ 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))
+ IF (it == 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV FRAME row names undefined LINE TYPE "'//TRIM(tok)//'"'); RETURN
+ END IF
+ IF (types(it)%has_vivf_row) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV FRAME names LINE TYPE "'//TRIM(types(it)%name)//'" twice'); RETURN
+ END IF
+ CALL get_token(row, 2, tok, found)
+ CALL parse_real_token(tok, v, ok)
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV FRAME Tf must be a plain number'); RETURN
+ END IF
+ IF (.NOT. (IEEE_IS_FINITE(v) .AND. v >= CD_ZERO .AND. v <= MAX_COEFFICIENT)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV FRAME filter time Tf must be >= 0 (0 = the ambient flow), at most 1e15')
+ RETURN
+ END IF
+ IF (.NOT. (types(it)%wo_cl0 > CD_ZERO .OR. types(it)%cl > CD_ZERO)) THEN
+ 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
+ !! process of standard deviation sigma (0 <= sigma <= 1e3; 0 keeps it constant), the sum of Nf
+ !! (an integer, 1 to CD_VIV_STO_MAXF, default CD_VIV_STO_DEFAULT_NF) sinusoids of a flat spectrum
+ !! up to c times cF (0 < c <= 1) in non-dimensional frequency, each advancing at its frequency
+ !! times U/D as the shedding phase does, from start phases the integer seed (0 to 2147483646,
+ !! default 0) fixes per node. The type needs LINE TYPES Cl > 0 and no WAKE OSCILLATOR row. A type
+ !! takes one row.
+ CHARACTER(*), INTENT(IN) :: row
+ TYPE(DeckLineType), INTENT(INOUT) :: types(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ CHARACTER(DECK_RECLEN) :: tok
+ INTEGER :: it, n, k
+ REAL(wp) :: v(4)
+ LOGICAL :: found, ok
+
+ ErrStat = 0; ErrMsg = ''
+ n = count_tokens(row)
+ IF (n < 3 .OR. n > 5) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC rows must be: TypeName sigma c [Nf [seed]]'); RETURN
+ END IF
+ CALL get_token(row, 1, tok, found)
+ it = find_type(types, TRIM(tok))
+ IF (it == 0) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC row names undefined LINE TYPE "'//TRIM(tok)//'"'); RETURN
+ END IF
+ IF (types(it)%has_vivs_row) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC names LINE TYPE "'//TRIM(types(it)%name)//'" twice'); RETURN
+ END IF
+ v = [CD_ZERO, CD_ZERO, REAL(CD_VIV_STO_DEFAULT_NF, wp), CD_ZERO]
+ DO k = 2, n
+ CALL get_token(row, k, tok, found)
+ CALL parse_real_token(tok, v(k - 1), ok)
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC sigma, c, Nf and seed must be plain numbers'); RETURN
+ END IF
+ END DO
+ IF (.NOT. (ALL(IEEE_IS_FINITE(v)) .AND. v(1) >= CD_ZERO .AND. v(1) <= 1.0e3_wp .AND. v(2) > CD_ZERO .AND. &
+ v(2) <= CD_ONE)) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC needs 0 <= sigma <= 1e3 and 0 < c <= 1'); RETURN
+ END IF
+ IF (.NOT. (v(3) >= CD_ONE .AND. v(3) <= REAL(CD_VIV_STO_MAXF, wp) .AND. &
+ .NOT. (ABS(v(3) - AINT(v(3))) > CD_ZERO))) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC Nf must be an integer from 1 to '// &
+ TRIM(int_to_str(CD_VIV_STO_MAXF))); RETURN
+ END IF
+ IF (.NOT. (v(4) >= CD_ZERO .AND. v(4) <= 2147483646.0_wp .AND. &
+ .NOT. (ABS(v(4) - AINT(v(4))) > CD_ZERO))) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC seed must be an integer from 0 to 2147483646'); RETURN
+ END IF
+ IF (.NOT. (types(it)%cl > CD_ZERO) .OR. types(it)%wo_cl0 > CD_ZERO) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV STOCHASTIC of LINE TYPE "'//TRIM(types(it)%name)//'" varies the band '// &
+ 'centre of its synchronisation model: give the type LINE TYPES Cl > 0 and no WAKE OSCILLATOR row')
+ RETURN
+ END IF
+ types(it)%sto_sigma = v(1)
+ types(it)%sto_c = v(2)
+ types(it)%sto_nf = NINT(v(3))
+ types(it)%sto_seed = NINT(v(4))
+ types(it)%has_vivs_row = .TRUE.
+ END SUBROUTINE apply_type_viv_sto
+
+ SUBROUTINE finite_viv_sto(ln, sections, types, sto)
+ !! The VIV STOCHASTIC (sigma, c, Nf, seed) of every element's line type (sigma 0 where the type has
+ !! none), in the element order of finite_hydro_arrays (the deck order reversed); the seed of a
+ !! line is the type's plus 7919 times the line ID (modulo 2147483647), so two lines of one type
+ !! take different realisations.
+ TYPE(DeckLine), INTENT(IN) :: ln
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ REAL(wp), INTENT(OUT) :: sto(:, :)
+ INTEGER :: i, j, e
+ e = 0
+ DO i = 1, SIZE(sections)
+ IF (sections(i)%line_id /= ln%id) CYCLE
+ DO j = 1, sections(i)%nsegs
+ e = e + 1
+ sto(:, e) = viv_sto_row(types(sections(i)%ltype), ln%id)
+ END DO
+ END DO
+ sto = sto(:, SIZE(sto, 2):1:-1)
+ END SUBROUTINE finite_viv_sto
+
+ PURE FUNCTION viv_sto_row(t, line_id) RESULT(r)
+ !! A line type's VIV STOCHASTIC values (sigma, c, Nf, seed) on line line_id (finite_viv_sto).
+ TYPE(DeckLineType), INTENT(IN) :: t
+ INTEGER, INTENT(IN) :: line_id
+ REAL(wp) :: r(4)
+ INTEGER(INT64) :: sd
+ sd = MOD(INT(t%sto_seed, INT64) + 7919_INT64*INT(ABS(line_id), INT64), 2147483647_INT64)
+ r = [t%sto_sigma, t%sto_c, REAL(t%sto_nf, wp), REAL(sd, wp)]
+ END FUNCTION viv_sto_row
+
SUBROUTINE append_line_stiffener(row, lines, ErrStat, ErrMsg)
!! One STIFFENERS row: LineID End Length RootOD TipOD InnerD E Density -- a conical segment of
!! the bend stiffener sleeving End A or End B of a finite-EI line. The rows of one line end
@@ -17708,6 +18904,8 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg)
opts%has_max_strain = ErrStat == 0
CASE ('vivrmswindow', 'viv_rms_window')
CALL rd(val, opts%viv_rms_window, ErrStat, ErrMsg)
+ CASE ('cdoutdt', 'cd_out_dt')
+ CALL rd(val, opts%cd_out_dt, ErrStat, ErrMsg)
CASE ('vivphaseseed', 'viv_phase_seed')
SELECT CASE (TRIM(to_lower(val)))
CASE ('spread')
@@ -18214,7 +19412,8 @@ SUBROUTINE check_option_row_value(kw, val, ErrStat, ErrMsg)
CASE ('dtm', 'dt')
rule = 'time step'
CASE ('tmax', 'tensile_strain_tolerance', 'tensilestraintolerance', 'ramptime', 'ramp_time', 'tramp', &
- 'maxstrain', 'max_strain', 'rangestart', 'range_start', 'vivrmswindow', 'viv_rms_window')
+ 'maxstrain', 'max_strain', 'rangestart', 'range_start', 'vivrmswindow', 'viv_rms_window', 'cdoutdt', &
+ 'cd_out_dt')
rule = 'non-negative'
CASE ('frictionmu', 'mu', 'frictioncoefficient')
IF (to_lower(TRIM(val)) == 'none') RETURN
@@ -18359,7 +19558,7 @@ FUNCTION channel_identity_key(ch) RESULT(key)
IF (a > 0 .AND. b > 0) key = 'point:'//TRIM(int_to_str(a))//':'//TRIM(int_to_str(b))
ELSE IF (starts_with(lo, 'ten') .OR. starts_with(lo, 'curv') .OR. starts_with(lo, 'bendmom') .OR. &
starts_with(lo, 'stfmom') .OR. starts_with(lo, 'l') .OR. starts_with(lo, 'torq') .OR. &
- starts_with(lo, 'twist')) THEN
+ starts_with(lo, 'twist') .OR. is_load_power_channel(lo) .OR. starts_with(lo, 'vivamp')) THEN
CALL parse_line_node_channel(ch, a, b, c, d)
IF (a > 0 .AND. b > 0 .AND. c > 0) key = 'node:'//TRIM(int_to_str(a))//':'//TRIM(int_to_str(b))// &
':'//TRIM(int_to_str(c))//':'//TRIM(int_to_str(d))
@@ -18528,6 +19727,139 @@ LOGICAL FUNCTION finite_ei_by_name(line_id) RESULT(fin)
END FUNCTION finite_ei_by_name
END SUBROUTINE normalize_stock_endpoint_order
+ SUBROUTINE promote_free_cable_ends(points, lines, sections, types, opts, n_bodies, n_rods, caller_driven)
+ !! A Free point that ends exactly one finite-EI line, as its End B, from a Coupled or Vessel
+ !! End A, on a standalone deck whose lines are all finite-EI and that has no other dynamic
+ !! object (BODIES, RODS, other Free/Connect points), becomes the line's free End B: the line's
+ !! End B position is free in the static equilibrium and the dynamics, and the point's Mass,
+ !! Volume, CdA and CA ride on it as an end attachment (ATTACHMENTS at the line's full arc
+ !! length). The line must be pinned in bending at both ends with at most one end restrained in
+ !! torsion, which is then not solved (a free end carries no moment or torque), and the end must
+ !! hang (the point and the line net heavy). The point's type reads 'fixed' from here
+ !! on, so the builder seeds the static solve with the end held, then releases it
+ !! (build_one_hermite_cable): the seed is on the chord from End A towards the deck position, at
+ !! the line's length stretched by its hanging weight (the taut straight line; a vertical span of
+ !! exactly the line's length has no catenary seed). A deck with any Free point that is not such
+ !! an end is left as it is, to the routes that take Free points or refuse them by name.
+ TYPE(DeckPoint), INTENT(INOUT) :: points(:)
+ TYPE(DeckLine), INTENT(INOUT) :: lines(:)
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ TYPE(DeckOptions), INTENT(IN) :: opts
+ INTEGER, INTENT(IN) :: n_bodies, n_rods
+ LOGICAL, INTENT(IN) :: caller_driven
+ INTEGER :: ip, j, nref, jl, ia, k, it
+ INTEGER :: cand_line(SIZE(points))
+ REAL(wp) :: seed(3, SIZE(points)), arc, wline, wpt, ea_min, chord(3), cl
+ REAL(wp), ALLOCATABLE :: att_new(:, :)
+ IF (caller_driven .OR. n_bodies > 0 .OR. n_rods > 0 .OR. SIZE(lines) < 1) RETURN
+ ! (a bathymetry deck keeps its behaviour: the seed is placed against the flat seabed only)
+ IF (opts%has_bathymetry_file) RETURN
+ DO j = 1, SIZE(lines)
+ IF (.NOT. finite_ei_line(lines(j)%id)) RETURN
+ END DO
+ cand_line = 0
+ DO ip = 1, SIZE(points)
+ IF (TRIM(points(ip)%ptype) == 'connect') RETURN
+ IF (TRIM(points(ip)%ptype) /= 'free') CYCLE
+ nref = 0
+ jl = 0
+ DO j = 1, SIZE(lines)
+ IF (lines(j)%nodeA == points(ip)%id .OR. lines(j)%nodeB == points(ip)%id) THEN
+ nref = nref + 1
+ jl = j
+ END IF
+ END DO
+ IF (nref /= 1) RETURN
+ IF (lines(jl)%nodeB /= points(ip)%id) RETURN
+ ia = find_point(points, lines(jl)%nodeA)
+ IF (ia < 1) RETURN
+ ! End A must be the driven (or still) fairlead of a deck without dynamic points
+ IF (TRIM(points(ia)%ptype) /= 'coupled' .AND. TRIM(points(ia)%ptype) /= 'vessel') RETURN
+ ! pinned in bending at both ends; a torsion restraint at one end is not solved (a free end
+ ! carries no torque; resolve_one_end_torsion notes it), at both ends the deck is left as it is
+ IF (ANY(lines(jl)%endconn_mode /= CD_ENDCONN_PINNED) .OR. COUNT(lines(jl)%tors_mode /= TORS_FREE) > 1) RETURN
+ ! the hanging weight (line and point, in water) and the softest section
+ wline = CD_ZERO
+ ea_min = HUGE(CD_ONE)
+ arc = CD_ZERO
+ DO k = 1, SIZE(sections)
+ IF (sections(k)%line_id /= lines(jl)%id) CYCLE
+ it = find_type(types, sections(k)%ltype_name)
+ IF (it < 1) RETURN
+ wline = wline + (types(it)%mass - opts%rhoW*QUARTER_PI*types(it)%diam**2)*opts%g*sections(k)%length
+ IF (types(it)%ea > CD_ZERO) ea_min = MIN(ea_min, types(it)%ea)
+ arc = arc + sections(k)%length
+ END DO
+ wpt = (points(ip)%mass - opts%rhoW*points(ip)%vol)*opts%g
+ IF (.NOT. (wline + wpt > CD_ZERO .AND. wpt >= CD_ZERO) .OR. .NOT. ea_min < HUGE(CD_ONE)) RETURN
+ chord = points(ip)%pos - points(ia)%pos
+ cl = NORM2(chord)
+ IF (cl > CD_ZERO) THEN
+ chord = chord/cl
+ ELSE
+ chord = [CD_ZERO, CD_ZERO, -CD_ONE]
+ END IF
+ seed(:, ip) = points(ia)%pos + chord*arc*(CD_ONE + (wline + wpt)/ea_min + 1.0e-9_wp)
+ ! a seed below a flat seabed (a line longer than the depth below End A) goes onto the seabed at
+ ! the same stretched length, out along the deck chord's horizontal direction (+x without one),
+ ! so the held seed is still the taut straight line; the release lays the end on the seabed
+ IF (opts%has_wtrdpth .AND. .NOT. opts%has_bathymetry_file) THEN
+ IF (seed(3, ip) < -opts%wtrdpth) THEN
+ BLOCK
+ REAL(wp) :: dlen, dz, hz(2), hn
+ dlen = NORM2(seed(:, ip) - points(ia)%pos)
+ dz = -opts%wtrdpth - points(ia)%pos(3)
+ hz = points(ip)%pos(1:2) - points(ia)%pos(1:2)
+ hn = NORM2(hz)
+ IF (hn > CD_ZERO) THEN
+ hz = hz/hn
+ ELSE
+ hz = [CD_ONE, CD_ZERO]
+ END IF
+ seed(1:2, ip) = points(ia)%pos(1:2) + hz*SQRT(MAX(dlen**2 - dz**2, CD_ZERO))
+ seed(3, ip) = -opts%wtrdpth
+ END BLOCK
+ END IF
+ END IF
+ cand_line(ip) = jl
+ END DO
+ ! every Free point of the deck is a free cable end: promote them
+ DO ip = 1, SIZE(points)
+ jl = cand_line(ip)
+ IF (jl < 1) CYCLE
+ points(ip)%pos = seed(:, ip)
+ points(ip)%free_cable_end = .TRUE.
+ points(ip)%ptype = 'fixed'
+ lines(jl)%free_end_b = .TRUE.
+ IF (points(ip)%mass > CD_ZERO .OR. points(ip)%vol > CD_ZERO .OR. points(ip)%cda > CD_ZERO) THEN
+ arc = SUM(sections%length, MASK=sections%line_id == lines(jl)%id)
+ IF (ALLOCATED(lines(jl)%att)) THEN
+ ALLOCATE (att_new(6, SIZE(lines(jl)%att, 2) + 1))
+ att_new(:, 1:SIZE(lines(jl)%att, 2)) = lines(jl)%att
+ ELSE
+ ALLOCATE (att_new(6, 1))
+ END IF
+ ! CdAx -1: the internal marker of a point's isotropic drag rho CdA |w| w / 2 (a deck
+ ! ATTACHMENTS row cannot give a negative CdAx)
+ att_new(:, SIZE(att_new, 2)) = [arc, points(ip)%mass, points(ip)%vol, points(ip)%cda, points(ip)%ca, -CD_ONE]
+ CALL MOVE_ALLOC(att_new, lines(jl)%att)
+ END IF
+ END DO
+ CONTAINS
+ LOGICAL FUNCTION finite_ei_line(line_id) RESULT(fin)
+ INTEGER, INTENT(IN) :: line_id
+ INTEGER :: kk, itt
+ fin = .FALSE.
+ DO kk = 1, SIZE(sections)
+ IF (sections(kk)%line_id /= line_id) CYCLE
+ itt = find_type(types, sections(kk)%ltype_name)
+ IF (itt < 1) CYCLE
+ IF (types(itt)%ei > CD_ZERO) fin = .TRUE.
+ END DO
+ END FUNCTION finite_ei_line
+ END SUBROUTINE promote_free_cable_ends
+
SUBROUTINE reverse_line_sections(sections, line_id)
!! Reverse the in-deck order of the SECTIONS rows belonging to one line (their
!! positions in the global array are kept; only the payloads swap).
@@ -18572,6 +19904,8 @@ SUBROUTINE check_fixed_point_above_seabed(pt, z_floor, what, ErrStat, ErrMsg, z_
REAL(wp) :: tol
ErrStat = 0; ErrMsg = ''
+ ! a free cable end's position is a static seed, not an anchor (promote_free_cable_ends)
+ IF (pt%free_cable_end) RETURN
tol = CD_Static_Anchor_Seabed_Tolerance(z_floor)
! (a relative round-off margin keeps an anchor written exactly one tolerance off inside)
IF (ABS(pt%pos(3) - z_floor) <= tol*(CD_ONE + 1.0e-9_wp)) THEN
@@ -19264,9 +20598,11 @@ SUBROUTINE finalize_checks(types, bodies, rod_types, rods, points, lines, sectio
CASE ('fixed', 'coupled', 'vessel')
! Mass/Vol/CdA/Ca (clump weight, buoyancy, drag area, added mass) apply only to
! Connect/Free points; non-zero values on a held point would be silently ignored,
- ! so fail closed rather than solve as if they were zero.
- IF (ABS(points(i)%mass) > CD_ZERO .OR. ABS(points(i)%vol) > CD_ZERO .OR. &
- ABS(points(i)%cda) > CD_ZERO .OR. ABS(points(i)%ca) > CD_ZERO) THEN
+ ! so fail closed rather than solve as if they were zero. (A free cable end keeps its Free
+ ! point's columns: they act as its end attachment, promote_free_cable_ends.)
+ IF ((ABS(points(i)%mass) > CD_ZERO .OR. ABS(points(i)%vol) > CD_ZERO .OR. &
+ ABS(points(i)%cda) > CD_ZERO .OR. ABS(points(i)%ca) > CD_ZERO) .AND. &
+ .NOT. points(i)%free_cable_end) THEN
CALL fail(ErrStat, ErrMsg, 'POINT '//'(Fixed/Coupled/Vessel) must not carry '// &
'Mass/Vol/CdA/Ca load columns (those apply to Connect/Free points)'); RETURN
END IF
@@ -22764,6 +24100,8 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod
TYPE(ModelOutputWorkspace) :: output_work
TYPE(DriverProgress) :: progress
TYPE(CD_RangeSet) :: mb_ranges
+ ! the cables' line-wide values one output row of channels shares (reset per row)
+ TYPE(CD_ChannelRow), ALLOCATABLE :: mb_rows(:)
converged = .FALSE.
ErrStat = CD_DECKDRV_OK
@@ -23378,6 +24716,14 @@ SUBROUTINE mb_outputs(time)
CALL CD_Deck_Range_Sample_Aggregate(mb_ranges, mb%has_sys, mb%system, mb%cables, mb%line_is_cable, &
mb%line_obj_index, time, ErrStat, ErrMsg)
IF (ErrStat /= CD_DECKDRV_OK) RETURN
+ IF (.NOT. ALLOCATED(mb_rows)) THEN
+ IF (ALLOCATED(mb%cables)) THEN
+ ALLOCATE (mb_rows(SIZE(mb%cables)))
+ ELSE
+ ALLOCATE (mb_rows(0))
+ END IF
+ END IF
+ CALL CD_Channel_Row_Reset(mb_rows)
DO j = 1, SIZE(channels)
IF (is_object_channel(to_lower(channels(j)))) THEN
CALL mb_object_channel(mb, points, opts, time, channels(j), vals(j), found, ErrStat, ErrMsg, bathymetry)
@@ -23389,7 +24735,7 @@ SUBROUTINE mb_outputs(time)
CALL mb_point_force(mb, channels(j), vals(j), ErrStat, ErrMsg)
ELSE
CALL CD_Eval_Aggregate_Channel(channels(j), mb%has_sys, mb%system, mb%cables, mb%line_is_cable, &
- mb%line_obj_index, vals(j), ErrStat, ErrMsg, ranges=mb_ranges)
+ mb%line_obj_index, vals(j), ErrStat, ErrMsg, ranges=mb_ranges, rows=mb_rows)
END IF
IF (ErrStat /= CD_DECKDRV_OK) RETURN
IF (.NOT. IEEE_IS_FINITE(vals(j))) THEN
@@ -33006,7 +34352,7 @@ SUBROUTINE hermite_cable_fluid(cable, n, xyz, fv, fa, wl)
INTEGER, INTENT(IN) :: n
REAL(wp), INTENT(OUT) :: xyz(3, n), fv(3, n), fa(3, n), wl(n)
INTEGER :: j, es
- REAL(wp) :: eta, wv(3), wa(3)
+ REAL(wp) :: eta, eta_s, wv(3), wa(3), zs
CHARACTER(1024) :: em
CHARACTER(200) :: em_k ! a per-node current or wave kinematics message (at most 160 characters)
CALL CD_HFMF_GetNodePositions(cable, xyz, es, em)
@@ -33026,6 +34372,17 @@ SUBROUTINE hermite_cable_fluid(cable, n, xyz, fv, fa, wl)
IF (es /= CD_HYDRO_OK) THEN
CALL hermite_fluid_fail('wave kinematics', em_k); RETURN
END IF
+ IF (xyz(3, j) > eta) THEN
+ ! a node above the instantaneous surface takes the field at the surface: the parts of
+ ! the section (an attachment's sphere, a Gauss point's band) still wet there move with
+ ! it (the internal waves of a cable do the same, CD_HermiteCable_Drag_Element); the
+ ! kinematics above the surface are zero
+ zs = eta
+ CALL deck_wave_kinematics(opts, xyz(1, j), xyz(2, j), zs, time, eta_s, wv, wa, es, em_k)
+ IF (es /= CD_HYDRO_OK) THEN
+ CALL hermite_fluid_fail('wave kinematics', em_k); RETURN
+ END IF
+ END IF
fv(:, j) = fv(:, j) + wv; fa(:, j) = wa; wl(j) = eta
END IF
END DO
@@ -33057,6 +34414,9 @@ SUBROUTINE write_hermite_model_row(unit, time, channels, lines, points, cables,
REAL(wp) :: val, f(3), fl(3)
CHARACTER(NAMELEN) :: lo
CHARACTER(1024) :: em
+ ! the cables' line-wide values at this row's state (load powers, twists, torques, ...), shared by
+ ! their channels of the row
+ TYPE(CD_ChannelRow) :: powers(SIZE(cables))
ErrStat = CD_DECKDRV_OK; ErrMsg = ''
IF (PRESENT(ranges)) THEN
DO li = 1, SIZE(lines)
@@ -33111,6 +34471,22 @@ SUBROUTINE write_hermite_model_row(unit, time, channels, lines, points, cables,
CALL fail(ErrStat, ErrMsg, 'Hermite motion OUTPUT is missing its point'); RETURN
END IF
val = motion%q(comp, mi, motion_time_index)
+ ELSE IF (points(pp)%free_cable_end) THEN
+ ! a free cable end (promote_free_cable_ends): the End B node of its line
+ BLOCK
+ INTEGER :: lf
+ CHARACTER(NAMELEN) :: chf
+ CHARACTER(3), PARAMETER :: AXES = 'xyz'
+ DO lf = 1, SIZE(lines)
+ IF (lines(lf)%free_end_b .AND. lines(lf)%nodeB == pidx) EXIT
+ END DO
+ IF (lf > SIZE(lines)) THEN
+ CALL fail(ErrStat, ErrMsg, 'Hermite Point OUTPUT: free cable end without its line'); RETURN
+ END IF
+ WRITE (chf, '(A,I0,A,I0,A)') 'L', lines(lf)%id, 'N', cables(lf)%line%nn, 'p'//AXES(comp:comp)
+ CALL eval_cable_channel(cables(lf), chf, val, ErrStat, ErrMsg, mesh_node=.TRUE.)
+ IF (ErrStat /= CD_DECKDRV_OK) RETURN
+ END BLOCK
ELSE
val = points(pp)%pos(comp)
END IF
@@ -33127,7 +34503,7 @@ SUBROUTINE write_hermite_model_row(unit, time, channels, lines, points, cables,
CALL parse_line_node_channel(channels(i), line_id, pidx, pp, comp)
END IF
li = find_line(lines, line_id)
- CALL eval_cable_channel(cables(li), channels(i), val, ErrStat, ErrMsg)
+ CALL eval_cable_channel(cables(li), channels(i), val, ErrStat, ErrMsg, power=powers(li))
IF (ErrStat /= CD_DECKDRV_OK) RETURN
END IF
IF (.NOT. IEEE_IS_FINITE(val)) THEN
@@ -34480,7 +35856,7 @@ SUBROUTINE write_planned_row(unit, time, channels, lines, points, work, label, E
INTEGER, PARAMETER :: CH_LEGACY = 0, CH_FAIRTEN = 1, CH_ANCHTEN = 2, CH_ANGLE = 3, CH_NODE_TEN = 4, &
CH_NODE_STATE = 5, CH_POINT_MOTION = 6, CH_POINT_FIXED = 7, CH_POINT_LINE = 8, &
- CH_SYS_POINT = 9, CH_TDP = 10
+ CH_SYS_POINT = 9, CH_TDP = 10, CH_LOAD_POWER = 11
INTEGER :: i, k, n, li, off, nd, ne, nnode, stride, es
LOGICAL :: has_motion, ok
REAL(wp) :: val, q_point(3), v_point(3), a_point(3)
@@ -34558,6 +35934,22 @@ SUBROUTINE write_planned_row(unit, time, channels, lines, points, work, label, E
val = points(work%ch_aux(i))%pos(work%ch_comp(i))
CASE (CH_TDP)
val = work%rset%lines(li)%tdp(work%ch_comp(i))
+ CASE (CH_LOAD_POWER)
+ CALL fetch_power(li, ok)
+ IF (.NOT. ok) THEN
+ CALL legacy_value(i, val)
+ ELSE
+ off = work%lp_off(li)
+ nnode = work%line_ndof(li)/stride
+ IF (PRESENT(models)) THEN
+ val = load_power_value(work%ch_aux(i), work%ch_node(i), work%line_pv(off + 1:off + nnode), &
+ work%line_pd(off + 1:off + nnode), work%line_pm(off + 1:off + nnode), models(li)%l0)
+ ELSE
+ val = load_power_value(work%ch_aux(i), work%ch_node(i), work%line_pv(off + 1:off + nnode), &
+ work%line_pd(off + 1:off + nnode), work%line_pm(off + 1:off + nnode), &
+ system%lines(li)%l0)
+ END IF
+ END IF
CASE (CH_SYS_POINT)
CALL CD_Get_System_Point_State(system, work%ch_aux(i), q_point, v_point, a_point, es, em)
IF (es /= CD_SYSTEM_OK) THEN
@@ -34654,6 +36046,28 @@ SUBROUTINE fetch_state(il, fetched)
IF (fetched) work%state_row(il) = work%row
END SUBROUTINE fetch_state
+ SUBROUTINE fetch_power(il, fetched)
+ !! Evaluate line `il`'s node load powers into the row cache once per row.
+ INTEGER, INTENT(IN) :: il
+ LOGICAL, INTENT(OUT) :: fetched
+ INTEGER :: o, m, es
+ CHARACTER(1024) :: msg
+ fetched = work%lp_row(il) == work%row
+ IF (fetched) RETURN
+ o = work%lp_off(il)
+ m = work%line_ndof(il)/stride
+ IF (PRESENT(models)) THEN
+ CALL CD_Get_Model_Load_Power(models(il), work%line_pv(o + 1:o + m), work%line_pd(o + 1:o + m), &
+ work%line_pm(o + 1:o + m), es, msg)
+ fetched = es == CD_MODEL_OK
+ ELSE
+ CALL CD_Get_System_Line_Load_Power(system, il, work%line_pv(o + 1:o + m), work%line_pd(o + 1:o + m), &
+ work%line_pm(o + 1:o + m), es, msg)
+ fetched = es == CD_SYSTEM_OK
+ END IF
+ IF (fetched) work%lp_row(il) = work%row
+ END SUBROUTINE fetch_power
+
SUBROUTINE end_tension_override(il, inode, nel, v)
!! EI=0 model/system lines: an end node reports the force the line exerts on its end
!! point (end element tension + the end node's lumped loads) instead of the element
@@ -34737,6 +36151,8 @@ SUBROUTINE build_plan()
IF (ALLOCATED(work%line_ndof)) DEALLOCATE (work%line_ndof, work%line_ne, work%state_off, work%ten_off, &
work%state_row, work%ten_row)
IF (ALLOCATED(work%line_q)) DEALLOCATE (work%line_q, work%line_v, work%line_a, work%line_ten)
+ IF (ALLOCATED(work%lp_off)) DEALLOCATE (work%lp_off, work%lp_row)
+ IF (ALLOCATED(work%line_pv)) DEALLOCATE (work%line_pv, work%line_pd, work%line_pm)
ALLOCATE (work%ch_kind(n), work%ch_line(n), work%ch_node(n), work%ch_comp(n), work%ch_aux(n), work%ch_val(n))
ALLOCATE (work%line_ndof(nl), work%line_ne(nl), work%state_off(nl + 1), work%ten_off(nl + 1), &
work%state_row(nl), work%ten_row(nl))
@@ -34751,6 +36167,8 @@ SUBROUTINE build_plan()
work%state_row = 0
work%ten_row = 0
work%row = 0
+ ALLOCATE (work%lp_off(nl + 1), work%lp_row(nl))
+ work%lp_row = 0
DO j = 1, n
lo = to_lower(channels(j))
@@ -34818,12 +36236,19 @@ SUBROUTINE build_plan()
END IF
ELSE
CALL parse_line_node_channel(channels(j), il, node, kind, comp)
+ ! from the line model, channel-at-a-time (CH_LEGACY)
+ IF (kind == 21) CYCLE
il = find_line(lines, il)
IF (il < 1) CYCLE
CALL line_sizes(il, sized, tension_sized)
IF (.NOT. sized) CYCLE
IF (node < 1 .OR. node > work%line_ndof(il)/stride) CYCLE
- IF (kind == 3) THEN
+ IF (is_load_power_kind(kind)) THEN
+ ! the line's node load powers, evaluated once per row for all its power channels
+ work%ch_kind(j) = CH_LOAD_POWER
+ work%ch_node(j) = deck_to_internal_node(node, work%line_ndof(il)/stride - 1)
+ work%ch_aux(j) = kind
+ ELSE IF (kind == 3) THEN
IF (.NOT. tension_sized) CYCLE
work%ch_kind(j) = CH_NODE_TEN
work%ch_node(j) = deck_to_internal_node(node, work%line_ne(il))
@@ -34839,12 +36264,16 @@ SUBROUTINE build_plan()
work%state_off(1) = 0
work%ten_off(1) = 0
+ work%lp_off(1) = 0
DO il = 1, nl
work%state_off(il + 1) = work%state_off(il) + work%line_ndof(il)
work%ten_off(il + 1) = work%ten_off(il) + MAX(0, work%line_ne(il))
+ work%lp_off(il + 1) = work%lp_off(il) + work%line_ndof(il)/stride
END DO
ALLOCATE (work%line_q(work%state_off(nl + 1)), work%line_v(work%state_off(nl + 1)), &
work%line_a(work%state_off(nl + 1)), work%line_ten(work%ten_off(nl + 1)))
+ ALLOCATE (work%line_pv(work%lp_off(nl + 1)), work%line_pd(work%lp_off(nl + 1)), &
+ work%line_pm(work%lp_off(nl + 1)))
work%plan_ready = .TRUE.
work%plan_motion = has_motion
END SUBROUTINE build_plan
@@ -35071,6 +36500,32 @@ SUBROUTINE system_channel_value(ch, lines, points, system, work, val, ErrStat, E
RETURN
END IF
inode = deck_to_internal_node(node, nnode - 1)
+ IF (is_load_power_kind(kind)) THEN
+ BLOCK
+ REAL(wp) :: pv(nnode), pd(nnode), pm(nnode)
+ CALL CD_Get_System_Line_Load_Power(system, li, pv, pd, pm, es, em)
+ IF (es /= CD_SYSTEM_OK) THEN
+ ErrStat = CD_DECKDRV_SOLVEFAIL
+ ErrMsg = 'CableDyn_DeckDriver: system line load power recovery failed: '//TRIM(em)
+ RETURN
+ END IF
+ val = load_power_value(kind, inode, pv, pd, pm, system%lines(li)%l0)
+ END BLOCK
+ RETURN
+ END IF
+ IF (kind == 21) THEN
+ BLOCK
+ REAL(wp) :: amp(nnode)
+ CALL CD_Get_Model_VIV_Amplitude(system%lines(li), amp, es, em)
+ IF (es /= CD_MODEL_OK) THEN
+ ErrStat = CD_DECKDRV_SOLVEFAIL
+ ErrMsg = 'CableDyn_DeckDriver: system line VIV amplitude recovery failed: '//TRIM(em)
+ RETURN
+ END IF
+ val = amp(inode)
+ END BLOCK
+ RETURN
+ END IF
IF (kind == 3) THEN
CALL ensure_model_output_workspace(work, 0, nnode - 1)
CALL CD_Get_System_Line_Tension(system, li, work%tension(1:nnode - 1), es, em)
@@ -35213,6 +36668,32 @@ SUBROUTINE model_channel_value(ch, lines, points, models, work, val, ErrStat, Er
RETURN
END IF
inode = deck_to_internal_node(node, nnode - 1)
+ IF (is_load_power_kind(kind)) THEN
+ BLOCK
+ REAL(wp) :: pv(nnode), pd(nnode), pm(nnode)
+ CALL CD_Get_Model_Load_Power(models(li), pv, pd, pm, es, em)
+ IF (es /= CD_MODEL_OK) THEN
+ ErrStat = CD_DECKDRV_SOLVEFAIL
+ ErrMsg = 'CableDyn_DeckDriver: dynamic line load power recovery failed: '//TRIM(em)
+ RETURN
+ END IF
+ val = load_power_value(kind, inode, pv, pd, pm, models(li)%l0)
+ END BLOCK
+ RETURN
+ END IF
+ IF (kind == 21) THEN
+ BLOCK
+ REAL(wp) :: amp(nnode)
+ CALL CD_Get_Model_VIV_Amplitude(models(li), amp, es, em)
+ IF (es /= CD_MODEL_OK) THEN
+ ErrStat = CD_DECKDRV_SOLVEFAIL
+ ErrMsg = 'CableDyn_DeckDriver: dynamic line VIV amplitude recovery failed: '//TRIM(em)
+ RETURN
+ END IF
+ val = amp(inode)
+ END BLOCK
+ RETURN
+ END IF
IF (kind == 3) THEN
CALL ensure_model_output_workspace(work, 0, nnode - 1)
CALL CD_Get_Model_Tension(models(li), work%tension(1:nnode - 1), es, em)
@@ -36655,6 +38136,42 @@ SUBROUTINE check_channel(ch, lines, points, sections, ErrStat, ErrMsg, bodies, r
CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": line '//TRIM(int_to_str(line_id))//' is not '// &
'torsionally restrained (END CONNECTIONS TorsStiffness), so it carries no torque'); RETURN
END IF
+ ELSE IF (starts_with(lo, 'vivamp')) THEN
+ CALL parse_line_node_channel(ch, line_id, node, kind, comp)
+ li = find_line(lines, line_id)
+ IF (li /= 0 .AND. node == 0 .AND. names_node_zero(lo)) THEN
+ CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": node numbers start at 1 = End A (MoorDyn '// &
+ 'numbers from N0)'); RETURN
+ END IF
+ IF (li == 0 .OR. kind == 0 .OR. node < 1) THEN
+ CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": bad VIV amplitude channel (use VIVAmpN, '// &
+ 'with a known line id)'); RETURN
+ END IF
+ nelem = line_nelem_from_sections(lines(li)%id, sections)
+ IF (node > nelem + 1) THEN
+ CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": node index exceeds line node count'); RETURN
+ END IF
+ IF (PRESENT(types)) THEN
+ IF (.NOT. line_has_viv_amp(lines(li), types, sections)) THEN
+ CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": line '//TRIM(int_to_str(line_id))//' has no '// &
+ 'VIV AMPLITUDE table, so no amplitude estimate'); RETURN
+ END IF
+ END IF
+ ELSE IF (is_load_power_channel(lo)) THEN
+ CALL parse_line_node_channel(ch, line_id, node, kind, comp)
+ li = find_line(lines, line_id)
+ IF (li /= 0 .AND. node == 0 .AND. names_node_zero(lo)) THEN
+ CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": node numbers start at 1 = End A (MoorDyn '// &
+ 'numbers from N0)'); RETURN
+ END IF
+ IF (li == 0 .OR. kind == 0 .OR. node < 1) THEN
+ CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": bad load power channel (use VIVPow, '// &
+ 'DragPow, DampPow, or N per unit length, with a known line id)'); RETURN
+ END IF
+ nelem = line_nelem_from_sections(lines(li)%id, sections)
+ IF (node > nelem + 1) THEN
+ CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": node index exceeds line node count'); RETURN
+ END IF
ELSE IF (starts_with(lo, 'ten') .OR. starts_with(lo, 'curv') .OR. &
starts_with(lo, 'bendmom') .OR. starts_with(lo, 'stfmom') .OR. starts_with(lo, 'l')) THEN
CALL parse_line_node_channel(ch, line_id, node, kind, comp)
@@ -36688,6 +38205,7 @@ SUBROUTINE check_channel(ch, lines, points, sections, ErrStat, ErrMsg, bodies, r
'Pointp{x,y,z} (alias Con
p{x,y,z}), Point
F{x,y,z,H}, '// &
'TenN, CurvN, CurvXN, CurvYN, BendMomN, StfMomN, '// &
'TorqN, TwistN, Twist, '// &
+ 'VIVPow, DragPow, DampPow (and N), VIVAmpN, '// &
'LNp{x,y,z}, LNv{x,y,z}, LNa{x,y,z}, LNDec, LNAzi, '// &
'TDP{s,x,y,z,Lay,Exc,Grd}, or the Body/Rod channels)'); RETURN
END IF
@@ -36696,11 +38214,12 @@ END SUBROUTINE check_channel
LOGICAL FUNCTION CD_Is_Line_Node_Channel(ch) RESULT(yes)
!! True for an OUTPUTS channel that names a node of a line (TenN, Curv, BendMom, StfMom,
!! Torq, TwistN, LN...), whose node numbering differs from MoorDyn's
- !! (CD_LINE_NODE_NUMBERING_NOTE); the line total Twist names no node.
+ !! (CD_LINE_NODE_NUMBERING_NOTE); the line totals Twist, VIVPow, DragPow and
+ !! DampPow name no node.
CHARACTER(*), INTENT(IN) :: ch
INTEGER :: line_id, node_id, kind, comp
CALL parse_line_node_channel(ch, line_id, node_id, kind, comp)
- yes = kind /= 0 .AND. kind /= 11
+ yes = kind /= 0 .AND. kind /= 11 .AND. kind /= 15 .AND. kind /= 17 .AND. kind /= 19
END FUNCTION CD_Is_Line_Node_Channel
PURE LOGICAL FUNCTION names_node_zero(lo) RESULT(yes)
@@ -36943,11 +38462,18 @@ SUBROUTINE parse_line_node_channel(ch, line_id, node_id, kind, comp)
!! TorqN -> kind=9, comp=0 line torque [N.m]
!! TwistN -> kind=10, comp=0 twist from End A [deg]
!! Twist -> kind=11, comp=0 total twist (node 1) [deg]
+ !! VIVPow -> kind=15, comp=0 power of the VIV loads on the line (node 1) [W]
+ !! VIVPowN -> kind=16, comp=0 the same per unit length about node J [W/m]
+ !! DragPow -> kind=17, comp=0 power of the hydrodynamic drag (node 1) [W]
+ !! DragPowN -> kind=18, comp=0 the same per unit length about node J [W/m]
+ !! DampPow -> kind=19, comp=0 power of the structural damping (node 1) [W]
+ !! DampPowN -> kind=20, comp=0 the same per unit length about node J [W/m]
+ !! VIVAmpN -> kind=21, comp=0 smoothed VIV amplitude estimate (VIV AMPLITUDE) [m]
CHARACTER(*), INTENT(IN) :: ch
INTEGER, INTENT(OUT) :: line_id, node_id, kind, comp
CHARACTER(NAMELEN) :: lo
- INTEGER :: npos, field_pos, last, sfx
+ INTEGER :: npos, field_pos, last, sfx, plen, pkind
lo = to_lower(ch)
line_id = 0
@@ -36995,6 +38521,28 @@ SUBROUTINE parse_line_node_channel(ch, line_id, node_id, kind, comp)
CALL parse_keyword_line_node(lo, 6, last, line_id, node_id)
IF (line_id > 0 .AND. node_id > 0) kind = 12
RETURN
+ ELSE IF (starts_with(lo, 'vivamp')) THEN
+ CALL parse_keyword_line_node(lo, 6, last, line_id, node_id)
+ IF (line_id > 0 .AND. node_id > 0) kind = 21
+ RETURN
+ ELSE IF (is_load_power_channel(lo)) THEN
+ ! the load power channels: the line total (node 1, as Twist), or the power per
+ ! unit length about a node N (the next kind)
+ plen = MERGE(6, 7, starts_with(lo, 'vivpow'))
+ pkind = MERGE(15, MERGE(17, 19, starts_with(lo, 'dragpow')), starts_with(lo, 'vivpow'))
+ IF (last > plen) THEN
+ IF (INDEX(lo(plen + 1:last), 'n') == 0) THEN
+ line_id = parse_positive_int(lo, plen + 1, last)
+ IF (line_id > 0) THEN
+ node_id = 1
+ kind = pkind
+ END IF
+ RETURN
+ END IF
+ END IF
+ CALL parse_keyword_line_node(lo, plen, last, line_id, node_id)
+ IF (line_id > 0 .AND. node_id > 0) kind = pkind + 1
+ RETURN
END IF
! LN... channels: p/v/a{x,y,z} (component) or Dec/Azi (scalar).
IF (.NOT. starts_with(lo, 'l')) RETURN
@@ -37057,6 +38605,45 @@ SUBROUTINE parse_keyword_line_node(lo, prefix_len, last, line_id, node_id)
node_id = parse_positive_int(lo, npos + 1, last)
END SUBROUTINE parse_keyword_line_node
+ LOGICAL FUNCTION is_load_power_channel(lo) RESULT(yes)
+ !! The load power channels VIVPow, DragPow and DampPow (lower case), of a line or a node.
+ CHARACTER(*), INTENT(IN) :: lo
+ yes = starts_with(lo, 'vivpow') .OR. starts_with(lo, 'dragpow') .OR. starts_with(lo, 'damppow')
+ END FUNCTION is_load_power_channel
+
+ PURE LOGICAL FUNCTION is_load_power_kind(kind) RESULT(yes)
+ !! The parse_line_node_channel kinds of the load power channels (15-20).
+ INTEGER, INTENT(IN) :: kind
+ yes = kind >= 15 .AND. kind <= 20
+ END FUNCTION is_load_power_kind
+
+ PURE REAL(wp) FUNCTION load_power_value(kind, inode, p_viv, p_drag, p_damp, l0) RESULT(val)
+ !! A load power channel from the node powers of its line (internal order, element e joining
+ !! nodes e and e+1 of unstretched length l0(e)): the line total [W] for the odd kinds (15, 17,
+ !! 19), and for the even ones the power per unit unstretched length about internal node inode
+ !! [W/m], the node's power over half the unstretched length of its elements.
+ INTEGER, INTENT(IN) :: kind, inode
+ REAL(wp), INTENT(IN) :: p_viv(:), p_drag(:), p_damp(:), l0(:)
+ REAL(wp) :: trib
+ val = CD_ZERO
+ SELECT CASE (kind)
+ CASE (15)
+ val = SUM(p_viv)
+ CASE (17)
+ val = SUM(p_drag)
+ CASE (19)
+ val = SUM(p_damp)
+ CASE (16, 18, 20)
+ trib = CD_ZERO
+ IF (inode > 1) trib = trib + 0.5_wp*l0(inode - 1)
+ IF (inode <= SIZE(l0)) trib = trib + 0.5_wp*l0(inode)
+ IF (.NOT. (trib > CD_ZERO)) RETURN
+ IF (kind == 16) val = p_viv(inode)/trib
+ IF (kind == 18) val = p_drag(inode)/trib
+ IF (kind == 20) val = p_damp(inode)/trib
+ END SELECT
+ END FUNCTION load_power_value
+
INTEGER FUNCTION parse_positive_int(s, first, last) RESULT(n)
CHARACTER(*), INTENT(IN) :: s
INTEGER, INTENT(IN) :: first, last
@@ -38219,12 +39806,14 @@ END SUBROUTINE aggregate_tdp_value
! -------------------------------------------------------------------------- !
SUBROUTINE CD_Eval_Aggregate_Channel(ch, has_sys, system, cables, line_is_cable, line_obj_index, val, ErrStat, &
- ErrMsg, cable_points, rigid_rt, rod_rt, ranges, mesh_node)
+ ErrMsg, cable_points, rigid_rt, rod_rt, ranges, mesh_node, rows)
!! Evaluate ONE deck OUTPUTS channel token against a built aggregate. The token's deck line
!! id is resolved through the map to either an EI=0 system line (eval_system_line_channel) or
!! a finite-EI cable (eval_cable_channel); Point channels read the EI=0 system point state.
!! The channel is assumed already validated (parse_deck -> check_channel); an internally
- !! inconsistent token or a failed state query still fails closed here.
+ !! inconsistent token or a failed state query still fails closed here. rows (optional, one
+ !! per cable): the line-wide values the channels of one output row share (CD_ChannelRow),
+ !! reset by the caller before the row; the value is the same with or without them.
CHARACTER(*), INTENT(IN) :: ch
LOGICAL, INTENT(IN) :: has_sys
TYPE(CD_SystemType), INTENT(IN) :: system
@@ -38247,6 +39836,7 @@ SUBROUTINE CD_Eval_Aggregate_Channel(ch, has_sys, system, cables, line_is_cable,
! A node channel names a deck node; mesh_node = .TRUE. reads it as a node of the line's final
! mesh instead (eval_cable_channel), as the static profile and the C API line arrays do
LOGICAL, INTENT(IN), OPTIONAL :: mesh_node
+ TYPE(CD_ChannelRow), INTENT(INOUT), OPTIONAL :: rows(:)
CHARACTER(NAMELEN) :: lo
LOGICAL :: found
@@ -38401,7 +39991,14 @@ SUBROUTINE CD_Eval_Aggregate_Channel(ch, has_sys, system, cables, line_is_cable,
IF (line_obj_index(line_id) > SIZE(cables)) THEN
CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": cable index out of range'); RETURN
END IF
- CALL eval_cable_channel(cables(line_obj_index(line_id)), ch, val, ErrStat, ErrMsg, mesh_node=mesh_node)
+ c = line_obj_index(line_id)
+ IF (PRESENT(rows)) THEN
+ IF (c <= SIZE(rows)) THEN
+ CALL eval_cable_channel(cables(c), ch, val, ErrStat, ErrMsg, mesh_node=mesh_node, power=rows(c))
+ RETURN
+ END IF
+ END IF
+ CALL eval_cable_channel(cables(c), ch, val, ErrStat, ErrMsg, mesh_node=mesh_node)
ELSE
IF (.NOT. has_sys) THEN
CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": line maps to the EI=0 system but no system '// &
@@ -38846,6 +40443,28 @@ SUBROUTINE eval_system_line_channel(system, li, ch, val, ErrStat, ErrMsg)
CALL fail(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": node index out of range'); RETURN
END IF
inode = deck_to_internal_node(node, nnode - 1)
+ IF (is_load_power_kind(kind)) THEN
+ BLOCK
+ REAL(wp) :: pv(nnode), pd(nnode), pm(nnode)
+ CALL CD_Get_System_Line_Load_Power(system, li, pv, pd, pm, es, em)
+ IF (es /= CD_SYSTEM_OK) THEN
+ CALL sys_solvefail(ch, em, ErrStat, ErrMsg); RETURN
+ END IF
+ val = load_power_value(kind, inode, pv, pd, pm, system%lines(li)%l0)
+ END BLOCK
+ RETURN
+ END IF
+ IF (kind == 21) THEN
+ BLOCK
+ REAL(wp) :: amp(nnode)
+ CALL CD_Get_Model_VIV_Amplitude(system%lines(li), amp, es, em)
+ IF (es /= CD_MODEL_OK) THEN
+ CALL sys_solvefail(ch, em, ErrStat, ErrMsg); RETURN
+ END IF
+ val = amp(inode)
+ END BLOCK
+ RETURN
+ END IF
IF (kind == 3) THEN
BLOCK
REAL(wp) :: tension(nnode - 1)
@@ -38888,7 +40507,7 @@ SUBROUTINE sys_solvefail(ch, em, ErrStat, ErrMsg)
ErrMsg = 'CableDyn_DeckDriver: OUTPUT "'//TRIM(ch)//'": '//TRIM(em)
END SUBROUTINE sys_solvefail
- SUBROUTINE eval_cable_channel(cable, ch, val, ErrStat, ErrMsg, mesh_node)
+ SUBROUTINE eval_cable_channel(cable, ch, val, ErrStat, ErrMsg, mesh_node, power)
!! Evaluate one channel for a finite-EI Hermite power cable (CD_HFMF). Reads the cable's
!! committed state directly from the CD_HFMF
!! line (stride-6 DOFs: r at 6*(n-1)+1..3, tangent m at +4..6) and recovers the
@@ -38899,13 +40518,17 @@ SUBROUTINE eval_cable_channel(cable, ch, val, ErrStat, ErrMsg, mesh_node)
!! names a deck node (1 + the total NumSegs of the line's sections, End A first), read at its
!! node of the final mesh on a refined line (cable%deck_node); mesh_node = .TRUE. reads the
!! token's node as a node of the final mesh instead (the static profile and the C API line
- !! arrays list every mesh node).
+ !! arrays list every mesh node). power (optional), the cable's line-wide values at its present
+ !! state (CD_ChannelRow: load powers, torsion state, element, end and node twists and
+ !! torques, section curvature, VIV amplitude): a channel takes a value when it is valid and
+ !! stores it otherwise, so the channels of one output row evaluate each kind once.
TYPE(CD_HFMF_ModuleType), INTENT(INOUT) :: cable
CHARACTER(*), INTENT(IN) :: ch
REAL(wp), INTENT(OUT) :: val
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
LOGICAL, INTENT(IN), OPTIONAL :: mesh_node
+ TYPE(CD_ChannelRow), INTENT(INOUT), OPTIONAL :: power
CHARACTER(NAMELEN) :: lo
INTEGER :: line_id, node, kind, comp, nnode, nelem, inode, es
@@ -38990,6 +40613,52 @@ SUBROUTINE eval_cable_channel(cable, ch, val, ErrStat, ErrMsg, mesh_node)
END IF
inode = deck_to_internal_node(node, nelem)
SELECT CASE (kind)
+ CASE (15:20) ! load power: the line total, or per unit length about the node
+ IF (PRESENT(power)) THEN
+ IF (power%valid) THEN
+ ! the row's earlier load power channel of this cable evaluated them at this state
+ val = load_power_value(kind, inode, power%pv, power%pd, power%pm, cable%line%l0)
+ RETURN
+ END IF
+ END IF
+ BLOCK
+ REAL(wp) :: pv(nnode), pd(nnode), pm(nnode)
+ CALL CD_HermiteCable_Dyn_Load_Power(cable%line, pv, pd, pm, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": finite-EI load power recovery failed: '// &
+ TRIM(em)); RETURN
+ END IF
+ val = load_power_value(kind, inode, pv, pd, pm, cable%line%l0)
+ IF (PRESENT(power)) THEN
+ power%pv = pv
+ power%pd = pd
+ power%pm = pm
+ power%valid = .TRUE.
+ END IF
+ END BLOCK
+ CASE (21) ! the smoothed VIV amplitude estimate of the node (VIV AMPLITUDE)
+ IF (PRESENT(power)) THEN
+ IF (.NOT. power%amp_valid) THEN
+ CALL row_array(power%amp, nnode)
+ CALL CD_HermiteCable_Dyn_VIV_Amplitude(cable%line, power%amp, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": finite-EI VIV amplitude recovery failed: '// &
+ TRIM(em)); RETURN
+ END IF
+ power%amp_valid = .TRUE.
+ END IF
+ val = power%amp(inode)
+ RETURN
+ END IF
+ BLOCK
+ REAL(wp) :: amp(nnode)
+ CALL CD_HermiteCable_Dyn_VIV_Amplitude(cable%line, amp, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": finite-EI VIV amplitude recovery failed: '// &
+ TRIM(em)); RETURN
+ END IF
+ val = amp(inode)
+ END BLOCK
CASE (3, 5, 6) ! nodal tension, curvature, bend moment
CALL cable_recovered_value(cable, kind, inode, ch, val, ErrStat, ErrMsg)
CASE (1) ! position (cable-local state rotated to the deck's global frame)
@@ -39008,6 +40677,19 @@ SUBROUTINE eval_cable_channel(cable, ch, val, ErrStat, ErrMsg, mesh_node)
CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": '//TRIM(em)); RETURN
END IF
CASE (13, 14) ! the curvature vector on the section axes x, y (CD_HFMF_Section_Curvature)
+ IF (PRESENT(power)) THEN
+ IF (.NOT. power%sc_valid) THEN
+ CALL row_array(power%kxa, cable%line%nn)
+ CALL row_array(power%kya, cable%line%nn)
+ CALL CD_HFMF_Section_Curvature(cable, power%kxa, power%kya, es, em)
+ IF (es /= CD_HFMF_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": '//TRIM(em)); RETURN
+ END IF
+ power%sc_valid = .TRUE.
+ END IF
+ val = MERGE(power%kxa(inode), power%kya(inode), kind == 13)
+ RETURN
+ END IF
BLOCK
REAL(wp) :: kxa(cable%line%nn), kya(cable%line%nn)
CALL CD_HFMF_Section_Curvature(cable, kxa, kya, es, em)
@@ -39017,6 +40699,10 @@ SUBROUTINE eval_cable_channel(cable, ch, val, ErrStat, ErrMsg, mesh_node)
val = MERGE(kxa(inode), kya(inode), kind == 13)
END BLOCK
CASE (9, 10, 11) ! condensed torsion: torque [N m], twist from End A to node J, total twist [deg]
+ IF (PRESENT(power)) THEN
+ CALL row_torsion_value(cable, power, kind, inode, ch, val, ErrStat, ErrMsg)
+ RETURN
+ END IF
BLOCK
REAL(wp) :: th, mt
CALL CD_HermiteCable_Dyn_Torsion_State(cable%line, th, mt, es, em)
@@ -39070,6 +40756,96 @@ SUBROUTINE eval_cable_channel(cable, ch, val, ErrStat, ErrMsg, mesh_node)
END SELECT
END SUBROUTINE eval_cable_channel
+ SUBROUTINE row_torsion_value(cable, row, kind, inode, ch, val, ErrStat, ErrMsg)
+ !! The torsion channels of eval_cable_channel (kind 9 torque, 10 twist from End A to the node,
+ !! 11 total twist) from the line-wide torsion values of the output row: each is evaluated once
+ !! per row by the first channel that needs it, the same calls in the same order as the
+ !! channel's own evaluation, so the value is bit for bit the one eval_cable_channel computes
+ !! without a row.
+ TYPE(CD_HFMF_ModuleType), INTENT(IN) :: cable
+ TYPE(CD_ChannelRow), INTENT(INOUT) :: row
+ INTEGER, INTENT(IN) :: kind, inode
+ CHARACTER(*), INTENT(IN) :: ch
+ REAL(wp), INTENT(OUT) :: val
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER :: es, nelem
+ CHARACTER(1024) :: em
+
+ ErrStat = CD_DECKDRV_OK
+ ErrMsg = ''
+ val = CD_ZERO
+ nelem = cable%line%ne
+ IF (.NOT. row%tors_valid) THEN
+ CALL CD_HermiteCable_Dyn_Torsion_State(cable%line, row%theta, row%torque, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": '//TRIM(em)); RETURN
+ END IF
+ row%tors_valid = .TRUE.
+ END IF
+ IF (kind == 9 .AND. cable%line%tw_active) THEN
+ ! nodal twist: the torque at the node (its elements' mean; an end node's element)
+ IF (.NOT. row%ntq_valid) THEN
+ CALL row_array(row%ntq, cable%line%nn)
+ CALL CD_HermiteCable_Dyn_Node_Torque(cable%line, row%ntq, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": '//TRIM(em)); RETURN
+ END IF
+ row%ntq_valid = .TRUE.
+ END IF
+ val = row%ntq(inode)
+ ELSE IF (kind == 9) THEN
+ val = row%torque
+ ELSE IF (cable%line%torsion%active) THEN
+ IF (.NOT. row%etw_valid) THEN
+ CALL row_array(row%etw, nelem)
+ CALL CD_HermiteCable_Dyn_Element_Twist(cable%line, row%etw, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": '//TRIM(em)); RETURN
+ END IF
+ row%etw_valid = .TRUE.
+ END IF
+ IF (kind == 11 .AND. cable%line%tw_active) THEN
+ IF (.NOT. row%etw2_valid) THEN
+ CALL CD_HermiteCable_Dyn_End_Twist(cable%line, row%etw2, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL fail_solve(ErrStat, ErrMsg, 'OUTPUT "'//TRIM(ch)//'": '//TRIM(em)); RETURN
+ END IF
+ row%etw2_valid = .TRUE.
+ END IF
+ val = (SUM(row%etw2) + SUM(row%etw))*45.0_wp/QUARTER_PI
+ ELSE IF (kind == 11) THEN
+ val = (row%torque*SUM(cable%line%torsion%end_compliance) + SUM(row%etw))*45.0_wp/QUARTER_PI
+ ELSE
+ val = SUM(row%etw(inode:nelem))*45.0_wp/QUARTER_PI
+ END IF
+ END IF
+ END SUBROUTINE row_torsion_value
+
+ SUBROUTINE row_array(a, n)
+ !! A line-wide array of an output row (CD_ChannelRow) sized n; its values are not kept.
+ REAL(wp), ALLOCATABLE, INTENT(INOUT) :: a(:)
+ INTEGER, INTENT(IN) :: n
+ IF (ALLOCATED(a)) THEN
+ IF (SIZE(a) == n) RETURN
+ DEALLOCATE (a)
+ END IF
+ ALLOCATE (a(n))
+ END SUBROUTINE row_array
+
+ ELEMENTAL SUBROUTINE CD_Channel_Row_Reset(row)
+ !! Clear the line-wide values of an output row (CD_ChannelRow) before the channels of a new
+ !! row, or after the state they were evaluated at changed; the arrays are kept for reuse.
+ TYPE(CD_ChannelRow), INTENT(INOUT) :: row
+ row%valid = .FALSE.
+ row%tors_valid = .FALSE.
+ row%etw_valid = .FALSE.
+ row%etw2_valid = .FALSE.
+ row%ntq_valid = .FALSE.
+ row%sc_valid = .FALSE.
+ row%amp_valid = .FALSE.
+ END SUBROUTINE CD_Channel_Row_Reset
+
PURE LOGICAL FUNCTION cable_state_ready(cable) RESULT(ready)
!! Whether a finite-EI cable holds the state its channels read.
TYPE(CD_HFMF_ModuleType), INTENT(IN) :: cable
@@ -39462,6 +41238,7 @@ FUNCTION CD_Channel_Unit(ch) RESULT(unit)
!! OrcaFlex-vocabulary output unit for a channel token, by kind: tension (FairTen/AnchTen/Ten)
!! and anchor force (AnchFz/AnchFH) -> (N); curvature (Curv) -> (1/m); bend moment (BendMom)
!! -> (N.m); endpoint orientation/Dec/Azi -> (deg); torque (Torq) -> (N.m); twist (Twist) -> (deg); position (Point/...p) -> (m);
+ !! load power (VIVPow/DragPow/DampPow) -> (W), per unit length about a node -> (W/m); VIVAmp -> (m);
!! velocity (...v) -> (m/s);
!! acceleration (...a) -> (m/s2).
CHARACTER(*), INTENT(IN) :: ch
@@ -39500,7 +41277,9 @@ FUNCTION CD_Channel_Unit(ch) RESULT(unit)
CASE (7, 8); unit = '(deg)'
CASE (9); unit = '(N.m)'
CASE (10, 11); unit = '(deg)'
- CASE (1); unit = '(m)'
+ CASE (15, 17, 19); unit = '(W)'
+ CASE (16, 18, 20); unit = '(W/m)'
+ CASE (1, 21); unit = '(m)'
CASE (2); unit = '(m/s)'
CASE (4); unit = '(m/s2)'
CASE DEFAULT; unit = '(-)'
@@ -40201,6 +41980,8 @@ SUBROUTINE resolve_one_end_torsion(types, bodies, rods, points, lines, sections,
why = 'its LINE TYPES rows give no GJ (the 14-column row; torsion has no EI/1.3 default)'
ELSE IF (j < 1) THEN
why = 'its End B point is undefined'
+ ELSE IF (points(j)%free_cable_end) THEN
+ why = 'its End B is a free end (a Free point)'
ELSE IF (TRIM(points(j)%ptype) /= 'fixed') THEN
why = 'it has two moving ends (torsion needs a Fixed End B)'
ELSE IF (.NOT. opts%alpha_force_blend .AND. (caller_driven .OR. (opts%has_tmax .AND. opts%tmax > CD_ZERO))) THEN
diff --git a/src/CableDyn_HermiteCable.f90 b/src/CableDyn_HermiteCable.f90
index dc62e175..45e36908 100644
--- a/src/CableDyn_HermiteCable.f90
+++ b/src/CableDyn_HermiteCable.f90
@@ -44,6 +44,9 @@ MODULE CableDyn_HermiteCable
PUBLIC :: CD_HermiteCable_Shapes
PUBLIC :: CD_HermiteCable_Gauss_Rule
PUBLIC :: CD_HermiteCable_Dry_Buoyancy
+ PUBLIC :: CD_HermiteCable_Bending_Damping
+ PUBLIC :: CD_HermiteCable_Mass_Damping
+ PUBLIC :: CD_HermiteCable_Rayleigh_Pair
INTEGER, PARAMETER, PUBLIC :: CD_HCABLE_OK = 0, CD_HCABLE_BADINPUT = 1
INTEGER, PARAMETER :: NG = 4 !! default Gauss points per element
@@ -380,6 +383,367 @@ END SUBROUTINE fail
END SUBROUTINE hermite_element_integrated
+ SUBROUTINE CD_HermiteCable_Bending_Damping(qr, vr, L, Bb, fdamp, Kq, Kv, ErrStat, ErrMsg, quadrature_order, &
+ l0_dot)
+ !! Kelvin-Voigt bending damping of one cubic-Hermite element: the dissipation function
+ !! psi = integral_0^L 1/2 Bb |kdot|^2 ds, kdot = (I - t t^T) d kappa/dt,
+ !! with kappa = (a x b)/|a|^3 the curvature vector of the elastic energy (a = dr/ds,
+ !! b = d^2r/ds^2, s the unstretched arc length) and t = a/|a| the unit tangent. kdot is the
+ !! curvature rate convected with the tangent by the smallest rotation: since kappa is normal
+ !! to t, (I - t t^T) dkappa/dt = dkappa/dt - (t x dt/dt) x kappa. It is zero for every rigid
+ !! motion whose rotation is normal to the tangent and equals dkappa/dt in planar bending; a
+ !! rotation about the tangent itself (a curvature that turns about the centreline) cannot be
+ !! told from a whirl without a twist state and is damped as one. A bending mode of frequency
+ !! omega whose energy is all bending has the damping ratio omega Bb / (2 EI).
+ !!
+ !! fdamp = d psi / d v is an INTERNAL generalised force (v . fdamp >= 0); Kq = d fdamp/dq
+ !! and Kv = d fdamp/dv are the exact Jacobians (Kq is not symmetric in general). qr and vr
+ !! are the element DOFs [r1, m1, r2, m2] and their rates; L the unstretched length; Bb >= 0
+ !! [N m^2 s].
+ !!
+ !! l0_dot (optional): the unstretched-length rate of an element under active line control. The
+ !! shape functions depend on L: a = p/L + g and b = P/L^2 + G/L, with p, P the end-position parts
+ !! and g, G the tangent-handle parts, so at fixed DOFs a changes at -(L'/L) a_pos and b at
+ !! -(L'/L)(2 b_pos + b_tan). These join the rates of a and b, and their dependence on the end
+ !! positions and tangent handles joins Kq; Kv is unchanged.
+ REAL(wp), INTENT(IN) :: qr(12), vr(12), L, Bb
+ REAL(wp), INTENT(OUT) :: fdamp(12)
+ REAL(wp), INTENT(OUT), OPTIONAL :: Kq(12, 12), Kv(12, 12)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER, INTENT(IN), OPTIONAL :: quadrature_order
+ REAL(wp), INTENT(IN), OPTIONAL :: l0_dot
+
+ REAL(wp) :: gp(MAX_NG), gw(MAX_NG), H(4), dH(4), ddH(4), b1(4), b2(4), rho, ca(4), cb(4)
+ REAL(wp) :: av(3), bv(3), ad(3), bd(3), xd(6), cr(3), tv(3), s2, sp, g, ga, gaa2
+ REAL(wp) :: Dcr(3, 6), Dg(6), J(3, 6), Pm(3, 3), Km(3, 6), kr(3), dK(3, 6, 6), T(3, 6, 6), dP(3, 3, 3)
+ REAL(wp) :: g6(6), Q6(6, 6), V6(6, 6), a6(6), wgL, w11, w12, w21, w22, acc, dik, dmk
+ INTEGER :: order, qg, i, jj, k, m, c, dd, ic, jc, kn, mn
+ INTEGER, PARAMETER :: sd(4) = [0, 3, 6, 9]
+ LOGICAL :: has_rate
+
+ ErrStat = CD_HCABLE_OK
+ ErrMsg = ''
+ fdamp = CD_ZERO
+ IF (PRESENT(Kq)) Kq = CD_ZERO
+ IF (PRESENT(Kv)) Kv = CD_ZERO
+ order = NG
+ IF (PRESENT(quadrature_order)) order = quadrature_order
+ IF (.NOT. CD_All_Finite(qr) .OR. .NOT. CD_All_Finite(vr) .OR. .NOT. CD_Is_Finite(L) .OR. &
+ .NOT. CD_Is_Finite(Bb)) THEN
+ CALL fail('inputs must be finite'); RETURN
+ END IF
+ IF (L <= GEOM_TOL) THEN
+ CALL fail('element length must be positive'); RETURN
+ END IF
+ IF (Bb < CD_ZERO) THEN
+ CALL fail('Bb must be non-negative'); RETURN
+ END IF
+ IF (order < 1 .OR. order > MAX_NG) THEN
+ CALL fail('quadrature_order must lie in [1,6]'); RETURN
+ END IF
+ rho = CD_ZERO
+ IF (PRESENT(l0_dot)) THEN
+ IF (.NOT. CD_Is_Finite(l0_dot)) THEN
+ CALL fail('l0_dot must be finite'); RETURN
+ END IF
+ rho = l0_dot/L
+ END IF
+ has_rate = ABS(rho) > CD_ZERO
+ IF (.NOT. (Bb > CD_ZERO)) RETURN
+
+ CALL CD_HermiteCable_Gauss_Rule(order, gp, gw)
+ V6 = CD_ZERO
+ Q6 = CD_ZERO
+ DO qg = 1, order
+ CALL hermite_shapes(gp(qg), L, H, dH, ddH)
+ b1 = dH/L
+ b2 = ddH/(L*L)
+ DO c = 1, 3
+ av(c) = SUM(b1*qr(sd + c)); bv(c) = SUM(b2*qr(sd + c))
+ ad(c) = SUM(b1*vr(sd + c)); bd(c) = SUM(b2*vr(sd + c))
+ END DO
+ ! the length-rate weights of the effective rates: d a/dt -= rho sum_k ca(k) q_k and
+ ! d b/dt -= rho sum_k cb(k) q_k (end positions k = 1, 3; tangent handles k = 2, 4)
+ ca = [b1(1), CD_ZERO, b1(3), CD_ZERO]
+ cb = [2.0_wp*b2(1), b2(2), 2.0_wp*b2(3), b2(4)]
+ IF (has_rate) THEN
+ DO c = 1, 3
+ ad(c) = ad(c) - rho*SUM(ca*qr(sd + c))
+ bd(c) = bd(c) - rho*SUM(cb*qr(sd + c))
+ END DO
+ END IF
+ xd(1:3) = ad; xd(4:6) = bd
+ s2 = SUM(av*av)
+ IF (s2 <= GEOM_TOL*GEOM_TOL) THEN
+ CALL fail('degenerate centreline: |dr/ds| ~ 0 at a Gauss point'); RETURN
+ END IF
+ sp = SQRT(s2)
+ tv = av/sp
+ g = CD_ONE/(sp*s2) ! |a|^-3
+ ga = -3.0_wp/(s2*s2*sp) ! d g/d a = ga a; d2 g/da da = ga I + gaa2 a a^T
+ gaa2 = 15.0_wp/(s2*s2*s2*sp)
+ cr = [av(2)*bv(3) - av(3)*bv(2), av(3)*bv(1) - av(1)*bv(3), av(1)*bv(2) - av(2)*bv(1)]
+ ! first derivatives: d cr/d a = -[b]x, d cr/d b = [a]x
+ Dcr(:, 1:3) = -skew(bv)
+ Dcr(:, 4:6) = skew(av)
+ Dg = CD_ZERO
+ Dg(1:3) = ga*av
+ a6 = CD_ZERO
+ a6(1:3) = av
+ DO jj = 1, 6
+ J(:, jj) = Dcr(:, jj)*g + cr*Dg(jj)
+ END DO
+ ! projector P = I - t t^T
+ DO m = 1, 3
+ DO i = 1, 3
+ Pm(i, m) = -tv(i)*tv(m)
+ END DO
+ Pm(m, m) = Pm(m, m) + CD_ONE
+ END DO
+ Km = MATMUL(Pm, J)
+ kr = MATMUL(Km, xd)
+ IF (PRESENT(Kq)) THEN
+ ! the second derivatives the position Jacobian alone takes (the force does not)
+ ! second derivatives of kappa = cr g: T(i,j,k) = d2 kappa_i / dx_j dx_k, x = (a, b)
+ DO k = 1, 6
+ DO jj = 1, 6
+ DO i = 1, 3
+ acc = Dcr(i, jj)*Dg(k) + Dcr(i, k)*Dg(jj)
+ IF (jj <= 3 .AND. k >= 4) acc = acc + levi(i, jj, k - 3)*g
+ IF (jj >= 4 .AND. k <= 3) acc = acc + levi(i, k, jj - 3)*g
+ IF (jj <= 3 .AND. k <= 3) THEN
+ acc = acc + cr(i)*gaa2*a6(jj)*a6(k)
+ IF (jj == k) acc = acc + cr(i)*ga
+ END IF
+ T(i, jj, k) = acc
+ END DO
+ END DO
+ END DO
+ ! dP(i,m,k) = d P_im / d a_k (zero for b)
+ DO k = 1, 3
+ DO m = 1, 3
+ DO i = 1, 3
+ dik = CD_ZERO; IF (i == k) dik = CD_ONE
+ dmk = CD_ZERO; IF (m == k) dmk = CD_ONE
+ dP(i, m, k) = -(((dik - tv(i)*tv(k))/sp)*tv(m) + tv(i)*((dmk - tv(m)*tv(k))/sp))
+ END DO
+ END DO
+ END DO
+ ! dK(i,j,k) = d K_ij / d x_k = sum_m dP(i,m,k) J(m,j) + sum_m P(i,m) T(m,j,k)
+ DO k = 1, 6
+ DO jj = 1, 6
+ DO i = 1, 3
+ acc = SUM(Pm(i, :)*T(:, jj, k))
+ IF (k <= 3) acc = acc + SUM(dP(i, :, k)*J(:, jj))
+ dK(i, jj, k) = acc
+ END DO
+ END DO
+ END DO
+ END IF
+ g6 = Bb*MATMUL(TRANSPOSE(Km), kr)
+ IF (PRESENT(Kv) .OR. (PRESENT(Kq) .AND. has_rate)) V6 = Bb*MATMUL(TRANSPOSE(Km), Km)
+ IF (PRESENT(Kq)) THEN
+ ! d (K^T K xd)_j / d x_k = sum_i dK(i,j,k) kr_i + K_ij sum_l dK(i,l,k) xd_l
+ DO k = 1, 6
+ DO jj = 1, 6
+ acc = CD_ZERO
+ DO i = 1, 3
+ acc = acc + dK(i, jj, k)*kr(i) + Km(i, jj)*SUM(dK(i, :, k)*xd)
+ END DO
+ Q6(jj, k) = Bb*acc
+ END DO
+ END DO
+ END IF
+ wgL = gw(qg)*L
+ DO kn = 1, 4
+ DO c = 1, 3
+ ic = sd(kn) + c
+ fdamp(ic) = fdamp(ic) + wgL*(b1(kn)*g6(c) + b2(kn)*g6(3 + c))
+ END DO
+ END DO
+ IF (.NOT. (PRESENT(Kq) .OR. PRESENT(Kv))) CYCLE
+ DO mn = 1, 4
+ DO kn = 1, 4
+ w11 = wgL*b1(kn)*b1(mn); w12 = wgL*b1(kn)*b2(mn)
+ w21 = wgL*b2(kn)*b1(mn); w22 = wgL*b2(kn)*b2(mn)
+ DO dd = 1, 3
+ jc = sd(mn) + dd
+ DO c = 1, 3
+ ic = sd(kn) + c
+ IF (PRESENT(Kq)) THEN
+ Kq(ic, jc) = Kq(ic, jc) + w11*Q6(c, dd) + w12*Q6(c, 3 + dd) &
+ + w21*Q6(3 + c, dd) + w22*Q6(3 + c, 3 + dd)
+ ! the effective rates' dependence on the DOFs under a length rate
+ IF (has_rate) Kq(ic, jc) = Kq(ic, jc) - rho*wgL* &
+ ((b1(kn)*V6(c, dd) + b2(kn)*V6(3 + c, dd))*ca(mn) + &
+ (b1(kn)*V6(c, 3 + dd) + b2(kn)*V6(3 + c, 3 + dd))*cb(mn))
+ END IF
+ IF (PRESENT(Kv)) Kv(ic, jc) = Kv(ic, jc) + w11*V6(c, dd) + w12*V6(c, 3 + dd) &
+ + w21*V6(3 + c, dd) + w22*V6(3 + c, 3 + dd)
+ END DO
+ END DO
+ END DO
+ END DO
+ END DO
+ IF (.NOT. CD_All_Finite(fdamp)) THEN
+ CALL fail('non-finite bending damping force'); RETURN
+ END IF
+ IF (PRESENT(Kq)) THEN
+ IF (.NOT. CD_All_Finite(Kq)) THEN
+ CALL fail('non-finite bending damping Jacobian'); RETURN
+ END IF
+ END IF
+
+ CONTAINS
+
+ PURE FUNCTION skew(v) RESULT(s)
+ !! [v]x, so that skew(v) u = v x u
+ REAL(wp), INTENT(IN) :: v(3)
+ REAL(wp) :: s(3, 3)
+ s = RESHAPE([CD_ZERO, v(3), -v(2), -v(3), CD_ZERO, v(1), v(2), -v(1), CD_ZERO], [3, 3])
+ END FUNCTION skew
+
+ PURE REAL(wp) FUNCTION levi(i, jj, k)
+ !! Levi-Civita symbol for indices in 1..3
+ INTEGER, INTENT(IN) :: i, jj, k
+ levi = REAL((i - jj)*(jj - k)*(k - i), wp)/2.0_wp
+ END FUNCTION levi
+
+ SUBROUTINE fail(msg)
+ CHARACTER(*), INTENT(IN) :: msg
+ ErrStat = CD_HCABLE_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Bending_Damping: '//msg
+ fdamp = CD_ZERO
+ IF (PRESENT(Kq)) Kq = CD_ZERO
+ IF (PRESENT(Kv)) Kv = CD_ZERO
+ END SUBROUTINE fail
+
+ END SUBROUTINE CD_HermiteCable_Bending_Damping
+
+ SUBROUTINE CD_HermiteCable_Mass_Damping(qr, vr, L, cm, fdamp, Kq, Kv, ErrStat, ErrMsg)
+ !! Mass-proportional (Rayleigh alpha) transverse damping of one cubic-Hermite element: the
+ !! dissipation function
+ !! psi = integral_0^L 1/2 cm |(I - t t^T) v|^2 ds, cm = alpha rho_a [N s/m^2],
+ !! with v = dr/dt the interpolated velocity (the shape functions of the consistent mass), t =
+ !! a/|a| the unit tangent (a = dr/ds) and s the unstretched arc length. The force is alpha
+ !! times the line's own mass on the velocity normal to the tangent: on a straight element it is
+ !! alpha M v in the two transverse directions (M the consistent mass, CD_HermiteCable_Mass) and
+ !! zero along the axis, so a transverse mode whose mass is the line's own has the damping
+ !! ratio alpha/(2 omega) and axial sliding is not damped. The velocity is absolute: a rigid
+ !! transverse translation or a pendulum swing of the line is damped as well.
+ !!
+ !! fdamp = d psi / d v is an INTERNAL generalised force (v . fdamp = 2 psi >= 0); Kq = d fdamp/dq
+ !! and Kv = d fdamp/dv are the exact Jacobians (Kv symmetric, Kq not). qr and vr are the element
+ !! DOFs [r1, m1, r2, m2] and their rates; L the unstretched length; cm >= 0. Four-point Gauss
+ !! quadrature, as the consistent mass.
+ REAL(wp), INTENT(IN) :: qr(12), vr(12), L, cm
+ REAL(wp), INTENT(OUT) :: fdamp(12)
+ REAL(wp), INTENT(OUT), OPTIONAL :: Kq(12, 12), Kv(12, 12)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+
+ REAL(wp) :: gp(MAX_NG), gw(MAX_NG), H(4), dH(4), ddH(4), b1(4), av(3), vv(3), tv(3), un(3)
+ REAL(wp) :: Pm(3, 3), Dm(3, 3), s2, sp, st, wc, wkm
+ INTEGER :: qg, c, dd, kn, mn, ic, jc
+ INTEGER, PARAMETER :: sd(4) = [0, 3, 6, 9]
+
+ ErrStat = CD_HCABLE_OK
+ ErrMsg = ''
+ fdamp = CD_ZERO
+ IF (PRESENT(Kq)) Kq = CD_ZERO
+ IF (PRESENT(Kv)) Kv = CD_ZERO
+ IF (.NOT. CD_All_Finite(qr) .OR. .NOT. CD_All_Finite(vr) .OR. .NOT. CD_Is_Finite(L) .OR. &
+ .NOT. CD_Is_Finite(cm)) THEN
+ CALL fail('inputs must be finite'); RETURN
+ END IF
+ IF (L <= GEOM_TOL) THEN
+ CALL fail('element length must be positive'); RETURN
+ END IF
+ IF (cm < CD_ZERO) THEN
+ CALL fail('the damping coefficient must be non-negative'); RETURN
+ END IF
+ IF (.NOT. (cm > CD_ZERO)) RETURN
+
+ CALL CD_HermiteCable_Gauss_Rule(NG, gp, gw)
+ DO qg = 1, NG
+ CALL hermite_shapes(gp(qg), L, H, dH, ddH)
+ b1 = dH/L
+ DO c = 1, 3
+ av(c) = SUM(b1*qr(sd + c)); vv(c) = SUM(H*vr(sd + c))
+ END DO
+ s2 = SUM(av*av)
+ IF (s2 <= GEOM_TOL*GEOM_TOL) THEN
+ CALL fail('degenerate centreline: |dr/ds| ~ 0 at a Gauss point'); RETURN
+ END IF
+ sp = SQRT(s2)
+ tv = av/sp
+ st = SUM(tv*vv)
+ un = vv - st*tv ! (I - t t^T) v
+ wc = gw(qg)*L*cm
+ DO kn = 1, 4
+ DO c = 1, 3
+ fdamp(sd(kn) + c) = fdamp(sd(kn) + c) + wc*H(kn)*un(c)
+ END DO
+ END DO
+ IF (.NOT. (PRESENT(Kq) .OR. PRESENT(Kv))) CYCLE
+ ! P = I - t t^T; D(c, k) = d (P v)_c / d a_k = -((I - t t^T)_ck (t . v) + t_c (P v)_k)/|a|
+ DO dd = 1, 3
+ DO c = 1, 3
+ Pm(c, dd) = -tv(c)*tv(dd)
+ END DO
+ Pm(dd, dd) = Pm(dd, dd) + CD_ONE
+ END DO
+ DO dd = 1, 3
+ DO c = 1, 3
+ Dm(c, dd) = -(Pm(c, dd)*st + tv(c)*un(dd))/sp
+ END DO
+ END DO
+ DO mn = 1, 4
+ DO kn = 1, 4
+ wkm = wc*H(kn)
+ DO dd = 1, 3
+ jc = sd(mn) + dd
+ DO c = 1, 3
+ ic = sd(kn) + c
+ IF (PRESENT(Kv)) Kv(ic, jc) = Kv(ic, jc) + wkm*H(mn)*Pm(c, dd)
+ IF (PRESENT(Kq)) Kq(ic, jc) = Kq(ic, jc) + wkm*b1(mn)*Dm(c, dd)
+ END DO
+ END DO
+ END DO
+ END DO
+ END DO
+ IF (.NOT. CD_All_Finite(fdamp)) THEN
+ CALL fail('non-finite mass damping force'); RETURN
+ END IF
+
+ CONTAINS
+
+ SUBROUTINE fail(msg)
+ CHARACTER(*), INTENT(IN) :: msg
+ ErrStat = CD_HCABLE_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Mass_Damping: '//msg
+ fdamp = CD_ZERO
+ IF (PRESENT(Kq)) Kq = CD_ZERO
+ IF (PRESENT(Kv)) Kv = CD_ZERO
+ END SUBROUTINE fail
+
+ END SUBROUTINE CD_HermiteCable_Mass_Damping
+
+ PURE SUBROUTINE CD_HermiteCable_Rayleigh_Pair(zeta, f1, f2, EI, Bb, alpha)
+ !! The bending damping Bb [N m^2 s] and the mass-proportional coefficient alpha [1/s] that give
+ !! the damping ratio zeta(omega) = alpha/(2 omega) + (Bb/EI) omega/2 the value zeta at the two
+ !! frequencies f1 and f2 [Hz] (omega = 2 pi f): Bb = zeta EI/(pi (f1 + f2)) and
+ !! alpha = 4 pi zeta f1 f2/(f1 + f2). Between f1 and f2 the ratio is lower, at least
+ !! 2 zeta sqrt(f1 f2)/(f1 + f2) at sqrt(f1 f2); outside it is higher. The caller checks
+ !! 0 < zeta and f1, f2 > 0.
+ REAL(wp), INTENT(IN) :: zeta, f1, f2, EI
+ REAL(wp), INTENT(OUT) :: Bb, alpha
+ REAL(wp), PARAMETER :: PI_L = 3.14159265358979323846_wp
+ Bb = zeta*EI/(PI_L*(f1 + f2))
+ alpha = 4.0_wp*PI_L*zeta*f1*f2/(f1 + f2)
+ END SUBROUTINE CD_HermiteCable_Rayleigh_Pair
+
SUBROUTINE CD_HermiteCable_Mass(rho_a, L, M, ErrStat, ErrMsg)
!! Consistent (kinetic-energy) mass matrix of the cubic-Hermite bending-cable element.
!!
diff --git a/src/CableDyn_HermiteCableDynamic.f90 b/src/CableDyn_HermiteCableDynamic.f90
index ff12e0c5..50c8a607 100644
--- a/src/CableDyn_HermiteCableDynamic.f90
+++ b/src/CableDyn_HermiteCableDynamic.f90
@@ -62,11 +62,18 @@ MODULE CableDyn_HermiteCableDynamic
CD_HermiteCable_Gauss_Rule, &
CD_HermiteCable_Axial_Resultant, &
CD_HermiteCable_Axial_Strain_Lower_Bound, CD_HermiteCable_Dry_Buoyancy, &
+ CD_HermiteCable_Bending_Damping, CD_HermiteCable_Mass_Damping, &
CD_HCABLE_OK
USE CableDyn_Linalg, ONLY: CD_Factor_Banded, CD_Solve_Factored_Banded, CD_LINALG_OK
USE CableDyn_VIV, ONLY: CD_VIV_Lift_Per_Length, CD_VIV_Crossflow_Along, CD_VIV_Phase_Rate, CD_VIV_Mean_Square, &
- CD_VIV_Wrap_Phase, CD_VIV_TWO_PI, CD_VIV_NM
+ CD_VIV_Wrap_Phase, CD_VIV_TWO_PI, CD_VIV_NM, CD_VIV_Inline_Per_Length, &
+ 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, &
CD_Component_Wave_Kinematics, CD_Solve_Dispersion_Wavenumber, CD_HYDRO_OK
USE CableDyn_SeabedContact, ONLY: CD_Seabed_Normal_Law, CD_Seabed_Contact_Gate, CD_SEABED_CONTACT_BLEND, &
CD_Seabed_Friction_Stick_Slip, CD_Seabed_Friction_Aniso, &
@@ -93,6 +100,8 @@ MODULE CableDyn_HermiteCableDynamic
PUBLIC :: CD_HermiteCable_Dyn_Init
PUBLIC :: CD_HermiteCable_Dyn_Set_Drag
PUBLIC :: CD_HermiteCable_Dyn_Set_Axial_Damping
+ PUBLIC :: CD_HermiteCable_Dyn_Set_Bending_Damping
+ PUBLIC :: CD_HermiteCable_Dyn_Set_Mass_Damping
PUBLIC :: CD_HermiteCable_Dyn_Set_EndConnection
PUBLIC :: CD_HermiteCable_Dyn_Set_Torsion
PUBLIC :: CD_HermiteCable_Dyn_Torsion_State
@@ -114,6 +123,8 @@ MODULE CableDyn_HermiteCableDynamic
PUBLIC :: CD_HermiteCable_Dyn_Set_AddedMass
PUBLIC :: CD_HermiteCable_Dyn_Set_Waves
PUBLIC :: CD_HermiteCable_Dyn_Set_Held_Fluid
+ PUBLIC :: CD_HermiteCable_Point_Immersion
+ PUBLIC :: CD_HermiteCable_Point_Radius
PUBLIC :: CD_HermiteCable_Dyn_Set_Contact
PUBLIC :: CD_HermiteCable_Dyn_Set_Attachments
PUBLIC :: CD_HermiteCable_Attachment_Drag
@@ -124,6 +135,9 @@ MODULE CableDyn_HermiteCableDynamic
PUBLIC :: CD_HermiteCable_Dyn_On_Seabed
PUBLIC :: CD_HermiteCable_Dyn_Set_Irregular_Waves
PUBLIC :: CD_HermiteCable_Drag_Element
+ PUBLIC :: CD_HermiteCable_VIV_Lift_Element
+ PUBLIC :: CD_HermiteCable_Dyn_Load_Power
+ PUBLIC :: CD_HermiteCable_Dyn_VIV_Amplitude
PUBLIC :: CD_HermiteCable_Axial_Damping_Element
PUBLIC :: CD_HermiteCable_Axial_Damping_Resultant
PUBLIC :: CD_HermiteCable_AddedMass_Element
@@ -155,6 +169,9 @@ MODULE CableDyn_HermiteCableDynamic
PUBLIC :: CD_HermiteCable_Dyn_Reset_Profile, CD_HermiteCable_Dyn_Disable_Profile, &
CD_HermiteCable_Dyn_Get_Profile, CD_HermiteCable_Dyn_Get_Assembly_Profile
PUBLIC :: CD_HermiteCable_Dyn_Profile_Enabled
+ ! Ambient normal flow speed [m/s] below which the split cross-flow drag blends to Morison's
+ ! (CD_Morison_Drag_Split_Per_Length_Jac u_ref): its axes are undefined in still water.
+ REAL(wp), PARAMETER, PUBLIC :: CD_HCDYN_CDY_UREF = 0.01_wp
INTEGER, PARAMETER, PUBLIC :: CD_HCDYN_OK = 0, CD_HCDYN_BADINPUT = 1, CD_HCDYN_NOCONVERGE = 2
INTEGER, PARAMETER, PUBLIC :: CD_HCDYN_TENSILE_OFF = 0
INTEGER, PARAMETER, PUBLIC :: CD_HCDYN_TENSILE_WARN = 1
@@ -257,6 +274,17 @@ MODULE CableDyn_HermiteCableDynamic
! axial quadrature as the elastic resultant. Off by default.
LOGICAL :: has_axial_damping = .FALSE.
REAL(wp), ALLOCATABLE :: BA(:)
+ ! Optional bending Kelvin-Voigt damping (CD_HermiteCable_Bending_Damping): Bb [N m^2 s] per
+ ! element, the coefficient of the convected curvature rate, integrated over reference arc length
+ ! with the bending quadrature. It joins the axial damping in the structural-damping load (the
+ ! element-load column 2 and the Kvel tangent). Off by default.
+ LOGICAL :: has_bend_damping = .FALSE.
+ REAL(wp), ALLOCATABLE :: Bb(:)
+ ! Optional mass-proportional (Rayleigh alpha) transverse damping (CD_HermiteCable_Mass_Damping):
+ ! ray_alpha [1/s] per element, the force ray_alpha rho_a on the velocity normal to the tangent.
+ ! It joins the structural-damping load (not its bending part). No state. Off by default.
+ LOGICAL :: has_mass_damping = .FALSE.
+ REAL(wp), ALLOCATABLE :: ray_alpha(:)
! Active line control (CD_HermiteCable_Dyn_Set_SegmentLength): a host changes the
! unstretched lengths l0 of chosen elements between steps. has_ctrl is set by the first
! change; from then on l0_dot(ne) holds the unstretched-length rate of every element
@@ -306,9 +334,11 @@ MODULE CableDyn_HermiteCableDynamic
REAL(wp), ALLOCATABLE :: fr_anchor(:, :), fr_k(:), ws_recovery_fr(:, :), snap_fr_anchor(:, :)
! Cross-flow VIV (CD_HermiteCable_Dyn_Set_VIV, CableDyn_VIV): viv_k(e) = 1/2 rho D Cl of each
! element (0: no lift), the synchronisation band and diameter per node, the shedding phase
- ! and the running mean squares of the cross-flow velocity and acceleration per node. The lift
- ! of a step takes viv_phi_eval (the committed phase for F_n, the step's predicted phase in
- ! the Newton iterations); viv_rate/viv_ms_next hold the step-start rate and mean squares.
+ ! and the running mean squares of the cross-flow velocity and acceleration per node, and after
+ ! the motion statistics the step predictor (viv_pred_row: the phase rate at the mid-point of
+ ! the last step, the in-line one after it). The lift of a step takes viv_phi_eval (the
+ ! committed phase for F_n, the step's predicted phase in the Newton iterations); viv_rate and
+ ! viv_ms_next hold the step's predicted rate and its end statistics.
! ws_recovery_viv_* is the step-start copy of the recovering step, snap_viv_* the snapshot.
LOGICAL :: has_viv = .FALSE.
! the cross-flow phase of a node at rest (CD_VIV_Phase_Rate phi_rest): pi where the material
@@ -319,7 +349,78 @@ MODULE CableDyn_HermiteCableDynamic
REAL(wp), ALLOCATABLE :: viv_rate(:), viv_ms(:, :), viv_ms_next(:, :)
REAL(wp), ALLOCATABLE :: ws_recovery_viv_phi(:), ws_recovery_viv_ms(:, :), snap_viv_phi(:), snap_viv_ms(:, :)
LOGICAL, ALLOCATABLE :: viv_node(:)
- REAL(wp), ALLOCATABLE :: Mgb(:, :) ! constant global mass (band)
+ ! In-line VIV (Set_VIV clx, il_alpha; CableDyn_VIV): vil_k(e) = 1/2 rho D C_vx of each element
+ ! (0: no in-line force), the frequency band alpha per node (vil_alpha), the in-line shedding
+ ! phase and the running mean squares of the in-line velocity and acceleration per node, with
+ ! the cross-flow state's eval, rate, next, recovery and snapshot twins. Its phase rate is
+ ! twice the cross-flow one, so it lives on cross-flow (viv_node) nodes only.
+ LOGICAL :: has_viv_il = .FALSE.
+ ! the higher-harmonic force of Ulveseter et al. (2019): per element its coefficient vhh_cx
+ ! (0 = none) and scale vhh_k = 1/2 rho D C_hh, allocated with the in-line VIV
+ REAL(wp), ALLOCATABLE :: vhh_cx(:), vhh_k(:)
+ REAL(wp), ALLOCATABLE :: vil_cx(:), vil_k(:), vil_alpha(:), vil_phi(:), vil_phi_eval(:), vil_rate(:)
+ REAL(wp), ALLOCATABLE :: vil_ms(:, :), vil_ms_next(:, :), ws_recovery_vil_phi(:), ws_recovery_vil_ms(:, :)
+ REAL(wp), ALLOCATABLE :: snap_vil_phi(:), snap_vil_ms(:, :)
+ LOGICAL, ALLOCATABLE :: vil_node(:)
+ ! Wake-oscillator VIV (Set_VIV wake; Facchinetti et al. 2004): viv_wake replaces the
+ ! synchronisation phase of the whole cable by the van der Pol wake variable q = 2 C_L/C_L0, the
+ ! lift taking viv_k = 1/2 rho D viv_cl with viv_cl = C_L0/2. Per node the Strouhal number,
+ ! van der Pol eps and coupling A (length-weighted over its lifting elements), the state
+ ! wo_s(:, k) = (q, dq/dt), q at the step's evaluation point (wo_q_eval, as viv_phi_eval), the
+ ! step predictor in row 2 of viv_ms (the cross-flow acceleration at the mid-point of the last
+ ! step; wo_ydd0 its copy in a step), the step-start wake frequency wo_om0, and the recovery and
+ ! snapshot copies of the state. With a filter time
+ ! wo_tf(k) > 0 on some node (wo_filter) wo_s has three more rows, the node's velocity
+ ! low-pass filtered over wo_tf (first order), and the wake frequency takes the flow normal to
+ ! the line relative to it: a cable moved through still water sheds, the cable's own VIV
+ ! velocity (much faster than wo_tf) does not modulate it.
+ LOGICAL :: viv_wake = .FALSE., wo_filter = .FALSE.
+ REAL(wp), ALLOCATABLE :: wo_st(:), wo_eps(:), wo_a(:), wo_s(:, :), wo_q_eval(:), wo_ydd0(:), wo_om0(:)
+ REAL(wp), ALLOCATABLE :: wo_tf(:)
+ REAL(wp), ALLOCATABLE :: ws_recovery_wo_s(:, :), snap_wo_s(:, :)
+ ! Amplitude-dependent VIV coefficients (Set_VIV amp, amp_n; VIV AMPLITUDE section): per element
+ ! a table of viv_amp_n rows (A/D, C_v, drag factor) in viv_amp(:, 1:n, e). With it viv_ms carries
+ ! CD_VIV_NMS_AMP rows per node, the amplitude estimate of Thorsen et al. (2016) after the mean
+ ! squares (CD_VIV_Amplitude_Update; row 5 the smoothed amplitude); an element takes C_v in place
+ ! of cl and the factor of its normal drag coefficient at the mean smoothed amplitude of its VIV
+ ! nodes over its diameter.
+ LOGICAL :: has_viv_amp = .FALSE.
+ REAL(wp), ALLOCATABLE :: viv_amp(:, :, :)
+ INTEGER, ALLOCATABLE :: viv_amp_n(:)
+ ! The diameter of the VIV model per element (Set_VIV dviv; VIV DIAMETER section): the shedding
+ ! frequency, lift scale and amplitude ratio take viv_dv(e) where it is positive, the drag
+ ! diameter diam(e) elsewhere and when it is unallocated (viv_diam).
+ REAL(wp), ALLOCATABLE :: viv_dv(:)
+ ! Cross-flow hydrodynamic damping of Thorsen et al. (2016) (Set_VIV cdy; VIV DAMPING section):
+ ! viv_cdy(:, e) = (a, b, c), the element's normal drag split into Morison in line and the
+ ! cross-flow damping 1/2 rho D [C_dy |w_y| + c Cdn |w|] w_y, C_dy = a + b y0/D, across the ambient
+ ! flow (elem_cdy, elem_cdy_lin; c Cdn with the element's unamplified Cdn); a < 0, or the array
+ ! unallocated, keeps the element's Morison drag.
+ REAL(wp), ALLOCATABLE :: viv_cdy(:, :)
+ ! The flow frame of the synchronisation model (Set_VIV tf; VIV FRAME section): with a filter
+ ! time viv_ftfe(e) > 0 on some element (viv_frame) viv_ms has CD_VIV_NMS_FRAME rows, rows 7:9
+ ! the node's velocity low-pass filtered over viv_ftf(k) (first order; the length-weighted
+ ! average over the node's lifting elements), rows 3:6 the amplitude estimate (0 without
+ ! amplitude tables). The node's velocity relative to it drives the phases (viv_node_motion;
+ ! the relative flow, and so the shedding speed, unchanged), and the ambient-frame quantities
+ ! take the ambient flow relative to it: the amplitude estimate (viv_node_ambient_yd) and so the
+ ! 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
+ ! non-dimensional distance theta = integral U/D dt; node k's band centre is then
+ ! CD_VIV_Sto_Centre(viv_cf(k), viv_sto_a(k), viv_sto_f(1:n, k), viv_sto_p(1:n, k), theta) with
+ ! n = viv_sto_n(k) components (0: the constant viv_cf(k); viv_centre).
+ LOGICAL :: viv_sto = .FALSE.
+ REAL(wp), ALLOCATABLE :: viv_sto_a(:), viv_sto_f(:, :), viv_sto_p(:, :)
+ INTEGER, ALLOCATABLE :: viv_sto_n(:)
+ REAL(wp), ALLOCATABLE :: Mgb(:, :) ! constant global mass (band)
LOGICAL, ALLOCATABLE :: freemask(:), solve_mask(:)
INTEGER, ALLOCATABLE :: fmap(:) ! free -> global DOF index
REAL(wp), ALLOCATABLE :: q(:), v(:), a(:) ! dynamic state
@@ -331,6 +432,8 @@ MODULE CableDyn_HermiteCableDynamic
REAL(wp), ALLOCATABLE :: ws_recovery_q0(:), ws_recovery_v0(:), ws_recovery_a0(:)
REAL(wp), ALLOCATABLE :: ws_qa(:), ws_aa(:), ws_va(:), ws_vk(:)
REAL(wp), ALLOCATABLE :: ws_R(:), ws_G(:), ws_Gt(:), ws_inert(:), ws_qtrial(:), ws_dq(:)
+ ! the residual of a single node's assembly (node_reaction), apart from ws_R
+ REAL(wp), ALLOCATABLE :: ws_Rnode(:)
! Force-blended generalised-alpha: the unblended residual R(q_{n+1}, v_{n+1}, t_{n+1}) of
! the current iterate (ws_Rk) and of a line-search trial (ws_Rt), and the force at the
! committed state F_n = R(q_n, v_n, t_n). F_n is cached from the previous step's converged
@@ -438,14 +541,21 @@ MODULE CableDyn_HermiteCableDynamic
! [N] it loses above the free surface, the fluid-inertia coefficient att_fk(k) =
! rho V (1 + Ca) [kg], and the drag areas normal (att_cda) and axial (att_cdax) to the
! line tangent at the node [m^2] with the fluid density att_rho. Its mass
- ! plus added mass m + Ca rho V is part of the constant mass Mgb.
+ ! plus added mass m + Ca rho V is part of the constant mass Mgb. Across the free surface
+ ! its buoyancy, Froude-Krylov force and drag carry the immersed fraction of the sphere of
+ ! its volume (radius att_r; of its drag area CdA without a volume), as a Rigid6 body's do
+ ! (CD_HermiteCable_Point_Immersion).
LOGICAL :: has_attach = .FALSE.
! Set by a checkpoint-restart reload (CD_HFMF_UnpackMirror): the committed acceleration is
! a generalised-alpha history value, so the first held fluid field after the reload must
! preserve it instead of re-deriving an initial-condition acceleration.
LOGICAL :: a_restored = .FALSE.
INTEGER, ALLOCATABLE :: att_node(:)
- REAL(wp), ALLOCATABLE :: att_w(:), att_b(:), att_fk(:), att_cda(:), att_cdax(:)
+ REAL(wp), ALLOCATABLE :: att_w(:), att_b(:), att_fk(:), att_cda(:), att_cdax(:), att_r(:)
+ ! a point's isotropic drag (a Free point ending the line) in place of the normal/axial split
+ LOGICAL, ALLOCATABLE :: att_iso(:)
+ ! the point a free end carries: in the equations of motion, not in the end force
+ LOGICAL, ALLOCATABLE :: att_point(:)
! The two nodal mass terms each attachment adds to Mgb, the dry mass m and the added mass
! Ca rho V, kept so that a length change rebuilds Mgb in the order initialisation used.
REAL(wp), ALLOCATABLE :: att_mass(:), att_madd(:)
@@ -535,6 +645,13 @@ MODULE CableDyn_HermiteCableDynamic
! the step's residual norm.
REAL(wp) :: tw_tsum = CD_ZERO, tw_spsi(2) = CD_ZERO, tw_tscale = CD_ONE
REAL(wp), ALLOCATABLE :: tw_su(:, :), tw_stn(:, :), tw_sbeta(:)
+ ! tw_sq: the configuration tw_advance_reference re-based at; tw_rq: the configuration of the
+ ! last committed step (tw_commit_reference after a step, not a frame-only transfer), at which
+ ! every element passed every check of twist_reference; valid while tw_rq_ok (none before the
+ ! first step, after tw_init or a change of the lengths). An element whose DOFs are tw_rq's
+ ! and whose unit node tangents are the reference's, bit for bit, keeps its reference twist.
+ REAL(wp), ALLOCATABLE :: tw_sq(:), tw_rq(:)
+ LOGICAL :: tw_rq_ok = .FALSE.
! tw_som(:, k): the angular velocity of end frame k over the running step, log(R_{n+1}
! R_n^T)/dt (R = [d n d x n]); tw_om: that of the committed step. A turning frame twists
! the element at a rigid end through rho, and the torsional damping takes that rate.
@@ -849,6 +966,7 @@ SUBROUTINE CD_HermiteCable_Dyn_Init(model, l0, EA, EI, rho_a, w, seed, fixed_dof
model%ws_inert(ndof), model%ws_qtrial(ndof), model%ws_dq(ndof), &
model%ws_recovery_q0(ndof), model%ws_recovery_v0(ndof), model%ws_recovery_a0(ndof))
ALLOCATE (model%ws_Rk(ndof), model%ws_Rt(ndof), model%fc_R(ndof), model%fc_q(ndof), model%fc_v(ndof))
+ ALLOCATE (model%ws_Rnode(ndof))
model%fc_valid = .FALSE.
model%fc_clears = model%fc_clears + 1
model%tr_valid = .FALSE.
@@ -1076,7 +1194,8 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Friction_Axial(model, mu_axial, ErrStat, ErrM
model%tr_valid = .FALSE.
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)
+ 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, 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
@@ -1091,6 +1210,66 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err
!! carries any waves); the internal wave families (Set_Waves) are refused with VIV. The
!! committed acceleration is refreshed with the new lift; if that fails, the previous VIV
!! configuration, its state and the acceleration are restored.
+ !!
+ !! In-line VIV (Ulveseter et al. 2018; both or neither): clx, per element, the in-line shedding
+ !! coefficient C_vx (0: none; > 0 only where cl > 0, the in-line phase rate being twice the
+ !! cross-flow one) and il_alpha its frequency band (0 <= alpha < 1). The in-line phase of a
+ !! node starts at twice its cross-flow phase. chh (optional, with clx), per element, the
+ !! coefficient C_hh >= 0 of the higher-harmonic force of Ulveseter et al. (2019), the lift's
+ !! form at the phase sum phi_y + phi_x (0: none; > 0 only where clx > 0).
+ !!
+ !! Wake oscillator (Facchinetti et al. 2004; no in-line VIV): wake(1:3, e) = (St, eps, A) per
+ !! element selects it for the cable, cl then being the reference lift coefficient C_L0 and cf,
+ !! df unused. The lift per unit length is 1/4 rho D C_L0 q U^2 along the cross-flow axis, with
+ !! q'' + eps om (q^2 - 1) q' + om^2 q = (A/D) y'' at each lifting node (om = 2 pi St U/D, y''
+ !! its cross-flow acceleration); q starts on its limit cycle at the phase seed, q = 2 cos(phi_0)
+ !! and q' = 0. U is the ambient flow normal to the line; an optional fourth row wake(4, e) = Tf
+ !! [s] > 0 takes U relative to the node velocity low-pass filtered over Tf (first order), for
+ !! a cable moved through the water (0: the ambient flow).
+ !!
+ !! Amplitude-dependent coefficients (both or neither; not with the wake oscillator): amp (3,
+ !! CD_VIV_AMP_MAXP, ne) and amp_n (ne), per element a table of amp_n rows (0: none; only where
+ !! cl > 0) of the amplitude ratio A/D >= 0 (strictly increasing), the cross-flow coefficient
+ !! C_v >= 0 that replaces cl, and the factor > 0 of the element's normal drag coefficient, at
+ !! the smoothed amplitude estimate of Thorsen et al. (2016); piecewise linear, held beyond the
+ !! end rows.
+ !!
+ !! dviv (optional), per element, the diameter of the VIV model (> 0), which the shedding
+ !! frequency, the lift and in-line scales and the amplitude ratio take in place of the drag
+ !! diameter (0: the drag diameter, also after a later Set_Drag).
+ !!
+ !! cdy (optional, (2 or 3, ne)), per element (a, b[, c]) of the cross-flow hydrodynamic damping of
+ !! Thorsen et al. (2016, Eq. 1), C_dy = a + b y0/D (a < 0: none on that element): the element's
+ !! normal drag keeps Morison's in-line part (with any amplitude-table drag factor) and takes
+ !! 1/2 rho D [C_dy |w_y| + c Cdn |w|] w_y across the ambient flow (c = 0 without the third row;
+ !! CD_Morison_Drag_Split_Per_Length_Jac), y0 the smoothed amplitude estimate, so an element with
+ !! it needs an amplitude table (amp_n > 0); a, b, c >= 0, finite. (0, 0, 1) amplifies the in-line
+ !! drag alone and keeps Morison's cross-flow drag.
+ !!
+ !! tf (optional, ne; not with the wake oscillator, which takes it as wake(4, :)), per element the
+ !! filter time Tf [s] of the flow frame of the synchronisation model (0: the ambient flow; > 0
+ !! only where cl > 0, at most 1e15), vbar the node velocity low-pass filtered over Tf (first
+ !! order): the cross-flow and in-line motion of the phases takes the node's velocity relative
+ !! to vbar (along the axes of the relative flow); the amplitude estimate takes it across the
+ !! ambient flow relative to vbar; and the cross-flow damping takes its axes and blend from that
+ !! flow. A cable moved through the water by a tow or its floater then sees that motion as flow.
+ !! The shedding speed of the phase rate stays the relative normal speed.
+ !!
+ !! sto (optional, (4, ne); 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): sigma >= 0 the standard
+ !! deviation of the centre (0: the constant cf on that element), and where sigma > 0 (only where
+ !! cl > 0) 0 < c <= 1 the top of its flat spectrum as a fraction of cf, the number of components
+ !! N_f (an integer, 1 to CD_VIV_STO_MAXF) and the seed of the start phases (an integer, 0 to
+ !! 2^31 - 2). A node takes the length-weighted sigma over its lifting elements, the
+ !! 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
@@ -1100,14 +1279,34 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err
!! MoorDyn's node tangent, so a node at rest takes the cross-flow phase pi
!! (CD_VIV_Phase_Rate phi_rest); .FALSE. on a line the reader turned around
LOGICAL, INTENT(IN), OPTIONAL :: tangent_reversed
- INTEGER :: e, k, ne, nn, es
- REAL(wp) :: wsum, tw_old, rest_old
- LOGICAL :: had_viv
+ REAL(wp), INTENT(IN), OPTIONAL :: clx(:), il_alpha(:), chh(:)
+ REAL(wp), INTENT(IN), OPTIONAL :: wake(:, :)
+ REAL(wp), INTENT(IN), OPTIONAL :: amp(:, :, :)
+ INTEGER, INTENT(IN), OPTIONAL :: amp_n(:)
+ 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, 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(:)
+ LOGICAL :: had_viv, had_il, want_il, had_wake, want_wake, bad_band, had_amp, want_amp
CHARACTER(LEN=1024) :: em
+ REAL(wp), ALLOCATABLE :: p_amp(:, :, :)
+ REAL(wp), ALLOCATABLE :: p_dv(:), p_cdy(:, :), p_ftf(:), p_ftfe(:)
+ INTEGER, ALLOCATABLE :: p_ampn(:)
REAL(wp), ALLOCATABLE :: a_old(:), o_cl(:), o_k(:), o_cf(:), o_df(:), o_dn(:), o_phi(:), o_phi_eval(:), &
o_rate(:), o_ms(:, :), o_ms_next(:, :), o_rec_phi(:), o_rec_ms(:, :), &
o_snap_phi(:), o_snap_ms(:, :)
- LOGICAL, ALLOCATABLE :: o_node(:)
+ REAL(wp), ALLOCATABLE :: x_cx(:), x_k(:), x_al(:), x_phi(:), x_phi_eval(:), x_rate(:), x_ms(:, :), &
+ x_ms_next(:, :), x_rec_phi(:), x_rec_ms(:, :), x_snap_phi(:), x_snap_ms(:, :), &
+ x_hcx(:), x_hk(:)
+ REAL(wp), ALLOCATABLE :: w_st(:), w_eps(:), w_a(:), w_s(:, :), w_qe(:), w_y0(:), w_om(:), w_rec(:, :), &
+ w_snap(:, :), w_tf(:)
+ LOGICAL, ALLOCATABLE :: o_node(:), x_node(:)
ErrStat = CD_HCDYN_OK; ErrMsg = ''
IF (.NOT. model%initialized) THEN
@@ -1123,8 +1322,41 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err
CD_Is_Finite(t_window))) THEN
ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: inputs must be finite'; RETURN
END IF
- IF (ANY(cl < CD_ZERO) .OR. t_window < CD_ZERO .OR. &
- ANY(cl > CD_ZERO .AND. .NOT. (cf > CD_ZERO .AND. df >= CD_ZERO .AND. df < cf))) THEN
+ want_wake = PRESENT(wake)
+ IF (want_wake) THEN
+ IF ((SIZE(wake, 1) /= 3 .AND. SIZE(wake, 1) /= 4) .OR. SIZE(wake, 2) /= ne) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: wake must be shaped (3 or 4, ne): St, eps, A[, Tf] per element'
+ RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(RESHAPE(wake, [SIZE(wake)]))) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: wake must be finite'; RETURN
+ END IF
+ IF (SIZE(wake, 1) == 4) THEN
+ IF (ANY(wake(4, :) < CD_ZERO) .OR. ANY(wake(4, :) > 1.0e15_wp)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the wake filter time Tf must be >= 0 (0 = the ambient flow) and '// &
+ 'at most 1e15'
+ RETURN
+ END IF
+ END IF
+ IF (ANY(cl > CD_ZERO .AND. .NOT. (wake(1, :) > CD_ZERO .AND. wake(2, :) > CD_ZERO .AND. &
+ wake(3, :) >= CD_ZERO))) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the wake oscillator needs St > 0, eps > 0 and A >= 0 where cl > 0'
+ RETURN
+ END IF
+ IF (PRESENT(clx)) THEN
+ IF (ANY(clx > CD_ZERO)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the wake oscillator takes no in-line VIV (clx > 0)'; RETURN
+ END IF
+ END IF
+ END IF
+ ! the synchronisation band applies to the lift of the synchronisation model only
+ bad_band = ANY(cl > CD_ZERO .AND. .NOT. (cf > CD_ZERO .AND. df >= CD_ZERO .AND. df < cf))
+ IF (want_wake) bad_band = .FALSE.
+ IF (ANY(cl < CD_ZERO) .OR. t_window < CD_ZERO .OR. bad_band) THEN
ErrStat = CD_HCDYN_BADINPUT
ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: need cl >= 0, t_window >= 0 and 0 <= df < cf where cl > 0'
RETURN
@@ -1144,8 +1376,175 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err
ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: internal waves are configured; VIV takes waves as a held '// &
'host fluid field (CD_HermiteCable_Dyn_Set_Held_Fluid)'; RETURN
END IF
+ IF (PRESENT(clx) .NEQV. PRESENT(il_alpha)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the in-line clx and il_alpha go together'; RETURN
+ END IF
+ want_il = .FALSE.
+ IF (PRESENT(clx)) THEN
+ IF (SIZE(clx) /= ne .OR. SIZE(il_alpha) /= ne) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: clx and il_alpha must each have one value per element'; RETURN
+ END IF
+ IF (.NOT. (CD_All_Finite(clx) .AND. CD_All_Finite(il_alpha))) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: clx and il_alpha must be finite'; RETURN
+ END IF
+ IF (ANY(clx < CD_ZERO) .OR. ANY(clx > CD_ZERO .AND. .NOT. (il_alpha >= CD_ZERO .AND. il_alpha < CD_ONE))) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: need clx >= 0 and 0 <= il_alpha < 1 where clx > 0'; RETURN
+ END IF
+ IF (ANY(clx > CD_ZERO .AND. .NOT. (cl > CD_ZERO))) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: in-line VIV (clx > 0) needs the cross-flow lift (cl > 0) on the '// &
+ 'same element: its phase rate is twice the cross-flow one'; RETURN
+ END IF
+ want_il = ANY(clx > CD_ZERO)
+ END IF
+ IF (PRESENT(chh)) THEN
+ IF (.NOT. PRESENT(clx)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the higher-harmonic chh needs the in-line clx'; RETURN
+ END IF
+ IF (SIZE(chh) /= ne) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: chh must have one value per element'; RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(chh)) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: chh must be finite'; RETURN
+ END IF
+ IF (ANY(chh < CD_ZERO) .OR. ANY(chh > CD_ZERO .AND. .NOT. (clx > CD_ZERO))) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: need chh >= 0, and chh > 0 only where clx > 0 (the '// &
+ 'higher-harmonic force runs at the cross-flow plus in-line phase)'; RETURN
+ END IF
+ END IF
+ IF (PRESENT(amp) .NEQV. PRESENT(amp_n)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the amplitude tables amp and amp_n go together'; RETURN
+ END IF
+ want_amp = .FALSE.
+ IF (PRESENT(amp)) THEN
+ CALL CD_VIV_Check_Amp_Table(amp, amp_n, cl, em)
+ IF (LEN_TRIM(em) > 0) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: '//TRIM(em); RETURN
+ END IF
+ want_amp = ANY(amp_n > 0)
+ IF (want_amp .AND. want_wake) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the amplitude tables act on the synchronisation model, not the '// &
+ 'wake oscillator'; RETURN
+ END IF
+ END IF
+ IF (PRESENT(dviv)) THEN
+ IF (SIZE(dviv) /= ne) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: dviv must have one value per element'; RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(dviv)) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: dviv must be finite'; RETURN
+ END IF
+ IF (ANY(dviv < CD_ZERO)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: dviv must be non-negative (0 = the drag diameter)'; RETURN
+ END IF
+ END IF
+ IF (PRESENT(cdy)) THEN
+ IF ((SIZE(cdy, 1) /= 2 .AND. SIZE(cdy, 1) /= 3) .OR. SIZE(cdy, 2) /= ne) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: cdy must have shape (2 or 3, n_elem)'; RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(cdy)) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: cdy must be finite'; RETURN
+ END IF
+ DO e = 1, ne
+ IF (cdy(1, e) < CD_ZERO) CYCLE
+ IF (ANY(cdy(2:, e) < CD_ZERO)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the cross-flow damping b and c must be non-negative'; RETURN
+ END IF
+ IF (.NOT. want_amp) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the cross-flow damping takes its amplitude from an amplitude '// &
+ 'table (amp, amp_n)'; RETURN
+ END IF
+ IF (amp_n(e) <= 0) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: an element with cross-flow damping needs an amplitude table'
+ RETURN
+ END IF
+ END DO
+ END IF
+ want_frame = .FALSE.
+ IF (PRESENT(tf)) THEN
+ IF (want_wake) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the wake oscillator takes its filter time as wake(4, :), not tf'
+ RETURN
+ END IF
+ IF (SIZE(tf) /= ne) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: tf must have one value per element'
+ RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(tf)) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: tf must be finite'; RETURN
+ END IF
+ IF (ANY(tf < CD_ZERO) .OR. ANY(tf > 1.0e15_wp)) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the flow-frame filter time Tf must be >= 0 (0 = the ambient '// &
+ 'flow) and at most 1e15'
+ RETURN
+ END IF
+ IF (ANY(tf > CD_ZERO .AND. .NOT. (cl > CD_ZERO))) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the flow frame (tf > 0) acts on the VIV model: tf > 0 only where cl > 0'
+ RETURN
+ END IF
+ want_frame = ANY(tf > CD_ZERO)
+ END IF
+ want_sto = .FALSE.
+ IF (PRESENT(sto)) THEN
+ IF (SIZE(sto, 1) /= 4 .OR. SIZE(sto, 2) /= ne) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: sto must have shape (4, ne)'
+ RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(sto)) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: sto must be finite'; RETURN
+ END IF
+ DO e = 1, ne
+ IF (sto(1, e) < CD_ZERO) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: the stochastic band centre needs sigma >= 0'
+ RETURN
+ END IF
+ IF (.NOT. (sto(1, e) > CD_ZERO)) CYCLE
+ IF (.NOT. (cl(e) > CD_ZERO) .OR. want_wake) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_VIV: a stochastic band centre (sigma > 0) acts on the synchronisation '// &
+ 'model: only where cl > 0, and not with the wake oscillator'
+ RETURN
+ END IF
+ IF (.NOT. (sto(1, e) <= 1.0e3_wp .AND. sto(2, e) > CD_ZERO .AND. sto(2, e) <= CD_ONE .AND. &
+ sto(3, e) >= CD_ONE .AND. sto(3, e) <= REAL(CD_VIV_STO_MAXF, wp) .AND. &
+ .NOT. (ABS(sto(3, e) - AINT(sto(3, e))) > CD_ZERO) .AND. sto(4, e) >= CD_ZERO .AND. &
+ sto(4, e) <= 2147483646.0_wp .AND. .NOT. (ABS(sto(4, e) - AINT(sto(4, e))) > CD_ZERO))) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ WRITE (ErrMsg, '(A,I0,A)') 'CD_HermiteCable_Dyn_Set_VIV: the stochastic band centre needs sigma at '// &
+ 'most 1e3, 0 < c <= 1, an integer N_f from 1 to ', CD_VIV_STO_MAXF, &
+ ' and an integer seed from 0 to 2147483646'
+ RETURN
+ END IF
+ END DO
+ want_sto = ANY(sto(1, :) > CD_ZERO)
+ END IF
! the previous configuration and state, kept for a rollback
had_viv = model%has_viv
+ had_il = model%has_viv_il
+ 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
rest_old = model%viv_phi_rest
a_old = model%a
@@ -1159,11 +1558,40 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err
IF (had_viv) CALL refresh_acceleration()
RETURN
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)
+ IF (want_sto) nms = nms + 1
ALLOCATE (model%viv_cl(ne), model%viv_k(ne), model%viv_cf(nn), model%viv_df(nn), model%viv_dn(nn), &
model%viv_phi(nn), &
- model%viv_phi_eval(nn), model%viv_rate(nn), model%viv_ms(2, nn), model%viv_ms_next(2, nn), &
- model%ws_recovery_viv_phi(nn), model%ws_recovery_viv_ms(2, nn), model%snap_viv_phi(nn), &
- model%snap_viv_ms(2, nn), model%viv_node(nn))
+ model%viv_phi_eval(nn), model%viv_rate(nn), model%viv_ms(nms, nn), model%viv_ms_next(nms, nn), &
+ model%ws_recovery_viv_phi(nn), model%ws_recovery_viv_ms(nms, nn), model%snap_viv_phi(nn), &
+ model%snap_viv_ms(nms, nn), model%viv_node(nn))
+ IF (want_amp) THEN
+ ALLOCATE (model%viv_amp(3, CD_VIV_AMP_MAXP, ne), model%viv_amp_n(ne))
+ model%viv_amp = amp
+ model%viv_amp_n = amp_n
+ model%has_viv_amp = .TRUE.
+ END IF
+ IF (PRESENT(dviv)) THEN
+ IF (ANY(dviv > CD_ZERO)) THEN
+ ALLOCATE (model%viv_dv(ne))
+ model%viv_dv = dviv
+ END IF
+ END IF
+ IF (PRESENT(cdy)) THEN
+ IF (ANY(cdy(1, :) >= CD_ZERO)) THEN
+ ALLOCATE (model%viv_cdy(3, ne))
+ model%viv_cdy = CD_ZERO
+ model%viv_cdy(1:SIZE(cdy, 1), :) = cdy
+ END IF
+ END IF
model%viv_cl = cl
model%viv_cf = CD_ZERO
model%viv_df = CD_ZERO
@@ -1186,6 +1614,150 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err
model%viv_phi(k) = CD_VIV_Wrap_Phase(CD_VIV_TWO_PI*(REAL(nn - k, wp)/REAL(ne, wp) + 0.5_wp))
IF (PRESENT(phase_seed)) model%viv_phi(k) = CD_VIV_TWO_PI*phase_seed(k)
END DO
+ IF (want_frame) THEN
+ ! the filter time per element and per node (length-weighted over its lifting elements, as
+ ! the band); the filtered velocity starts at the node's velocity
+ 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
+ DO e = MAX(1, k - 1), MIN(ne, k)
+ IF (.NOT. (cl(e) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(e)
+ model%viv_ftf(k) = model%viv_ftf(k) + model%l0(e)*tf(e)
+ 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
+ ! those with sigma > 0, their most components and the seed of the first; theta starts at 0
+ nfm = NINT(MAXVAL(sto(3, :), MASK=sto(1, :) > CD_ZERO))
+ ALLOCATE (model%viv_sto_a(nn), model%viv_sto_f(nfm, nn), model%viv_sto_p(nfm, nn), model%viv_sto_n(nn))
+ model%viv_sto_a = CD_ZERO
+ model%viv_sto_f = CD_ZERO
+ model%viv_sto_p = CD_ZERO
+ model%viv_sto_n = 0
+ DO k = 1, nn
+ IF (.NOT. model%viv_node(k)) CYCLE
+ wsum = CD_ZERO; ssum = CD_ZERO; csum = CD_ZERO; cw = CD_ZERO; nfk = 0; seedk = -1
+ DO e = MAX(1, k - 1), MIN(ne, k)
+ IF (.NOT. (cl(e) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(e)
+ ssum = ssum + model%l0(e)*sto(1, e)
+ IF (.NOT. (sto(1, e) > CD_ZERO)) CYCLE
+ cw = cw + model%l0(e)
+ csum = csum + model%l0(e)*sto(2, e)
+ nfk = MAX(nfk, NINT(sto(3, e)))
+ IF (seedk < 0) seedk = NINT(sto(4, e))
+ END DO
+ IF (nfk < 1) CYCLE
+ CALL CD_VIV_Sto_Node(ssum/wsum, csum/cw, model%viv_cf(k), nfk, seedk, k, model%viv_sto_a(k), &
+ model%viv_sto_f(1:nfk, k), model%viv_sto_p(1:nfk, k))
+ model%viv_sto_n(k) = nfk
+ END DO
+ model%viv_sto = .TRUE.
+ END IF
+ IF (want_il) THEN
+ ALLOCATE (model%vil_cx(ne), model%vil_k(ne), model%vil_alpha(nn), model%vil_phi(nn), model%vil_phi_eval(nn), &
+ model%vil_rate(nn), model%vil_ms(2, nn), model%vil_ms_next(2, nn), model%ws_recovery_vil_phi(nn), &
+ model%ws_recovery_vil_ms(2, nn), model%snap_vil_phi(nn), model%snap_vil_ms(2, nn), &
+ model%vil_node(nn), model%vhh_cx(ne), model%vhh_k(ne))
+ model%vil_cx = clx
+ model%vhh_cx = CD_ZERO
+ IF (PRESENT(chh)) model%vhh_cx = chh
+ model%vil_alpha = CD_ZERO
+ model%vil_node = .FALSE.
+ model%vil_phi = CD_ZERO
+ model%vil_ms = CD_ZERO
+ ! node values: the length-weighted average over the node's in-line elements
+ DO k = 1, nn
+ wsum = CD_ZERO
+ DO e = MAX(1, k - 1), MIN(ne, k)
+ IF (.NOT. (clx(e) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(e)
+ model%vil_alpha(k) = model%vil_alpha(k) + model%l0(e)*il_alpha(e)
+ END DO
+ IF (.NOT. (wsum > CD_ZERO)) CYCLE
+ model%vil_node(k) = .TRUE.
+ model%vil_alpha(k) = model%vil_alpha(k)/wsum
+ model%vil_phi(k) = CD_VIV_Wrap_Phase(2.0_wp*model%viv_phi(k))
+ END DO
+ model%vil_phi_eval = model%vil_phi
+ model%vil_rate = CD_ZERO
+ model%vil_ms_next = model%vil_ms
+ model%ws_recovery_vil_phi = model%vil_phi
+ model%ws_recovery_vil_ms = model%vil_ms
+ model%snap_vil_phi = model%vil_phi
+ model%snap_vil_ms = model%vil_ms
+ model%has_viv_il = .TRUE.
+ END IF
+ IF (want_wake) THEN
+ ! the filter time per node, length-weighted over its lifting elements like St, eps and A
+ ALLOCATE (model%wo_tf(nn))
+ model%wo_tf = CD_ZERO
+ IF (SIZE(wake, 1) == 4) THEN
+ DO k = 1, nn
+ IF (.NOT. model%viv_node(k)) CYCLE
+ wsum = CD_ZERO
+ DO e = MAX(1, k - 1), MIN(ne, k)
+ IF (.NOT. (cl(e) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(e)
+ model%wo_tf(k) = model%wo_tf(k) + model%l0(e)*wake(4, e)
+ END DO
+ model%wo_tf(k) = model%wo_tf(k)/wsum
+ END DO
+ END IF
+ model%wo_filter = ANY(model%wo_tf > CD_ZERO)
+ nw = MERGE(5, 2, model%wo_filter)
+ ALLOCATE (model%wo_st(nn), model%wo_eps(nn), model%wo_a(nn), model%wo_s(nw, nn), model%wo_q_eval(nn), &
+ model%wo_ydd0(nn), model%wo_om0(nn), model%ws_recovery_wo_s(nw, nn), model%snap_wo_s(nw, nn))
+ ! the lift scale 1/2 rho D viv_cl is then 1/4 rho D C_L0, the lift 1/4 rho D C_L0 q U^2
+ model%viv_cl = 0.5_wp*cl
+ model%wo_st = CD_ZERO
+ model%wo_eps = CD_ZERO
+ model%wo_a = CD_ZERO
+ model%wo_s = CD_ZERO
+ DO k = 1, nn
+ IF (.NOT. model%viv_node(k)) CYCLE
+ wsum = CD_ZERO
+ DO e = MAX(1, k - 1), MIN(ne, k)
+ IF (.NOT. (cl(e) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(e)
+ model%wo_st(k) = model%wo_st(k) + model%l0(e)*wake(1, e)
+ model%wo_eps(k) = model%wo_eps(k) + model%l0(e)*wake(2, e)
+ model%wo_a(k) = model%wo_a(k) + model%l0(e)*wake(3, e)
+ END DO
+ model%wo_st(k) = model%wo_st(k)/wsum
+ model%wo_eps(k) = model%wo_eps(k)/wsum
+ model%wo_a(k) = model%wo_a(k)/wsum
+ ! on the limit cycle at the node's phase seed
+ model%wo_s(1, k) = 2.0_wp*COS(model%viv_phi(k))
+ ! the filtered velocity starts at the node's velocity
+ IF (model%wo_filter) model%wo_s(3:5, k) = model%v(6*(k - 1) + 1:6*(k - 1) + 3)
+ END DO
+ model%wo_q_eval = model%wo_s(1, :)
+ model%wo_ydd0 = CD_ZERO
+ model%wo_om0 = CD_ZERO
+ model%ws_recovery_wo_s = model%wo_s
+ model%snap_wo_s = model%wo_s
+ model%viv_wake = .TRUE.
+ END IF
CALL viv_drag_terms(model)
model%viv_phi_eval = model%viv_phi
model%viv_rate = CD_ZERO
@@ -1200,6 +1772,7 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err
model%has_viv = .TRUE.
! the lift is part of the committed load: the first step's predictor and phase rate need it
CALL refresh_acceleration()
+ IF (ErrStat == CD_HCDYN_OK) CALL viv_seed_predictor(model)
CONTAINS
SUBROUTINE refresh_acceleration()
@@ -1208,6 +1781,13 @@ SUBROUTINE refresh_acceleration()
CALL clear_viv(model)
CALL move_viv(.TRUE.)
model%has_viv = had_viv
+ model%has_viv_il = had_il
+ 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
model%viv_phi_rest = rest_old
model%a = a_old
@@ -1227,6 +1807,25 @@ SUBROUTINE move_viv(back)
CALL MOVE_ALLOC(o_rec_phi, model%ws_recovery_viv_phi); CALL MOVE_ALLOC(o_rec_ms, model%ws_recovery_viv_ms)
CALL MOVE_ALLOC(o_snap_phi, model%snap_viv_phi); CALL MOVE_ALLOC(o_snap_ms, model%snap_viv_ms)
CALL MOVE_ALLOC(o_node, model%viv_node)
+ CALL MOVE_ALLOC(x_cx, model%vil_cx); CALL MOVE_ALLOC(x_k, model%vil_k)
+ CALL MOVE_ALLOC(x_al, model%vil_alpha); CALL MOVE_ALLOC(x_phi, model%vil_phi)
+ CALL MOVE_ALLOC(x_phi_eval, model%vil_phi_eval); CALL MOVE_ALLOC(x_rate, model%vil_rate)
+ CALL MOVE_ALLOC(x_ms, model%vil_ms); CALL MOVE_ALLOC(x_ms_next, model%vil_ms_next)
+ CALL MOVE_ALLOC(x_rec_phi, model%ws_recovery_vil_phi); CALL MOVE_ALLOC(x_rec_ms, model%ws_recovery_vil_ms)
+ CALL MOVE_ALLOC(x_snap_phi, model%snap_vil_phi); CALL MOVE_ALLOC(x_snap_ms, model%snap_vil_ms)
+ CALL MOVE_ALLOC(x_node, model%vil_node)
+ CALL MOVE_ALLOC(x_hcx, model%vhh_cx); CALL MOVE_ALLOC(x_hk, model%vhh_k)
+ CALL MOVE_ALLOC(w_st, model%wo_st); CALL MOVE_ALLOC(w_eps, model%wo_eps)
+ CALL MOVE_ALLOC(w_a, model%wo_a); CALL MOVE_ALLOC(w_s, model%wo_s)
+ CALL MOVE_ALLOC(w_qe, model%wo_q_eval); CALL MOVE_ALLOC(w_y0, model%wo_ydd0)
+ CALL MOVE_ALLOC(w_om, model%wo_om0); CALL MOVE_ALLOC(w_rec, model%ws_recovery_wo_s)
+ CALL MOVE_ALLOC(w_snap, model%snap_wo_s); CALL MOVE_ALLOC(w_tf, model%wo_tf)
+ CALL MOVE_ALLOC(p_amp, model%viv_amp); CALL MOVE_ALLOC(p_ampn, model%viv_amp_n)
+ CALL MOVE_ALLOC(p_dv, model%viv_dv)
+ CALL MOVE_ALLOC(p_cdy, model%viv_cdy)
+ CALL MOVE_ALLOC(p_ftf, model%viv_ftf); CALL MOVE_ALLOC(p_ftfe, model%viv_ftfe)
+ CALL MOVE_ALLOC(s_a, model%viv_sto_a); CALL MOVE_ALLOC(s_f, model%viv_sto_f)
+ CALL MOVE_ALLOC(s_p, model%viv_sto_p); CALL MOVE_ALLOC(s_n, model%viv_sto_n)
ELSE
CALL MOVE_ALLOC(model%viv_cl, o_cl); CALL MOVE_ALLOC(model%viv_k, o_k)
CALL MOVE_ALLOC(model%viv_cf, o_cf); CALL MOVE_ALLOC(model%viv_df, o_df)
@@ -1236,6 +1835,25 @@ SUBROUTINE move_viv(back)
CALL MOVE_ALLOC(model%ws_recovery_viv_phi, o_rec_phi); CALL MOVE_ALLOC(model%ws_recovery_viv_ms, o_rec_ms)
CALL MOVE_ALLOC(model%snap_viv_phi, o_snap_phi); CALL MOVE_ALLOC(model%snap_viv_ms, o_snap_ms)
CALL MOVE_ALLOC(model%viv_node, o_node)
+ CALL MOVE_ALLOC(model%vil_cx, x_cx); CALL MOVE_ALLOC(model%vil_k, x_k)
+ CALL MOVE_ALLOC(model%vil_alpha, x_al); CALL MOVE_ALLOC(model%vil_phi, x_phi)
+ CALL MOVE_ALLOC(model%vil_phi_eval, x_phi_eval); CALL MOVE_ALLOC(model%vil_rate, x_rate)
+ CALL MOVE_ALLOC(model%vil_ms, x_ms); CALL MOVE_ALLOC(model%vil_ms_next, x_ms_next)
+ CALL MOVE_ALLOC(model%ws_recovery_vil_phi, x_rec_phi); CALL MOVE_ALLOC(model%ws_recovery_vil_ms, x_rec_ms)
+ CALL MOVE_ALLOC(model%snap_vil_phi, x_snap_phi); CALL MOVE_ALLOC(model%snap_vil_ms, x_snap_ms)
+ CALL MOVE_ALLOC(model%vil_node, x_node)
+ CALL MOVE_ALLOC(model%vhh_cx, x_hcx); CALL MOVE_ALLOC(model%vhh_k, x_hk)
+ CALL MOVE_ALLOC(model%wo_st, w_st); CALL MOVE_ALLOC(model%wo_eps, w_eps)
+ CALL MOVE_ALLOC(model%wo_a, w_a); CALL MOVE_ALLOC(model%wo_s, w_s)
+ CALL MOVE_ALLOC(model%wo_q_eval, w_qe); CALL MOVE_ALLOC(model%wo_ydd0, w_y0)
+ CALL MOVE_ALLOC(model%wo_om0, w_om); CALL MOVE_ALLOC(model%ws_recovery_wo_s, w_rec)
+ CALL MOVE_ALLOC(model%snap_wo_s, w_snap); CALL MOVE_ALLOC(model%wo_tf, w_tf)
+ CALL MOVE_ALLOC(model%viv_amp, p_amp); CALL MOVE_ALLOC(model%viv_amp_n, p_ampn)
+ CALL MOVE_ALLOC(model%viv_dv, p_dv)
+ CALL MOVE_ALLOC(model%viv_cdy, p_cdy)
+ CALL MOVE_ALLOC(model%viv_ftf, p_ftf); CALL MOVE_ALLOC(model%viv_ftfe, p_ftfe)
+ CALL MOVE_ALLOC(model%viv_sto_a, s_a); CALL MOVE_ALLOC(model%viv_sto_f, s_f)
+ CALL MOVE_ALLOC(model%viv_sto_p, s_p); CALL MOVE_ALLOC(model%viv_sto_n, s_n)
END IF
END SUBROUTINE move_viv
END SUBROUTINE CD_HermiteCable_Dyn_Set_VIV
@@ -1249,18 +1867,45 @@ SUBROUTINE clear_viv(model)
model%viv_ms_next, model%ws_recovery_viv_phi, &
model%ws_recovery_viv_ms, model%snap_viv_phi, model%snap_viv_ms, &
model%viv_node)
+ IF (ALLOCATED(model%vil_k)) DEALLOCATE (model%vil_cx, model%vil_k, model%vil_alpha, model%vil_phi, &
+ model%vil_phi_eval, model%vil_rate, model%vil_ms, model%vil_ms_next, &
+ model%ws_recovery_vil_phi, model%ws_recovery_vil_ms, &
+ model%snap_vil_phi, model%snap_vil_ms, model%vil_node)
+ IF (ALLOCATED(model%vhh_k)) DEALLOCATE (model%vhh_cx, model%vhh_k)
+ IF (ALLOCATED(model%wo_s)) DEALLOCATE (model%wo_st, model%wo_eps, model%wo_a, model%wo_s, model%wo_q_eval, &
+ model%wo_ydd0, model%wo_om0, model%ws_recovery_wo_s, model%snap_wo_s)
+ IF (ALLOCATED(model%wo_tf)) DEALLOCATE (model%wo_tf)
+ model%wo_filter = .FALSE.
+ IF (ALLOCATED(model%viv_amp)) DEALLOCATE (model%viv_amp)
+ IF (ALLOCATED(model%viv_amp_n)) DEALLOCATE (model%viv_amp_n)
+ IF (ALLOCATED(model%viv_dv)) DEALLOCATE (model%viv_dv)
+ IF (ALLOCATED(model%viv_cdy)) DEALLOCATE (model%viv_cdy)
+ IF (ALLOCATED(model%viv_ftf)) DEALLOCATE (model%viv_ftf)
+ 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.
+ model%has_viv_il = .FALSE.
+ model%viv_wake = .FALSE.
model%viv_tw = CD_ZERO
END SUBROUTINE clear_viv
SUBROUTINE viv_drag_terms(model)
!! The VIV quantities taken from the drag configuration, set with VIV and again whenever the
!! drag is reconfigured: the lift scale viv_k = 1/2 rho D Cl of each element and the node
- !! diameter viv_dn, the length-weighted average over the node's lifting elements.
+ !! diameter viv_dn, the length-weighted average over the node's lifting elements, and the
+ !! in-line scale vil_k = 1/2 rho D C_vx.
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
INTEGER :: e, k
REAL(wp) :: wsum
- model%viv_k = 0.5_wp*model%rho_w*model%diam*model%viv_cl
+ DO e = 1, model%ne
+ model%viv_k(e) = 0.5_wp*model%rho_w*viv_diam(model, e)*model%viv_cl(e)
+ IF (model%has_viv_il) model%vil_k(e) = 0.5_wp*model%rho_w*viv_diam(model, e)*model%vil_cx(e)
+ IF (model%has_viv_il) model%vhh_k(e) = 0.5_wp*model%rho_w*viv_diam(model, e)*model%vhh_cx(e)
+ END DO
model%viv_dn = CD_ZERO
DO k = 1, model%nn
IF (.NOT. model%viv_node(k)) CYCLE
@@ -1268,97 +1913,512 @@ SUBROUTINE viv_drag_terms(model)
DO e = MAX(1, k - 1), MIN(model%ne, k)
IF (.NOT. (model%viv_cl(e) > CD_ZERO)) CYCLE
wsum = wsum + model%l0(e)
- model%viv_dn(k) = model%viv_dn(k) + model%l0(e)*model%diam(e)
+ model%viv_dn(k) = model%viv_dn(k) + model%l0(e)*viv_diam(model, e)
END DO
model%viv_dn(k) = model%viv_dn(k)/wsum
END DO
END SUBROUTINE viv_drag_terms
- SUBROUTINE viv_node_motion(model, k, yd, ydd, un, ok)
+ PURE REAL(wp) FUNCTION viv_diam(model, e) RESULT(d)
+ !! The diameter of the VIV model on element e: viv_dv(e) where it is set (> 0), else the drag
+ !! diameter.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ d = model%diam(e)
+ IF (.NOT. ALLOCATED(model%viv_dv)) RETURN
+ IF (model%viv_dv(e) > CD_ZERO) d = model%viv_dv(e)
+ END FUNCTION viv_diam
+
+ PURE REAL(wp) FUNCTION viv_elem_amplitude(model, e) RESULT(y0)
+ !! The smoothed cross-flow amplitude of element e [m]: the mean over its VIV end nodes (zero
+ !! without amplitude tables).
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ INTEGER :: k, n
+ y0 = CD_ZERO
+ IF (.NOT. model%has_viv_amp) RETURN
+ n = 0
+ DO k = e, e + 1
+ IF (.NOT. model%viv_node(k)) CYCLE
+ y0 = y0 + model%viv_ms(5, k)
+ n = n + 1
+ END DO
+ IF (n > 1) y0 = y0/REAL(n, wp)
+ END FUNCTION viv_elem_amplitude
+
+ PURE REAL(wp) FUNCTION elem_viv_k(model, e) RESULT(k)
+ !! The lift scale of element e: viv_k = 1/2 rho D Cl, or with an amplitude table 1/2 rho D C_v
+ !! with the table's C_v at the element's smoothed amplitude over its diameter.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ INTEGER :: n
+ k = model%viv_k(e)
+ IF (.NOT. model%has_viv_amp) RETURN
+ n = model%viv_amp_n(e)
+ IF (n == 0) RETURN
+ k = 0.5_wp*model%rho_w*viv_diam(model, e)*CD_VIV_Table(viv_elem_amplitude(model, e)/viv_diam(model, e), &
+ model%viv_amp(1, 1:n, e), model%viv_amp(2, 1:n, e))
+ END FUNCTION elem_viv_k
+
+ PURE REAL(wp) FUNCTION elem_cdn(model, e) RESULT(cdn)
+ !! The normal drag coefficient of element e: cdn, times the drag factor of its VIV amplitude
+ !! table at the element's smoothed amplitude where it has one.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ INTEGER :: n
+ cdn = model%cdn(e)
+ IF (.NOT. model%has_viv_amp) RETURN
+ n = model%viv_amp_n(e)
+ IF (n == 0) RETURN
+ cdn = cdn*CD_VIV_Table(viv_elem_amplitude(model, e)/viv_diam(model, e), model%viv_amp(1, 1:n, e), &
+ model%viv_amp(3, 1:n, e))
+ END FUNCTION elem_cdn
+
+ PURE REAL(wp) FUNCTION elem_cdy(model, e) RESULT(cdy)
+ !! The cross-flow damping coefficient C_dy = a + b y0/D of element e (Thorsen et al. 2016, Eq. 1),
+ !! at the element's smoothed amplitude over its VIV diameter; -1 where the element keeps the
+ !! Morison drag (the drag kernel's switch).
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ cdy = -CD_ONE
+ IF (.NOT. ALLOCATED(model%viv_cdy)) RETURN
+ IF (model%viv_cdy(1, e) < CD_ZERO) RETURN
+ cdy = model%viv_cdy(1, e) + model%viv_cdy(2, e)*viv_elem_amplitude(model, e)/viv_diam(model, e)
+ END FUNCTION elem_cdy
+
+ PURE REAL(wp) FUNCTION elem_cdy_lin(model, e) RESULT(cl)
+ !! The Morison-form cross-flow coefficient c Cdn of element e (its unamplified Cdn), 0 without.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ cl = CD_ZERO
+ IF (.NOT. ALLOCATED(model%viv_cdy)) RETURN
+ IF (model%viv_cdy(1, e) < CD_ZERO) RETURN
+ cl = model%viv_cdy(3, e)*model%cdn(e)
+ END FUNCTION elem_cdy_lin
+
+ REAL(wp) FUNCTION viv_node_ambient_yd(model, k) RESULT(yd)
+ !! Cross-flow velocity of node k across the ambient flow (current plus a held field) normal to
+ !! its tangent (the slope DOFs) at the committed state, the y' of the amplitude estimate
+ !! (CD_VIV_Ambient_Crossflow_Rate). With the flow frame (viv_ftf(k) > 0) the flow and the
+ !! node's velocity are both taken relative to the node's filtered velocity.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: k
+ REAL(wp) :: uu(3)
+ INTEGER :: i0
+ i0 = 6*(k - 1)
+ uu = model%current
+ IF (model%has_held_field) uu = uu + model%hf_u(:, k)
+ IF (model%viv_frame) THEN
+ IF (model%viv_ftf(k) > CD_ZERO) THEN
+ yd = CD_VIV_Ambient_Crossflow_Rate(model%q(i0 + 4:i0 + 6), model%v(i0 + 1:i0 + 3) - model%viv_ms(7:9, k), &
+ uu - model%viv_ms(7:9, k))
+ RETURN
+ END IF
+ END IF
+ yd = CD_VIV_Ambient_Crossflow_Rate(model%q(i0 + 4:i0 + 6), model%v(i0 + 1:i0 + 3), uu)
+ END FUNCTION viv_node_ambient_yd
+
+ PURE FUNCTION elem_frame_v(model, e) RESULT(vf)
+ !! The velocity of the flow frame of element e, which the ambient flow of its cross-flow damping
+ !! is taken relative to: the mean filtered velocity of its end nodes where the element has the
+ !! flow frame (viv_ftfe(e) > 0), else zero.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ REAL(wp) :: vf(3)
+ vf = CD_ZERO
+ IF (.NOT. model%viv_frame) RETURN
+ IF (.NOT. (model%viv_ftfe(e) > CD_ZERO)) RETURN
+ vf = 0.5_wp*(model%viv_ms(7:9, e) + model%viv_ms(7:9, e + 1))
+ END FUNCTION elem_frame_v
+
+ REAL(wp) FUNCTION viv_node_ambient_speed(model, k, vslow) RESULT(ua)
+ !! Speed of the ambient flow (current plus a held field) normal to node k's tangent (the slope
+ !! DOFs) at the committed state, relative to the velocity vslow (optional; the node's filtered
+ !! velocity of the wake filter); 0 for a degenerate tangent.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: k
+ REAL(wp), INTENT(IN), OPTIONAL :: vslow(3)
+ REAL(wp) :: uu(3), t(3), un(3), speed
+ INTEGER :: i0
+ i0 = 6*(k - 1)
+ uu = model%current
+ IF (model%has_held_field) uu = uu + model%hf_u(:, k)
+ IF (PRESENT(vslow)) uu = uu - vslow
+ speed = NORM2(model%q(i0 + 4:i0 + 6))
+ ua = CD_ZERO
+ IF (.NOT. (speed > CD_ZERO)) RETURN
+ t = model%q(i0 + 4:i0 + 6)/speed
+ un = uu - DOT_PRODUCT(t, uu)*t
+ ua = NORM2(un)
+ END FUNCTION viv_node_ambient_speed
+
+ SUBROUTINE viv_node_motion(model, k, yd, ydd, un, ok, xd, xdd)
!! Cross-flow velocity and acceleration of node k at the committed state, along its own
- !! tangent (the slope DOFs), in the flow the drag sees there (current plus a held field).
+ !! tangent (the slope DOFs), in the flow the drag sees there (current plus a held field);
+ !! optionally (both or neither) the in-line ones. With the flow frame (viv_ftf(k) > 0) the
+ !! velocity is the node's velocity relative to its filtered velocity vbar (the relative flow,
+ !! and so the axes and U, unchanged): a cable moved through still water then moves across the
+ !! flow only by its own VIV, as the held cable in the moving water does. The acceleration stays
+ !! the node's: vbar changes slowly, and its rate (v - vbar)/Tf would carry the VIV velocity.
TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
INTEGER, INTENT(IN) :: k
REAL(wp), INTENT(OUT) :: yd, ydd, un
LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), INTENT(OUT), OPTIONAL :: xd, xdd
REAL(wp) :: uu(3)
INTEGER :: i0
i0 = 6*(k - 1)
uu = model%current
IF (model%has_held_field) uu = uu + model%hf_u(:, k)
- CALL CD_VIV_Crossflow_Along(model%q(i0 + 4:i0 + 6), model%v(i0 + 1:i0 + 3), model%a(i0 + 1:i0 + 3), uu, &
- yd, ydd, un, ok)
+ IF (model%viv_frame) THEN
+ IF (model%viv_ftf(k) > CD_ZERO) THEN
+ ! absent xd, xdd pass on absent
+ CALL CD_VIV_Crossflow_Along(model%q(i0 + 4:i0 + 6), model%v(i0 + 1:i0 + 3) - model%viv_ms(7:9, k), &
+ model%a(i0 + 1:i0 + 3), uu - model%viv_ms(7:9, k), yd, ydd, un, ok, xd, xdd)
+ RETURN
+ END IF
+ END IF
+ IF (PRESENT(xd)) THEN
+ CALL CD_VIV_Crossflow_Along(model%q(i0 + 4:i0 + 6), model%v(i0 + 1:i0 + 3), model%a(i0 + 1:i0 + 3), uu, &
+ yd, ydd, un, ok, xd, xdd)
+ ELSE
+ CALL CD_VIV_Crossflow_Along(model%q(i0 + 4:i0 + 6), model%v(i0 + 1:i0 + 3), model%a(i0 + 1:i0 + 3), uu, &
+ yd, ydd, un, ok)
+ END IF
END SUBROUTINE viv_node_motion
+ PURE REAL(wp) FUNCTION viv_theta(model, k) RESULT(theta)
+ !! Node k's travelled non-dimensional distance of the stochastic band centre (the last row of
+ !! viv_ms; 0 without it).
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: k
+ theta = CD_ZERO
+ IF (model%viv_sto) theta = model%viv_ms(SIZE(model%viv_ms, 1), k)
+ END FUNCTION viv_theta
+
+ PURE REAL(wp) FUNCTION viv_centre(model, k, theta) RESULT(centre)
+ !! Node k's band centre: viv_cf(k), or with a stochastic band centre its process at the
+ !! travelled distance theta (CD_VIV_Sto_Centre).
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: k
+ REAL(wp), INTENT(IN) :: theta
+ INTEGER :: n
+ centre = model%viv_cf(k)
+ IF (.NOT. model%viv_sto) RETURN
+ n = model%viv_sto_n(k)
+ IF (n < 1) RETURN
+ centre = CD_VIV_Sto_Centre(model%viv_cf(k), model%viv_sto_a(k), model%viv_sto_f(1:n, k), &
+ model%viv_sto_p(1:n, k), theta)
+ END FUNCTION viv_centre
+
+ PURE INTEGER FUNCTION viv_pred_row(model) RESULT(r)
+ !! The row of viv_ms holding the step predictor (CableDyn_VIV): after the motion statistics on a
+ !! synchronisation-model cable (the in-line rate in the row after it), row 2 on a wake cable.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ r = 2
+ 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
+
+ SUBROUTINE viv_node_motion_mid(model, k, dt, vf, yd, ydd, un, ok, xd, xdd)
+ !! Cross-flow velocity and acceleration of node k at the mid-point of the step just committed,
+ !! as viv_node_motion: the tangent the mean of the step-start (ws_qn, ws_vn) and the committed
+ !! end one, the velocity and acceleration the step means (q_n+1 - q_n)/dt and (v_n+1 - v_n)/dt
+ !! (the means of the velocity and of its derivative, so a harmonic motion keeps its phase
+ !! between them exactly), the node's velocity and the flow relative to vf (the flow frame's
+ !! velocity at the mid-point; zero without it); optionally (both or neither) the in-line ones.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: k
+ REAL(wp), INTENT(IN) :: dt, vf(3)
+ REAL(wp), INTENT(OUT) :: yd, ydd, un
+ LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), INTENT(OUT), OPTIONAL :: xd, xdd
+ REAL(wp) :: uu(3), tm(3), vm(3), am(3)
+ INTEGER :: i0
+ i0 = 6*(k - 1)
+ uu = model%current
+ IF (model%has_held_field) uu = uu + model%hf_u(:, k)
+ tm = 0.5_wp*(model%ws_qn(i0 + 4:i0 + 6) + model%q(i0 + 4:i0 + 6))
+ vm = (model%q(i0 + 1:i0 + 3) - model%ws_qn(i0 + 1:i0 + 3))/dt - vf
+ am = (model%v(i0 + 1:i0 + 3) - model%ws_vn(i0 + 1:i0 + 3))/dt
+ IF (PRESENT(xd)) THEN
+ CALL CD_VIV_Crossflow_Along(tm, vm, am, uu - vf, yd, ydd, un, ok, xd, xdd)
+ ELSE
+ CALL CD_VIV_Crossflow_Along(tm, vm, am, uu - vf, yd, ydd, un, ok)
+ END IF
+ END SUBROUTINE viv_node_motion_mid
+
+ SUBROUTINE viv_seed_predictor(model)
+ !! The step predictor of a newly installed VIV model (viv_pred_row of viv_ms and its next,
+ !! recovery and snapshot copies): the phase rates at the present state, from the node's
+ !! velocity and consistent acceleration and the mean squares at zero (MoorDyn's unnormalised
+ !! start), and on a wake cable the cross-flow acceleration there. Only the first step predicts
+ !! from it; every step then leaves the rate at its own mid-point (viv_step_end).
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
+ INTEGER :: k, ir
+ REAL(wp) :: yd, ydd, un, xd, xdd
+ LOGICAL :: ok
+ ir = viv_pred_row(model)
+ DO k = 1, model%nn
+ IF (.NOT. model%viv_node(k)) CYCLE
+ CALL viv_node_motion(model, k, yd, ydd, un, ok, xd, xdd)
+ IF (.NOT. (ok .AND. CD_Is_Finite(yd) .AND. CD_Is_Finite(ydd))) THEN
+ yd = CD_ZERO; ydd = CD_ZERO; xd = CD_ZERO; xdd = CD_ZERO
+ END IF
+ IF (model%viv_wake) THEN
+ model%viv_ms(ir, k) = ydd
+ CYCLE
+ END IF
+ model%viv_ms(ir, k) = CD_VIV_Phase_Rate(yd, ydd, CD_ZERO, CD_ZERO, model%viv_phi(k), un, model%viv_dn(k), &
+ viv_centre(model, k, viv_theta(model, k)), model%viv_df(k), &
+ phi_rest=model%viv_phi_rest)
+ IF (.NOT. model%has_viv_il) CYCLE
+ IF (.NOT. model%vil_node(k)) CYCLE
+ model%viv_ms(ir + 1, k) = CD_VIV_Inline_Phase_Rate(xd, xdd, CD_ZERO, CD_ZERO, model%vil_phi(k), &
+ model%viv_ms(ir, k), model%vil_alpha(k))
+ END DO
+ model%viv_ms_next = model%viv_ms
+ model%ws_recovery_viv_ms = model%viv_ms
+ model%snap_viv_ms = model%viv_ms
+ END SUBROUTINE viv_seed_predictor
+
SUBROUTINE viv_step_begin(model, dt, ErrStat, ErrMsg)
- !! Step-start VIV quantities from the committed state (q, v, a, phi): the mean squares with
- !! the step-start cross-flow sample (viv_ms_next), the phase rate (viv_rate) and the phase the
- !! step's lift takes (viv_phi_eval): the explicit phase at t_{n+1} under the force blend,
- !! whose in-step force is R(q_{n+1}, v_{n+1}) (F_n keeps phi_n), and at the generalised-alpha
- !! level under the configuration blend.
+ !! Step-start VIV quantities from the committed state (q, v, phi and the step predictor, the
+ !! phase rate at the mid-point of the last step in viv_pred_row of viv_ms): that rate
+ !! (viv_rate) and the phase the step's lift takes (viv_phi_eval): the explicit phase at
+ !! t_{n+1} under the force blend, whose in-step force is R(q_{n+1}, v_{n+1}) (F_n keeps phi_n),
+ !! and at the generalised-alpha level under the configuration blend. The committed
+ !! acceleration is not sampled (see the EI = 0 model's viv_step_begin): it is the cable's to
+ !! O(dt) only and at rho_inf = 1 carries an undamped alternating mode. On a wake cable the wake
+ !! state is predicted at the evaluation point under the last step's mid-point acceleration
+ !! (row 2 of viv_ms) and the step-start wake frequency.
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
REAL(wp), INTENT(IN) :: dt
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: k
- REAL(wp) :: w, frac, yd, ydd, un
+ INTEGER :: k, ir
+ REAL(wp) :: frac, yd, ydd, un, sw(2)
LOGICAL :: ok
ErrStat = CD_HCDYN_OK; ErrMsg = ''
IF (.NOT. (model%viv_tw > CD_ZERO)) model%viv_tw = REAL(CD_VIV_NM, wp)*dt
- w = MIN(CD_ONE, dt/model%viv_tw)
frac = CD_ONE
IF (.NOT. model%force_blend) frac = CD_ONE - model%alpha_f
+ ir = viv_pred_row(model)
+ IF (model%viv_wake) THEN
+ model%wo_q_eval = model%wo_s(1, :)
+ DO k = 1, model%nn
+ IF (.NOT. model%viv_node(k)) CYCLE
+ CALL viv_node_motion(model, k, yd, ydd, un, ok)
+ IF (.NOT. ok) THEN
+ ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'VIV wake oscillator: degenerate node tangent'; RETURN
+ END IF
+ ! the wake frequency of the ambient flow normal to the line (the free stream of the
+ ! paper), not of the relative flow, which the cable's own cross-flow motion modulates; with
+ ! the wake filter, of the flow relative to the node's slowly filtered motion
+ IF (model%wo_filter) THEN
+ IF (model%wo_tf(k) > CD_ZERO) THEN
+ model%wo_om0(k) = CD_VIV_TWO_PI*model%wo_st(k)*viv_node_ambient_speed(model, k, model%wo_s(3:5, k))/ &
+ model%viv_dn(k)
+ ELSE
+ model%wo_om0(k) = CD_VIV_TWO_PI*model%wo_st(k)*viv_node_ambient_speed(model, k)/model%viv_dn(k)
+ END IF
+ ELSE
+ model%wo_om0(k) = CD_VIV_TWO_PI*model%wo_st(k)*viv_node_ambient_speed(model, k)/model%viv_dn(k)
+ END IF
+ model%wo_ydd0(k) = model%viv_ms(ir, k)
+ sw = model%wo_s(1:2, k)
+ CALL CD_VIV_Wake_Advance(sw, model%wo_om0(k), model%wo_eps(k), model%wo_a(k)/model%viv_dn(k), &
+ model%wo_ydd0(k), model%wo_ydd0(k), frac*dt)
+ model%wo_q_eval(k) = sw(1)
+ END DO
+ RETURN
+ END IF
model%viv_rate = CD_ZERO
model%viv_ms_next = model%viv_ms
model%viv_phi_eval = model%viv_phi
+ IF (model%has_viv_il) THEN
+ model%vil_rate = CD_ZERO
+ model%vil_ms_next = model%vil_ms
+ model%vil_phi_eval = model%vil_phi
+ END IF
DO k = 1, model%nn
IF (.NOT. model%viv_node(k)) CYCLE
CALL viv_node_motion(model, k, yd, ydd, un, ok)
IF (.NOT. ok) THEN
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'VIV phase: degenerate node tangent'; RETURN
END IF
- model%viv_ms_next(1, k) = CD_VIV_Mean_Square(model%viv_ms(1, k), yd, w)
- model%viv_ms_next(2, k) = CD_VIV_Mean_Square(model%viv_ms(2, k), ydd, w)
- model%viv_rate(k) = CD_VIV_Phase_Rate(yd, ydd, model%viv_ms_next(1, k), model%viv_ms_next(2, k), &
- model%viv_phi(k), un, model%viv_dn(k), model%viv_cf(k), &
- model%viv_df(k), phi_rest=model%viv_phi_rest)
+ model%viv_rate(k) = model%viv_ms(ir, k)
model%viv_phi_eval(k) = model%viv_phi(k) + frac*dt*model%viv_rate(k)
+ IF (.NOT. model%has_viv_il) CYCLE
+ IF (.NOT. model%vil_node(k)) CYCLE
+ model%vil_rate(k) = model%viv_ms(ir + 1, k)
+ model%vil_phi_eval(k) = model%vil_phi(k) + frac*dt*model%vil_rate(k)
END DO
END SUBROUTINE viv_step_begin
SUBROUTINE viv_step_end(model, dt)
- !! Commit the VIV state at the converged end state (q, v, a just committed): the phase by
- !! Heun's rule phi_n + dt/2 (rate_n + rate(state_n+1, phi_n + dt rate_n)), with the end-state
- !! sample added to the mean squares for that rate only, and the step-start mean squares. The
- !! lift then takes the committed phase again. It cannot fail, so the step it ends is never
- !! left half committed: a node whose end tangent is degenerate, or whose end rate is not
- !! finite, takes the step-start rate over the step (phi_n + dt rate_n).
+ !! Commit the VIV state at the converged end state (q, v just committed; the step-start state
+ !! in ws_qn, ws_vn): the phase by the implicit mid-point rule, one fixed-point pass from the
+ !! step predictor rate_p (rate_1 = rate(mid-point motion, phi_n + dt/2 rate_p), phi_n + dt
+ !! rate(mid-point motion, phi_n + dt/2 rate_1)), on the node's cross-flow motion at the step's
+ !! mid-point with the velocity and acceleration over the step (viv_node_motion_mid), the mean
+ !! squares by the mid-point rule, the flow frame's and the wake filter's velocities exactly for
+ !! the velocity linear over the step, and the mid-point rate as the next step's predictor (as
+ !! the EI = 0 model's viv_step_end). The lift then takes the committed phase again. It cannot
+ !! fail, so the step it ends is never left half committed: a node whose mid-point tangent is
+ !! degenerate, or whose rate is not finite, takes the predicted rate over the step
+ !! (phi_n + dt rate_p), and a wake node the predictor's acceleration.
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
REAL(wp), INTENT(IN) :: dt
- INTEGER :: k
- REAL(wp) :: w, yd, ydd, un, ms1, ms2, rate_end
- LOGICAL :: ok
- w = MIN(CD_ONE, dt/model%viv_tw)
+ INTEGER :: k, ir, i0, ip
+ REAL(wp) :: wf, wh, yd, ydd, un, ms1, ms2, rate_mid, xd, xdd, rate_mid_x, sw(2), st(4), yda, vf(3), om, ap
+ REAL(wp) :: th, dth, cfm
+ LOGICAL :: ok, il
+ ir = viv_pred_row(model)
+ IF (model%viv_wake) THEN
+ ! the wake state over the step under the mid-point cross-flow acceleration (held over the
+ ! step, its integral exact) at the mean of the start and end wake frequencies; a non-finite
+ ! result keeps the step-start frequency and the predictor's forcing
+ DO k = 1, model%nn
+ IF (.NOT. model%viv_node(k)) CYCLE
+ i0 = 6*(k - 1)
+ ap = model%wo_ydd0(k)
+ CALL viv_node_motion_mid(model, k, dt, [CD_ZERO, CD_ZERO, CD_ZERO], yd, ydd, un, ok)
+ IF (.NOT. (ok .AND. CD_Is_Finite(ydd))) ydd = ap
+ ! the filtered velocity, exact for the first-order filter of the velocity linear over the
+ ! step (a non-finite end velocity keeps it), and the wake frequency at the step end
+ IF (model%wo_filter) THEN
+ IF (model%wo_tf(k) > CD_ZERO .AND. CD_All_Finite(model%v(i0 + 1:i0 + 3))) &
+ model%wo_s(3:5, k) = CD_VIV_Filter_Linear(model%wo_s(3:5, k), model%ws_vn(i0 + 1:i0 + 3), &
+ model%v(i0 + 1:i0 + 3), dt/model%wo_tf(k))
+ END IF
+ om = viv_node_ambient_speed(model, k)
+ IF (model%wo_filter) THEN
+ IF (model%wo_tf(k) > CD_ZERO) om = viv_node_ambient_speed(model, k, model%wo_s(3:5, k))
+ END IF
+ om = 0.5_wp*(model%wo_om0(k) + CD_VIV_TWO_PI*model%wo_st(k)*om/model%viv_dn(k))
+ IF (.NOT. CD_Is_Finite(om)) om = model%wo_om0(k)
+ sw = model%wo_s(1:2, k)
+ CALL CD_VIV_Wake_Advance(sw, om, model%wo_eps(k), model%wo_a(k)/model%viv_dn(k), ydd, ydd, dt)
+ IF (.NOT. (CD_Is_Finite(sw(1)) .AND. CD_Is_Finite(sw(2)))) THEN
+ ydd = ap
+ sw = model%wo_s(1:2, k)
+ CALL CD_VIV_Wake_Advance(sw, model%wo_om0(k), model%wo_eps(k), model%wo_a(k)/model%viv_dn(k), &
+ ydd, ydd, dt)
+ END IF
+ model%wo_s(1:2, k) = sw
+ model%viv_ms(ir, k) = ydd
+ END DO
+ model%wo_q_eval = model%wo_s(1, :)
+ model%viv_ms_next = model%viv_ms
+ RETURN
+ END IF
+ wf = CD_VIV_Mean_Square_Weight(dt/model%viv_tw)
+ wh = CD_VIV_Mean_Square_Weight(0.5_wp*dt/model%viv_tw)
DO k = 1, model%nn
IF (.NOT. model%viv_node(k)) CYCLE
- rate_end = model%viv_rate(k)
- CALL viv_node_motion(model, k, yd, ydd, un, ok)
+ i0 = 6*(k - 1)
+ il = .FALSE.
+ IF (model%has_viv_il) il = model%vil_node(k)
+ rate_mid = model%viv_rate(k)
+ rate_mid_x = CD_ZERO
+ IF (il) rate_mid_x = model%vil_rate(k)
+ IF (model%has_viv_amp) THEN
+ ! the amplitude estimate over the step on the cross-flow velocity across the ambient flow
+ ! (with the flow frame, relative to the step-start filtered velocity); a non-finite one
+ ! holds y' (no crossing)
+ st = model%viv_ms(3:6, k)
+ yda = viv_node_ambient_yd(model, k)
+ IF (.NOT. CD_Is_Finite(yda)) yda = st(4)
+ CALL CD_VIV_Amplitude_Update(st, yda, dt)
+ model%viv_ms_next(3:6, k) = st
+ END IF
+ ! the flow frame's velocity at the mid-point: the filtered velocity at the step end (exact
+ ! for the first-order filter of the velocity linear over the step; a non-finite end velocity
+ ! keeps it) averaged with the step-start one
+ 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))) 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
+ CALL viv_node_motion_mid(model, k, dt, vf, yd, ydd, un, ok, xd, xdd)
+ ! the stochastic band centre at the mid-point of the travelled distance; theta moves on with
+ ! the step's shedding speed only where the step gives a finite phase rate
+ th = viv_theta(model, k)
+ dth = CD_ZERO
+ IF (model%viv_sto) model%viv_ms_next(SIZE(model%viv_ms, 1), k) = th
IF (ok) THEN
- ms1 = CD_VIV_Mean_Square(model%viv_ms_next(1, k), yd, w)
- ms2 = CD_VIV_Mean_Square(model%viv_ms_next(2, k), ydd, w)
- rate_end = CD_VIV_Phase_Rate(yd, ydd, ms1, ms2, model%viv_phi(k) + dt*model%viv_rate(k), un, &
- model%viv_dn(k), model%viv_cf(k), model%viv_df(k), phi_rest=model%viv_phi_rest)
- IF (.NOT. CD_Is_Finite(rate_end)) rate_end = model%viv_rate(k)
+ IF (model%viv_sto) dth = dt*un/model%viv_dn(k)
+ cfm = viv_centre(model, k, th + 0.5_wp*dth)
+ ms1 = CD_VIV_Mean_Square(model%viv_ms(1, k), yd, wh)
+ ms2 = CD_VIV_Mean_Square(model%viv_ms(2, k), ydd, wh)
+ ! the implicit mid-point rule by one fixed-point pass: the mid-point phase from the
+ ! predictor, then from the rate it gives
+ DO ip = 1, 2
+ rate_mid = CD_VIV_Phase_Rate(yd, ydd, ms1, ms2, model%viv_phi(k) + 0.5_wp*dt*rate_mid, un, &
+ model%viv_dn(k), cfm, model%viv_df(k), phi_rest=model%viv_phi_rest)
+ END DO
+ IF (CD_Is_Finite(rate_mid)) THEN
+ IF (model%viv_sto) model%viv_ms_next(SIZE(model%viv_ms, 1), k) = th + dth
+ model%viv_ms_next(1, k) = CD_VIV_Mean_Square(model%viv_ms(1, k), yd, wf)
+ model%viv_ms_next(2, k) = CD_VIV_Mean_Square(model%viv_ms(2, k), ydd, wf)
+ ELSE
+ rate_mid = model%viv_rate(k)
+ END IF
+ IF (il) THEN
+ ! the in-line rate at the mid-point is slaved to the mid-point cross-flow rate (Eq. 6)
+ ms1 = CD_VIV_Mean_Square(model%vil_ms(1, k), xd, wh)
+ ms2 = CD_VIV_Mean_Square(model%vil_ms(2, k), xdd, wh)
+ DO ip = 1, 2
+ rate_mid_x = CD_VIV_Inline_Phase_Rate(xd, xdd, ms1, ms2, model%vil_phi(k) + 0.5_wp*dt*rate_mid_x, &
+ rate_mid, model%vil_alpha(k))
+ END DO
+ IF (CD_Is_Finite(rate_mid_x)) THEN
+ model%vil_ms_next(1, k) = CD_VIV_Mean_Square(model%vil_ms(1, k), xd, wf)
+ model%vil_ms_next(2, k) = CD_VIV_Mean_Square(model%vil_ms(2, k), xdd, wf)
+ ELSE
+ rate_mid_x = model%vil_rate(k)
+ END IF
+ END IF
+ END IF
+ model%viv_ms_next(ir, k) = rate_mid
+ model%viv_phi(k) = CD_VIV_Wrap_Phase(model%viv_phi(k) + dt*rate_mid)
+ IF (il) THEN
+ model%viv_ms_next(ir + 1, k) = rate_mid_x
+ model%vil_phi(k) = CD_VIV_Wrap_Phase(model%vil_phi(k) + dt*rate_mid_x)
END IF
- model%viv_phi(k) = CD_VIV_Wrap_Phase(model%viv_phi(k) + 0.5_wp*dt*(model%viv_rate(k) + rate_end))
END DO
model%viv_ms = model%viv_ms_next
model%viv_phi_eval = model%viv_phi
+ IF (model%has_viv_il) THEN
+ model%vil_ms = model%vil_ms_next
+ model%vil_phi_eval = model%vil_phi
+ END IF
END SUBROUTINE viv_step_end
SUBROUTINE viv_element_lift(model, q_cfg, v_cfg, e, flift, ErrStat, ErrMsg, djq, djv)
!! The VIV lift load of element e at the phase viv_phi_eval in the flow the drag sees (current,
- !! held field), with its Jacobians djq, djv (both or neither).
+ !! held field), with its Jacobians djq, djv (both or neither); with in-line VIV it includes the
+ !! in-line shedding force at the phase vil_phi_eval, and the higher-harmonic force of
+ !! Ulveseter et al. (2019), the lift's form at the phase sum viv_phi_eval + vil_phi_eval.
TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
REAL(wp), INTENT(IN) :: q_cfg(:), v_cfg(:)
INTEGER, INTENT(IN) :: e
@@ -1366,7 +2426,8 @@ SUBROUTINE viv_element_lift(model, q_cfg, v_cfg, e, flift, ErrStat, ErrMsg, djq,
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
REAL(wp), INTENT(OUT), OPTIONAL :: djq(12, 12), djv(12, 12)
- REAL(wp) :: qe(12), ve(12), uu(3), wl, kn(2)
+ REAL(wp) :: qe(12), ve(12), uu(3), wl, kn(2), knx(2)
+ LOGICAL :: il
flift = CD_ZERO
IF (PRESENT(djq)) THEN
djq = CD_ZERO; djv = CD_ZERO
@@ -1381,19 +2442,88 @@ SUBROUTINE viv_element_lift(model, q_cfg, v_cfg, e, flift, ErrStat, ErrMsg, djq,
uu = uu + 0.5_wp*(model%hf_u(:, e) + model%hf_u(:, e + 1))
wl = 0.5_wp*(model%hf_wl(e) + model%hf_wl(e + 1))
END IF
- kn = model%viv_k(e)*[COS(model%viv_phi_eval(e)), COS(model%viv_phi_eval(e + 1))]
- IF (PRESENT(djq)) THEN
- CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, model%l0(e), uu, wl, kn, flift, djq, djv, ErrStat, ErrMsg)
+ IF (model%viv_wake) THEN
+ kn = model%viv_k(e)*[model%wo_q_eval(e), model%wo_q_eval(e + 1)]
+ ELSE
+ kn = elem_viv_k(model, e)*[COS(model%viv_phi_eval(e)), COS(model%viv_phi_eval(e + 1))]
+ END IF
+ il = .FALSE.
+ IF (model%has_viv_il) il = model%vil_k(e) > CD_ZERO
+ IF (il) THEN
+ IF (model%vhh_k(e) > CD_ZERO) THEN
+ kn = kn + model%vhh_k(e)*[COS(model%viv_phi_eval(e) + model%vil_phi_eval(e)), &
+ COS(model%viv_phi_eval(e + 1) + model%vil_phi_eval(e + 1))]
+ END IF
+ knx = model%vil_k(e)*[COS(model%vil_phi_eval(e)), COS(model%vil_phi_eval(e + 1))]
+ IF (PRESENT(djq)) THEN
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, model%l0(e), uu, wl, kn, flift, djq, djv, ErrStat, ErrMsg, &
+ kx_node=knx, diam=model%diam(e))
+ ELSE
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, model%l0(e), uu, wl, kn, flift, ErrStat=ErrStat, &
+ ErrMsg=ErrMsg, kx_node=knx, diam=model%diam(e))
+ END IF
+ ELSE IF (PRESENT(djq)) THEN
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, model%l0(e), uu, wl, kn, flift, djq, djv, ErrStat, ErrMsg, &
+ diam=model%diam(e))
ELSE
CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, model%l0(e), uu, wl, kn, flift, ErrStat=ErrStat, &
- ErrMsg=ErrMsg)
+ ErrMsg=ErrMsg, diam=model%diam(e))
END IF
END SUBROUTINE viv_element_lift
+ SUBROUTINE element_drag_load(model, e, qe, ve, l0, t_eval, fdrag, ErrStat, ErrMsg)
+ !! The Morison drag load of element e (generalised, 12) at element state (qe, ve) and
+ !! unstretched length l0, in the flow the drag configuration gives at time t_eval: the current
+ !! plus the regular or irregular wave kinematics, or plus the held field's element average.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ REAL(wp), INTENT(IN) :: qe(12), ve(12), l0, t_eval
+ REAL(wp), INTENT(OUT) :: fdrag(12)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER :: es
+ IF (model%has_wave .AND. model%wv_ncomp > 0) THEN
+ CALL CD_HermiteCable_Drag_Element(qe, ve, l0, model%current, model%waterline_z, &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
+ fdrag, ErrStat=es, ErrMsg=ErrMsg, &
+ wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=t_eval, &
+ wvc_amp=model%wv_ampc, wvc_om=model%wv_omc, &
+ wvc_k=model%wv_kc, wvc_ph=model%wv_phc, &
+ wvc_e2kd=model%wv_e2kd, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
+ ELSE IF (model%has_wave) THEN
+ CALL CD_HermiteCable_Drag_Element(qe, ve, l0, model%current, model%waterline_z, &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
+ fdrag, ErrStat=es, ErrMsg=ErrMsg, &
+ wv_h=model%wv_h, wv_om=model%wv_om, wv_k=model%wv_k, &
+ wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=t_eval, &
+ cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
+ ELSE IF (model%has_held_field) THEN
+ CALL CD_HermiteCable_Drag_Element(qe, ve, l0, &
+ model%current + 0.5_wp*(model%hf_u(:, e) + model%hf_u(:, e + 1)), &
+ 0.5_wp*(model%hf_wl(e) + model%hf_wl(e + 1)), &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
+ fdrag, ErrStat=es, ErrMsg=ErrMsg, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
+ ELSE
+ CALL CD_HermiteCable_Drag_Element(qe, ve, l0, model%current, model%waterline_z, &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
+ fdrag, ErrStat=es, ErrMsg=ErrMsg, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
+ END IF
+ ErrStat = es
+ END SUBROUTINE element_drag_load
+
SUBROUTINE CD_HermiteCable_Dyn_VIV_Node_Lift(model, lift, ErrStat, ErrMsg)
!! The VIV lift on every node at the committed state [N] (3, nn), in the model frame: the
!! translational components of the elements' consistent lift loads, summed at the nodes
- !! (MoorDyn's nodal lift on a lumped line). Zero on a cable without VIV.
+ !! (MoorDyn's nodal lift on a lumped line), with the in-line shedding force where it is on.
+ !! Zero on a cable without VIV.
TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
REAL(wp), INTENT(OUT) :: lift(:, :)
INTEGER, INTENT(OUT) :: ErrStat
@@ -1417,6 +2547,107 @@ SUBROUTINE CD_HermiteCable_Dyn_VIV_Node_Lift(model, lift, ErrStat, ErrMsg)
END DO
END SUBROUTINE CD_HermiteCable_Dyn_VIV_Node_Lift
+ SUBROUTINE CD_HermiteCable_Dyn_VIV_Amplitude(model, amp, ErrStat, ErrMsg)
+ !! The smoothed cross-flow amplitude estimate of every node at the committed state [m] (nn;
+ !! Thorsen et al. 2016, Eq. 9); zero on nodes without VIV and on a cable without amplitude
+ !! tables.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ REAL(wp), INTENT(OUT) :: amp(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ amp = CD_ZERO
+ ErrStat = CD_HCDYN_OK; ErrMsg = ''
+ IF (.NOT. model%initialized) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_VIV_Amplitude: model not initialised'; RETURN
+ END IF
+ IF (SIZE(amp) /= model%nn) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_VIV_Amplitude: amp must have one value per node'
+ RETURN
+ END IF
+ IF (.NOT. model%has_viv_amp) RETURN
+ amp = MERGE(model%viv_ms(5, :), CD_ZERO, model%viv_node)
+ END SUBROUTINE CD_HermiteCable_Dyn_VIV_Amplitude
+
+ SUBROUTINE CD_HermiteCable_Dyn_Load_Power(model, p_viv, p_drag, p_damp, ErrStat, ErrMsg)
+ !! The power [W] three loads deliver to the cable at the committed state, per node (nn): the
+ !! VIV loads (cross-flow lift, and the in-line force where it is on), the hydrodynamic drag
+ !! (the cable's Morison drag and the attachments' drag) and the structural damping (the axial
+ !! and bending dashpots, BA and Bb). An element's generalised load f (12) delivers f . v_e,
+ !! half to each of its two nodes, so the node values sum to the exact power of the load; an
+ !! attachment's drag delivers f . v at its node. The damping power of every element, and so of
+ !! every node, is never positive. The torsional damping Bt is not included.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ REAL(wp), INTENT(OUT) :: p_viv(:), p_drag(:), p_damp(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ REAL(wp) :: qe(12), ve(12), fe(12), rk(3), jrel(3, 3), jtan(3, 3), fd(3)
+ INTEGER :: e, k, base
+ LOGICAL :: has_jac
+ p_viv = CD_ZERO
+ p_drag = CD_ZERO
+ p_damp = CD_ZERO
+ ErrStat = CD_HCDYN_OK; ErrMsg = ''
+ IF (.NOT. model%initialized) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Load_Power: model not initialised'; RETURN
+ END IF
+ IF (SIZE(p_viv) /= model%nn .OR. SIZE(p_drag) /= model%nn .OR. SIZE(p_damp) /= model%nn) THEN
+ ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Load_Power: the powers must have one entry per node'
+ RETURN
+ END IF
+ DO e = 1, model%ne
+ qe(1:6) = model%q(6*(e - 1) + 1:6*e); qe(7:12) = model%q(6*e + 1:6*(e + 1))
+ ve(1:6) = model%v(6*(e - 1) + 1:6*e); ve(7:12) = model%v(6*e + 1:6*(e + 1))
+ IF (model%has_axial_damping .OR. model%has_bend_damping .OR. model%has_mass_damping) THEN
+ ! an internal force: the load on the nodes is -fe
+ CALL structural_damping_element(model, e, qe, ve, fe, ErrStat, ErrMsg)
+ IF (ErrStat /= CD_HCDYN_OK) THEN
+ ErrMsg = 'CD_HermiteCable_Dyn_Load_Power: '//TRIM(ErrMsg); RETURN
+ END IF
+ CALL add_shares(p_damp, -fe)
+ END IF
+ IF (model%has_drag) THEN
+ CALL element_drag_load(model, e, qe, ve, model%l0(e), model%t, fe, ErrStat, ErrMsg)
+ IF (ErrStat /= CD_HCDYN_OK) THEN
+ ErrMsg = 'CD_HermiteCable_Dyn_Load_Power: '//TRIM(ErrMsg); RETURN
+ END IF
+ CALL add_shares(p_drag, fe)
+ END IF
+ IF (model%has_viv) THEN
+ CALL viv_element_lift(model, model%q, model%v, e, fe, ErrStat, ErrMsg)
+ IF (ErrStat /= CD_HCDYN_OK) THEN
+ ErrMsg = 'CD_HermiteCable_Dyn_Load_Power: '//TRIM(ErrMsg); RETURN
+ END IF
+ CALL add_shares(p_viv, fe)
+ END IF
+ END DO
+ IF (ALLOCATED(model%att_node)) THEN
+ DO k = 1, SIZE(model%att_node)
+ CALL attachment_residual(model, k, model%q, model%v, .FALSE., rk, has_jac, jrel, jtan, ErrStat, ErrMsg, &
+ f_drag=fd)
+ IF (ErrStat /= CD_HCDYN_OK) THEN
+ ErrMsg = 'CD_HermiteCable_Dyn_Load_Power: '//TRIM(ErrMsg); RETURN
+ END IF
+ base = 6*(model%att_node(k) - 1)
+ p_drag(model%att_node(k)) = p_drag(model%att_node(k)) + DOT_PRODUCT(fd, model%v(base + 1:base + 3))
+ END DO
+ END IF
+ IF (.NOT. (CD_All_Finite(p_viv) .AND. CD_All_Finite(p_drag) .AND. CD_All_Finite(p_damp))) THEN
+ ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_Dyn_Load_Power: non-finite load power'
+ END IF
+
+ CONTAINS
+
+ SUBROUTINE add_shares(p, f)
+ !! Element e's load f (on the nodes) times its generalised velocity, half to each node.
+ REAL(wp), INTENT(INOUT) :: p(:)
+ REAL(wp), INTENT(IN) :: f(12)
+ REAL(wp) :: pe
+ pe = 0.5_wp*DOT_PRODUCT(f, ve)
+ p(e) = p(e) + pe
+ p(e + 1) = p(e + 1) + pe
+ END SUBROUTINE add_shares
+ END SUBROUTINE CD_HermiteCable_Dyn_Load_Power
+
SUBROUTINE CD_HermiteCable_Dyn_Set_Friction_Anchors(model, anchors, ErrStat, ErrMsg)
!! Switch the seabed friction of a contact model with mu > 0 to elastic-plastic friction
!! springs anchored at anchors(1:2, node) (x, y in the solve frame). The spring stiffness
@@ -1482,7 +2713,7 @@ END SUBROUTINE fail_fr
END SUBROUTINE CD_HermiteCable_Dyn_Set_Friction_Anchors
SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, cdax, ca, rho_w, gravity, &
- ErrStat, ErrMsg)
+ ErrStat, ErrMsg, isotropic, point_load)
!! Install discrete point attachments (clumps, buoyancy modules) lumped at nodes. Each
!! carries its weight and buoyancy (m - rho V) g downward, isotropic added mass
!! Ca rho V (with the dry mass m, a constant nodal mass on the translational DOFs), the
@@ -1493,12 +2724,18 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
!! surface an attachment loses its buoyancy and fluid loads. Called once, after Init and
!! never together with internal waves; the initial acceleration is refreshed. The
!! kinetic energy (CD_HermiteCable_Dyn_Energy) then includes the attachment mass and its
- !! added mass Ca rho V.
+ !! added mass Ca rho V. isotropic (optional, default false) makes an attachment's drag a
+ !! point's, rho CdA |w| w / 2 on the whole relative velocity (CdAx unused), as a Free point
+ !! that ends the line carries it. point_load (optional, default false) marks the attachment
+ !! that is the point itself on a free end: it stays in the equations of motion, but
+ !! CD_HermiteCable_Dyn_End_Force leaves its loads out, so the end force is the line load
+ !! the point balances (its submerged weight for a clump at rest).
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
INTEGER, INTENT(IN) :: node(:)
REAL(wp), INTENT(IN) :: mass(:), volume(:), cda(:), cdax(:), ca(:), rho_w, gravity
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ LOGICAL, INTENT(IN), OPTIONAL :: isotropic(:), point_load(:)
INTEGER :: n, k, d, dof, es
REAL(wp), ALLOCATABLE :: a_old(:), mgb_old(:, :)
CHARACTER(1024) :: em
@@ -1523,6 +2760,20 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: node/mass/volume/cda/ca must share one length >= 1'
RETURN
END IF
+ IF (PRESENT(isotropic)) THEN
+ IF (SIZE(isotropic) /= n) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: isotropic must have one entry per attachment'
+ RETURN
+ END IF
+ END IF
+ IF (PRESENT(point_load)) THEN
+ IF (SIZE(point_load) /= n) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: point_load must have one entry per attachment'
+ RETURN
+ END IF
+ END IF
IF (ANY(node < 1) .OR. ANY(node > model%nn)) THEN
ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: node out of range'; RETURN
END IF
@@ -1543,7 +2794,12 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
a_old = model%a
mgb_old = model%Mgb
ALLOCATE (model%att_node(n), model%att_w(n), model%att_b(n), model%att_fk(n), model%att_cda(n), &
- model%att_cdax(n), model%att_mass(n), model%att_madd(n))
+ model%att_cdax(n), model%att_mass(n), model%att_madd(n), model%att_iso(n), &
+ model%att_point(n), model%att_r(n))
+ model%att_iso = .FALSE.
+ IF (PRESENT(isotropic)) model%att_iso = isotropic
+ model%att_point = .FALSE.
+ IF (PRESENT(point_load)) model%att_point = point_load
model%att_node = node
model%att_w = (mass - rho_w*volume)*gravity
model%att_b = rho_w*gravity*volume
@@ -1553,6 +2809,9 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
model%att_rho = rho_w
model%att_mass = mass
model%att_madd = ca*rho_w*volume
+ DO k = 1, n
+ model%att_r(k) = CD_HermiteCable_Point_Radius(volume(k), cda(k))
+ END DO
DO k = 1, n
DO d = 1, 3
dof = 6*(node(k) - 1) + d
@@ -1563,7 +2822,7 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
CALL solve_consistent_acceleration(model, es, em)
IF (es /= CD_HCDYN_OK) THEN
DEALLOCATE (model%att_node, model%att_w, model%att_b, model%att_fk, model%att_cda, model%att_cdax, &
- model%att_mass, model%att_madd)
+ model%att_mass, model%att_madd, model%att_iso, model%att_point, model%att_r)
model%has_attach = .FALSE.
model%Mgb = mgb_old
model%a = a_old
@@ -1573,17 +2832,40 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
END SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments
SUBROUTINE CD_HermiteCable_Attachment_Drag(rel_velocity, tangent, rho, cda, cdax, force, ErrStat, ErrMsg, &
- jac_rel, jac_tan)
+ jac_rel, jac_tan, isotropic)
!! Quadratic drag of a line attachment: f = rho [CdA |w_n| w_n + CdAx |w_t| w_t] / 2 with
!! w the relative fluid velocity split normal and axial to the line tangent (any non-zero
!! vector; normalised internally). Optional Jacobians d f/d w and d f/d tangent, as a pair.
!! Shared by the dynamic residual and the deck static solve, so both use one law.
+ !! isotropic (optional, default false): a point's drag f = rho CdA |w| w / 2 on the whole
+ !! relative velocity (CdAx unused; d f/d tangent = 0), the law of a Free point.
REAL(wp), INTENT(IN) :: rel_velocity(3), tangent(3), rho, cda, cdax
REAL(wp), INTENT(OUT) :: force(3)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
REAL(wp), INTENT(OUT), OPTIONAL :: jac_rel(3, 3), jac_tan(3, 3)
+ LOGICAL, INTENT(IN), OPTIONAL :: isotropic
REAL(wp), PARAMETER :: PI_A = 3.14159265358979323846_wp
+ REAL(wp) :: wn
+ INTEGER :: i
+ IF (PRESENT(isotropic)) THEN
+ IF (isotropic) THEN
+ ErrStat = CD_HCDYN_OK; ErrMsg = ''
+ wn = NORM2(rel_velocity)
+ force = 0.5_wp*rho*cda*wn*rel_velocity
+ IF (PRESENT(jac_rel) .AND. PRESENT(jac_tan)) THEN
+ jac_tan = CD_ZERO
+ jac_rel = CD_ZERO
+ IF (wn > CD_ZERO) THEN
+ jac_rel = 0.5_wp*rho*cda*SPREAD(rel_velocity, 2, 3)*SPREAD(rel_velocity, 1, 3)/wn
+ DO i = 1, 3
+ jac_rel(i, i) = jac_rel(i, i) + 0.5_wp*rho*cda*wn
+ END DO
+ END IF
+ END IF
+ RETURN
+ END IF
+ END IF
! The Morison per-length primitive with unit diameter is 1/2 rho Cdn |w_n| w_n +
! 1/2 rho pi Cdt |w_t| w_t, so Cdn = CdA and Cdt = CdAx/pi.
IF (PRESENT(jac_rel) .AND. PRESENT(jac_tan)) THEN
@@ -1614,14 +2896,21 @@ SUBROUTINE assemble_attachments(model, q_cfg, v_cfg, want_residual, want_tangent
CHARACTER(*), INTENT(OUT) :: ErrMsg
INTEGER :: k, base, a, b
LOGICAL :: has_jac
- REAL(wp) :: rk(3), jrel(3, 3), jtan(3, 3)
+ REAL(wp) :: rk(3), jrel(3, 3), jtan(3, 3), jz(3)
ErrStat = CD_HCDYN_OK; ErrMsg = ''
DO k = 1, SIZE(model%att_node)
IF (model%att_node(k) < n_lo .OR. model%att_node(k) > n_hi) CYCLE
base = 6*(model%att_node(k) - 1)
- CALL attachment_residual(model, k, q_cfg, v_cfg, want_tangent, rk, has_jac, jrel, jtan, ErrStat, ErrMsg)
+ CALL attachment_residual(model, k, q_cfg, v_cfg, want_tangent, rk, has_jac, jrel, jtan, ErrStat, ErrMsg, &
+ jz=jz)
IF (ErrStat /= CD_HCDYN_OK) RETURN
IF (want_residual) R(base + 1:base + 3) = R(base + 1:base + 3) + rk
+ ! the dependence on the node height through the immersed fraction (zero off the surface)
+ IF (want_tangent) THEN
+ DO a = 1, 3
+ Kb(KL_D + KU_D + 1 + a - 3, base + 3) = Kb(KL_D + KU_D + 1 + a - 3, base + 3) + jz(a)
+ END DO
+ END IF
IF (want_tangent .AND. has_jac) THEN
! w = u - v, so dR/dv = +df/dw; the tangent DOFs m enter through df/dm
DO b = 1, 3
@@ -1635,10 +2924,17 @@ SUBROUTINE assemble_attachments(model, q_cfg, v_cfg, want_residual, want_tangent
END DO
END SUBROUTINE assemble_attachments
- SUBROUTINE attachment_residual(model, k, q_cfg, v_cfg, want_jac, rk, has_jac, jrel, jtan, ErrStat, ErrMsg)
+ SUBROUTINE attachment_residual(model, k, q_cfg, v_cfg, want_jac, rk, has_jac, jrel, jtan, ErrStat, ErrMsg, &
+ f_drag, jz)
!! Contribution rk of attachment k to R = f_int - f_ext at the translations of its node:
- !! weight, buoyancy, Froude-Krylov force and drag (inertia excluded). With want_jac, the
- !! drag Jacobians d f/d w and d f/d tangent are returned when has_jac is set.
+ !! weight, buoyancy, Froude-Krylov force and drag (inertia excluded). Buoyancy, Froude-Krylov
+ !! force and drag carry the immersed fraction wf of the attachment's sphere (radius att_r)
+ !! at the local surface, so the load is continuous (C1) as the node crosses it: a buoy
+ !! floating at the surface has an equilibrium, where a wet/dry switch at the node height
+ !! had none. A node deeper than att_r below the surface has wf exactly 1 (unchanged loads).
+ !! With want_jac, the drag Jacobians d f/d w and d f/d tangent are returned when has_jac is
+ !! set. f_drag (optional) returns the drag force on the node alone (zero above the free
+ !! surface); jz (optional) returns d rk/d z through wf (zero off the surface band).
TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
INTEGER, INTENT(IN) :: k
REAL(wp), INTENT(IN) :: q_cfg(:), v_cfg(:)
@@ -1647,10 +2943,13 @@ SUBROUTINE attachment_residual(model, k, q_cfg, v_cfg, want_jac, rk, has_jac, jr
LOGICAL, INTENT(OUT) :: has_jac
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ REAL(wp), INTENT(OUT), OPTIONAL :: f_drag(3), jz(3)
INTEGER :: j, base
- REAL(wp) :: u(3), ud(3), wrel(3), wl, f(3)
+ REAL(wp) :: u(3), ud(3), wrel(3), wl, f(3), wf, dwf
ErrStat = CD_HCDYN_OK; ErrMsg = ''
rk = CD_ZERO; jrel = CD_ZERO; jtan = CD_ZERO; has_jac = .FALSE.
+ IF (PRESENT(f_drag)) f_drag = CD_ZERO
+ IF (PRESENT(jz)) jz = CD_ZERO
j = model%att_node(k)
base = 6*(j - 1)
u = CD_ZERO; ud = CD_ZERO; wl = CD_ZERO
@@ -1663,25 +2962,43 @@ SUBROUTINE attachment_residual(model, k, q_cfg, v_cfg, want_jac, rk, has_jac, jr
IF (model%has_held_field) THEN
u = u + model%hf_u(:, j); ud = model%hf_ud(:, j); wl = model%hf_wl(j)
END IF
- IF (q_cfg(base + 3) > wl) THEN
+ CALL CD_HermiteCable_Point_Immersion(wl - q_cfg(base + 3), model%att_r(k), wf, dwf)
+ IF (.NOT. (wf > CD_ZERO)) THEN
! above the free surface: weight only, no buoyancy or fluid load
rk(3) = model%att_w(k) + model%att_b(k)
RETURN
END IF
- rk(3) = model%att_w(k)
- rk = rk - model%att_fk(k)*ud
+ IF (wf < CD_ONE) THEN
+ rk(3) = model%att_w(k) + (CD_ONE - wf)*model%att_b(k)
+ rk = rk - wf*model%att_fk(k)*ud
+ IF (PRESENT(jz)) THEN
+ jz(3) = -dwf*model%att_b(k)
+ jz = jz - dwf*model%att_fk(k)*ud
+ END IF
+ ELSE
+ rk(3) = model%att_w(k)
+ rk = rk - model%att_fk(k)*ud
+ END IF
IF (.NOT. (model%att_cda(k) > CD_ZERO .OR. model%att_cdax(k) > CD_ZERO)) RETURN
wrel = u - v_cfg(base + 1:base + 3)
IF (want_jac) THEN
CALL CD_HermiteCable_Attachment_Drag(wrel, q_cfg(base + 4:base + 6), model%att_rho, model%att_cda(k), &
- model%att_cdax(k), f, ErrStat, ErrMsg, jrel, jtan)
+ model%att_cdax(k), f, ErrStat, ErrMsg, jrel, jtan, &
+ isotropic=model%att_iso(k))
has_jac = .TRUE.
ELSE
CALL CD_HermiteCable_Attachment_Drag(wrel, q_cfg(base + 4:base + 6), model%att_rho, model%att_cda(k), &
- model%att_cdax(k), f, ErrStat, ErrMsg)
+ model%att_cdax(k), f, ErrStat, ErrMsg, isotropic=model%att_iso(k))
END IF
IF (ErrStat /= CD_HCDYN_OK) RETURN
+ IF (wf < CD_ONE) THEN
+ IF (PRESENT(jz)) jz = jz - dwf*f
+ f = wf*f
+ jrel = wf*jrel
+ jtan = wf*jtan
+ END IF
rk = rk - f
+ IF (PRESENT(f_drag)) f_drag = f
END SUBROUTINE attachment_residual
SUBROUTINE CD_HermiteCable_Dyn_Recompute_Acceleration(model, ErrStat, ErrMsg, pres_dofs, pres_a)
@@ -2067,6 +3384,8 @@ SUBROUTINE rebuild_length_caches(model, l0_new, ErrStat, ErrMsg)
cn_new = kn_new*model%seabed_cn_over_kn
END IF
model%l0 = l0_new
+ ! (the element checks of the nodal twist's recorded configuration hold for the old lengths)
+ model%tw_rq_ok = .FALSE.
CALL MOVE_ALLOC(mgb_new, model%Mgb)
CALL MOVE_ALLOC(trib_new, model%trib)
IF (model%has_contact) THEN
@@ -2893,59 +4212,186 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Drag(model, rho_w, diam, cdn, cdt, waterline_
IF (had_drag) THEN
diam_old = model%diam; cdn_old = model%cdn; cdt_old = model%cdt
ELSE
- diam_old = CD_ZERO; cdn_old = CD_ZERO; cdt_old = CD_ZERO
+ diam_old = CD_ZERO; cdn_old = CD_ZERO; cdt_old = CD_ZERO
+ END IF
+
+ IF (ALLOCATED(model%diam)) DEALLOCATE (model%diam)
+ IF (ALLOCATED(model%cdn)) DEALLOCATE (model%cdn)
+ IF (ALLOCATED(model%cdt)) DEALLOCATE (model%cdt)
+ ALLOCATE (model%diam(model%ne), model%cdn(model%ne), model%cdt(model%ne))
+ model%diam = diam; model%cdn = cdn; model%cdt = cdt
+ model%rho_w = rho_w; model%waterline_z = waterline_z; model%current = current
+ model%gravity = grav_new
+ model%has_drag = .TRUE.
+ ! the lift scale and the shedding diameter follow the drag's density and diameters
+ IF (model%has_viv) CALL viv_drag_terms(model)
+
+ ! Refresh the consistent acceleration now that the load set includes drag: at v = 0 a current
+ ! exerts a non-zero rest drag, so the predictor for the first step must see it.
+ CALL solve_consistent_acceleration(model, ErrStat, ErrMsg)
+ IF (ErrStat /= CD_HCDYN_OK) THEN
+ ! Roll back to the pre-call state: previous acceleration, previous drag configuration.
+ model%a = a_old
+ model%rho_w = rho_old; model%waterline_z = wl_old; model%current = cur_old
+ model%gravity = grav_old
+ IF (had_drag) THEN
+ model%diam = diam_old; model%cdn = cdn_old; model%cdt = cdt_old
+ ELSE
+ DEALLOCATE (model%diam, model%cdn, model%cdt)
+ END IF
+ model%has_drag = had_drag
+ ! VIV needs drag, so a VIV model had it: back to the restored configuration
+ IF (model%has_viv) CALL viv_drag_terms(model)
+ END IF
+ END SUBROUTINE CD_HermiteCable_Dyn_Set_Drag
+
+ SUBROUTINE CD_HermiteCable_Dyn_Set_Axial_Damping(model, BA, ErrStat, ErrMsg)
+ !! Install the resolved per-element axial Kelvin-Voigt coefficients [N s].
+ !! The constitutive viscous resultant is N_v = BA*strain_rate, where strain_rate
+ !! follows the deformed centreline and material coordinate. An all-zero array
+ !! disables the contribution exactly. The setter is transactional and refreshes
+ !! the consistent acceleration because callers may replace the damping after the
+ !! cable has acquired a non-zero velocity.
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
+ REAL(wp), INTENT(IN) :: BA(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+
+ REAL(wp), ALLOCATABLE :: old_BA(:), new_BA(:), old_a(:)
+ LOGICAL :: old_has
+ INTEGER :: es, istat
+ CHARACTER(1024) :: em
+
+ ErrStat = CD_HCDYN_OK
+ model%rc_epoch = model%rc_epoch + 1
+ ! A load-configuration change invalidates the cached committed force F_n.
+ model%fc_valid = .FALSE.
+ model%fc_clears = model%fc_clears + 1
+ model%tr_valid = .FALSE.
+ ErrMsg = ''
+ IF (.NOT. model%initialized) THEN
+ CALL fail('model not initialised'); RETURN
+ END IF
+ IF (SIZE(BA) /= model%ne) THEN
+ CALL fail('BA must have length ne'); RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(BA) .OR. ANY(BA < CD_ZERO)) THEN
+ CALL fail('BA must be finite and non-negative'); RETURN
+ END IF
+
+ ALLOCATE (new_BA(model%ne), old_a(model%ndof), STAT=istat)
+ IF (istat /= 0) THEN
+ CALL fail('workspace allocation failed'); RETURN
+ END IF
+ new_BA = BA
+ old_a = model%a
+ old_has = model%has_axial_damping
+ CALL MOVE_ALLOC(model%BA, old_BA)
+ IF (ANY(new_BA > CD_ZERO)) THEN
+ CALL MOVE_ALLOC(new_BA, model%BA)
+ model%has_axial_damping = .TRUE.
+ ELSE
+ model%has_axial_damping = .FALSE.
+ END IF
+
+ CALL solve_consistent_acceleration(model, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ IF (ALLOCATED(model%BA)) DEALLOCATE (model%BA)
+ CALL MOVE_ALLOC(old_BA, model%BA)
+ model%has_axial_damping = old_has
+ model%a = old_a
+ CALL fail('initial acceleration refresh failed: '//TRIM(em)); RETURN
+ END IF
+
+ CONTAINS
+ SUBROUTINE fail(msg)
+ CHARACTER(*), INTENT(IN) :: msg
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_Axial_Damping: '//msg
+ END SUBROUTINE fail
+ END SUBROUTINE CD_HermiteCable_Dyn_Set_Axial_Damping
+
+ SUBROUTINE CD_HermiteCable_Dyn_Set_Bending_Damping(model, Bb, ErrStat, ErrMsg)
+ !! Install the per-element bending Kelvin-Voigt coefficients Bb [N m^2 s]: the damping moment
+ !! Bb times the curvature rate convected with the tangent (CD_HermiteCable_Bending_Damping). An
+ !! all-zero array disables the contribution exactly. Transactional, and it refreshes the
+ !! consistent acceleration, as CD_HermiteCable_Dyn_Set_Axial_Damping.
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
+ REAL(wp), INTENT(IN) :: Bb(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+
+ REAL(wp), ALLOCATABLE :: old_Bb(:), new_Bb(:), old_a(:)
+ LOGICAL :: old_has
+ INTEGER :: es, istat
+ CHARACTER(1024) :: em
+
+ ErrStat = CD_HCDYN_OK
+ model%rc_epoch = model%rc_epoch + 1
+ model%fc_valid = .FALSE.
+ model%fc_clears = model%fc_clears + 1
+ model%tr_valid = .FALSE.
+ ErrMsg = ''
+ IF (.NOT. model%initialized) THEN
+ CALL fail('model not initialised'); RETURN
+ END IF
+ IF (SIZE(Bb) /= model%ne) THEN
+ CALL fail('Bb must have length ne'); RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(Bb) .OR. ANY(Bb < CD_ZERO)) THEN
+ CALL fail('Bb must be finite and non-negative'); RETURN
+ END IF
+
+ ALLOCATE (new_Bb(model%ne), old_a(model%ndof), STAT=istat)
+ IF (istat /= 0) THEN
+ CALL fail('workspace allocation failed'); RETURN
+ END IF
+ new_Bb = Bb
+ old_a = model%a
+ old_has = model%has_bend_damping
+ CALL MOVE_ALLOC(model%Bb, old_Bb)
+ IF (ANY(new_Bb > CD_ZERO)) THEN
+ CALL MOVE_ALLOC(new_Bb, model%Bb)
+ model%has_bend_damping = .TRUE.
+ ELSE
+ model%has_bend_damping = .FALSE.
END IF
- IF (ALLOCATED(model%diam)) DEALLOCATE (model%diam)
- IF (ALLOCATED(model%cdn)) DEALLOCATE (model%cdn)
- IF (ALLOCATED(model%cdt)) DEALLOCATE (model%cdt)
- ALLOCATE (model%diam(model%ne), model%cdn(model%ne), model%cdt(model%ne))
- model%diam = diam; model%cdn = cdn; model%cdt = cdt
- model%rho_w = rho_w; model%waterline_z = waterline_z; model%current = current
- model%gravity = grav_new
- model%has_drag = .TRUE.
- ! the lift scale and the shedding diameter follow the drag's density and diameters
- IF (model%has_viv) CALL viv_drag_terms(model)
-
- ! Refresh the consistent acceleration now that the load set includes drag: at v = 0 a current
- ! exerts a non-zero rest drag, so the predictor for the first step must see it.
- CALL solve_consistent_acceleration(model, ErrStat, ErrMsg)
- IF (ErrStat /= CD_HCDYN_OK) THEN
- ! Roll back to the pre-call state: previous acceleration, previous drag configuration.
- model%a = a_old
- model%rho_w = rho_old; model%waterline_z = wl_old; model%current = cur_old
- model%gravity = grav_old
- IF (had_drag) THEN
- model%diam = diam_old; model%cdn = cdn_old; model%cdt = cdt_old
- ELSE
- DEALLOCATE (model%diam, model%cdn, model%cdt)
- END IF
- model%has_drag = had_drag
- ! VIV needs drag, so a VIV model had it: back to the restored configuration
- IF (model%has_viv) CALL viv_drag_terms(model)
+ CALL solve_consistent_acceleration(model, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ IF (ALLOCATED(model%Bb)) DEALLOCATE (model%Bb)
+ CALL MOVE_ALLOC(old_Bb, model%Bb)
+ model%has_bend_damping = old_has
+ model%a = old_a
+ CALL fail('initial acceleration refresh failed: '//TRIM(em)); RETURN
END IF
- END SUBROUTINE CD_HermiteCable_Dyn_Set_Drag
- SUBROUTINE CD_HermiteCable_Dyn_Set_Axial_Damping(model, BA, ErrStat, ErrMsg)
- !! Install the resolved per-element axial Kelvin-Voigt coefficients [N s].
- !! The constitutive viscous resultant is N_v = BA*strain_rate, where strain_rate
- !! follows the deformed centreline and material coordinate. An all-zero array
- !! disables the contribution exactly. The setter is transactional and refreshes
- !! the consistent acceleration because callers may replace the damping after the
- !! cable has acquired a non-zero velocity.
+ CONTAINS
+ SUBROUTINE fail(msg)
+ CHARACTER(*), INTENT(IN) :: msg
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_Bending_Damping: '//msg
+ END SUBROUTINE fail
+ END SUBROUTINE CD_HermiteCable_Dyn_Set_Bending_Damping
+
+ SUBROUTINE CD_HermiteCable_Dyn_Set_Mass_Damping(model, alpha, ErrStat, ErrMsg)
+ !! Install the per-element mass-proportional (Rayleigh alpha) coefficients alpha [1/s]: the
+ !! damping force alpha rho_a on the velocity normal to the tangent (CD_HermiteCable_Mass_Damping),
+ !! the alpha M part of a Rayleigh damping alpha M + beta K beside the bending damping Bb = beta EI.
+ !! An all-zero array disables the contribution exactly. Transactional, and it refreshes the
+ !! consistent acceleration, as CD_HermiteCable_Dyn_Set_Bending_Damping.
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
- REAL(wp), INTENT(IN) :: BA(:)
+ REAL(wp), INTENT(IN) :: alpha(:)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- REAL(wp), ALLOCATABLE :: old_BA(:), new_BA(:), old_a(:)
+ REAL(wp), ALLOCATABLE :: old_alpha(:), new_alpha(:), old_a(:)
LOGICAL :: old_has
INTEGER :: es, istat
CHARACTER(1024) :: em
ErrStat = CD_HCDYN_OK
model%rc_epoch = model%rc_epoch + 1
- ! A load-configuration change invalidates the cached committed force F_n.
model%fc_valid = .FALSE.
model%fc_clears = model%fc_clears + 1
model%tr_valid = .FALSE.
@@ -2953,33 +4399,33 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Axial_Damping(model, BA, ErrStat, ErrMsg)
IF (.NOT. model%initialized) THEN
CALL fail('model not initialised'); RETURN
END IF
- IF (SIZE(BA) /= model%ne) THEN
- CALL fail('BA must have length ne'); RETURN
+ IF (SIZE(alpha) /= model%ne) THEN
+ CALL fail('alpha must have length ne'); RETURN
END IF
- IF (.NOT. CD_All_Finite(BA) .OR. ANY(BA < CD_ZERO)) THEN
- CALL fail('BA must be finite and non-negative'); RETURN
+ IF (.NOT. CD_All_Finite(alpha) .OR. ANY(alpha < CD_ZERO)) THEN
+ CALL fail('alpha must be finite and non-negative'); RETURN
END IF
- ALLOCATE (new_BA(model%ne), old_a(model%ndof), STAT=istat)
+ ALLOCATE (new_alpha(model%ne), old_a(model%ndof), STAT=istat)
IF (istat /= 0) THEN
CALL fail('workspace allocation failed'); RETURN
END IF
- new_BA = BA
+ new_alpha = alpha
old_a = model%a
- old_has = model%has_axial_damping
- CALL MOVE_ALLOC(model%BA, old_BA)
- IF (ANY(new_BA > CD_ZERO)) THEN
- CALL MOVE_ALLOC(new_BA, model%BA)
- model%has_axial_damping = .TRUE.
+ old_has = model%has_mass_damping
+ CALL MOVE_ALLOC(model%ray_alpha, old_alpha)
+ IF (ANY(new_alpha > CD_ZERO)) THEN
+ CALL MOVE_ALLOC(new_alpha, model%ray_alpha)
+ model%has_mass_damping = .TRUE.
ELSE
- model%has_axial_damping = .FALSE.
+ model%has_mass_damping = .FALSE.
END IF
CALL solve_consistent_acceleration(model, es, em)
IF (es /= CD_HCDYN_OK) THEN
- IF (ALLOCATED(model%BA)) DEALLOCATE (model%BA)
- CALL MOVE_ALLOC(old_BA, model%BA)
- model%has_axial_damping = old_has
+ IF (ALLOCATED(model%ray_alpha)) DEALLOCATE (model%ray_alpha)
+ CALL MOVE_ALLOC(old_alpha, model%ray_alpha)
+ model%has_mass_damping = old_has
model%a = old_a
CALL fail('initial acceleration refresh failed: '//TRIM(em)); RETURN
END IF
@@ -2988,9 +4434,105 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Axial_Damping(model, BA, ErrStat, ErrMsg)
SUBROUTINE fail(msg)
CHARACTER(*), INTENT(IN) :: msg
ErrStat = CD_HCDYN_BADINPUT
- ErrMsg = 'CD_HermiteCable_Dyn_Set_Axial_Damping: '//msg
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_Mass_Damping: '//msg
END SUBROUTINE fail
- END SUBROUTINE CD_HermiteCable_Dyn_Set_Axial_Damping
+ END SUBROUTINE CD_HermiteCable_Dyn_Set_Mass_Damping
+
+ SUBROUTINE structural_damping_element(model, e, qe, ve, fdamp, ErrStat, ErrMsg, kdq, kdv, fixed_length, &
+ fbend)
+ !! The structural damping load of element e: the axial dashpot (BA, with the controlled-length
+ !! rate), the bending dashpot (Bb) and the mass-proportional transverse damping (ray_alpha),
+ !! summed in that order, as an internal generalised force, with their exact Jacobians
+ !! kdq = d/dq, kdv = d/dv when requested. Without bending and mass damping the axial kernel's
+ !! output is returned as it stands (bit for bit). Under active line control the axial and
+ !! bending rates include the controlled-length rate l0_dot; fixed_length = .TRUE. leaves it out
+ !! (the node recovery's form). The mass damping takes the interpolated velocity, as the inertia.
+ !! fbend (optional) returns the bending part of fdamp alone.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ REAL(wp), INTENT(IN) :: qe(12), ve(12)
+ REAL(wp), INTENT(OUT) :: fdamp(12)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ REAL(wp), INTENT(OUT), OPTIONAL :: kdq(12, 12), kdv(12, 12)
+ LOGICAL, INTENT(IN), OPTIONAL :: fixed_length
+ REAL(wp), INTENT(OUT), OPTIONAL :: fbend(12)
+ REAL(wp) :: fb(12), kbq(12, 12), kbv(12, 12)
+ LOGICAL :: want, ctrl
+ INTEGER :: es
+ CHARACTER(160) :: emk
+ want = PRESENT(kdq) .AND. PRESENT(kdv)
+ ctrl = model%has_ctrl
+ IF (PRESENT(fixed_length)) ctrl = ctrl .AND. .NOT. fixed_length
+ ErrStat = CD_HCDYN_OK
+ ErrMsg = ''
+ fdamp = CD_ZERO
+ IF (want) THEN
+ kdq = CD_ZERO; kdv = CD_ZERO
+ END IF
+ IF (PRESENT(fbend)) fbend = CD_ZERO
+ IF (model%has_axial_damping) THEN
+ IF (want .AND. ctrl) THEN
+ CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), fdamp, kdq, kdv, ErrStat, ErrMsg, &
+ model%axial_quadrature_order, model%l0_dot(e))
+ ELSE IF (want) THEN
+ CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), fdamp, kdq, kdv, ErrStat, ErrMsg, &
+ model%axial_quadrature_order)
+ ELSE IF (ctrl) THEN
+ CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), fdamp, ErrStat=ErrStat, &
+ ErrMsg=ErrMsg, quadrature_order=model%axial_quadrature_order, &
+ l0_dot=model%l0_dot(e))
+ ELSE
+ CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), fdamp, ErrStat=ErrStat, &
+ ErrMsg=ErrMsg, quadrature_order=model%axial_quadrature_order)
+ END IF
+ IF (ErrStat /= CD_HCDYN_OK) RETURN
+ END IF
+ IF (model%has_bend_damping) THEN
+ IF (model%Bb(e) > CD_ZERO) THEN
+ IF (want .AND. ctrl) THEN
+ CALL CD_HermiteCable_Bending_Damping(qe, ve, model%l0(e), model%Bb(e), fb, kbq, kbv, es, ErrMsg, &
+ quadrature_order=model%bending_quadrature_order, &
+ l0_dot=model%l0_dot(e))
+ ELSE IF (want) THEN
+ CALL CD_HermiteCable_Bending_Damping(qe, ve, model%l0(e), model%Bb(e), fb, kbq, kbv, es, ErrMsg, &
+ quadrature_order=model%bending_quadrature_order)
+ ELSE IF (ctrl) THEN
+ CALL CD_HermiteCable_Bending_Damping(qe, ve, model%l0(e), model%Bb(e), fb, ErrStat=es, ErrMsg=ErrMsg, &
+ quadrature_order=model%bending_quadrature_order, &
+ l0_dot=model%l0_dot(e))
+ ELSE
+ CALL CD_HermiteCable_Bending_Damping(qe, ve, model%l0(e), model%Bb(e), fb, ErrStat=es, ErrMsg=ErrMsg, &
+ quadrature_order=model%bending_quadrature_order)
+ END IF
+ IF (es /= CD_HCABLE_OK) THEN
+ ErrStat = CD_HCDYN_NOCONVERGE; RETURN
+ END IF
+ fdamp = fdamp + fb
+ IF (PRESENT(fbend)) fbend = fb
+ IF (want) THEN
+ kdq = kdq + kbq; kdv = kdv + kbv
+ END IF
+ END IF
+ END IF
+ IF (.NOT. model%has_mass_damping) RETURN
+ IF (.NOT. (model%ray_alpha(e) > CD_ZERO)) RETURN
+ ! alpha times the line's own mass rho_a: a transverse mode of the bare cable has alpha/(2 omega)
+ IF (want) THEN
+ CALL CD_HermiteCable_Mass_Damping(qe, ve, model%l0(e), model%ray_alpha(e)*model%rho_a(e), fb, kbq, kbv, &
+ es, emk)
+ ELSE
+ CALL CD_HermiteCable_Mass_Damping(qe, ve, model%l0(e), model%ray_alpha(e)*model%rho_a(e), fb, ErrStat=es, &
+ ErrMsg=emk)
+ END IF
+ IF (es /= CD_HCABLE_OK) THEN
+ ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = TRIM(emk); RETURN
+ END IF
+ fdamp = fdamp + fb
+ IF (want) THEN
+ kdq = kdq + kbq; kdv = kdv + kbv
+ END IF
+ END SUBROUTINE structural_damping_element
SUBROUTINE CD_HermiteCable_Dyn_Set_AddedMass(model, rho_w, diam, can, cat, waterline_z, ErrStat, ErrMsg)
!! Enable per-element Morison added mass on the (already initialised) dynamic model: the
@@ -3582,6 +5124,8 @@ SUBROUTINE CD_HermiteCable_Dyn_Step(model, dt, max_iter, tol, ErrStat, ErrMsg, i
model%tors_use_step = .FALSE.
! every evaluation outside a step takes the committed VIV phase
IF (model%has_viv) model%viv_phi_eval = model%viv_phi
+ IF (model%has_viv_il) model%vil_phi_eval = model%vil_phi
+ IF (model%viv_wake) model%wo_q_eval = model%wo_s(1, :)
END SUBROUTINE CD_HermiteCable_Dyn_Step
SUBROUTINE CD_HermiteCable_Dyn_Set_Torsion_Drive(model, ends, phi, ErrStat, ErrMsg)
@@ -3661,7 +5205,7 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Torsion_Frames(model, ends, ErrStat, ErrMsg,
IF (PRESENT(q_check)) RETURN
! a frame turn within one step of the end-frame constants (the wrapped change is unique)
model%tors_drive_set = .FALSE.
- CALL tw_commit_reference(model)
+ CALL tw_commit_reference(model, frames_only=.TRUE.)
model%torsion%ends = ends
model%tors_use_step = .FALSE.
CALL assemble_twist(model, model%q, model%v, .TRUE., .FALSE., model%ws_R, model%ws_Kb, model%ws_Kvb, &
@@ -3729,7 +5273,7 @@ SUBROUTINE dyn_step_core(model, dt, max_iter, tol, ErrStat, ErrMsg, iters_out, r
INTEGER :: axial_worst_element, iv, attempt, n_attempt
INTEGER :: n_ls_tan ! tangents the step's line searches assembled at their accepted trial
REAL(wp) :: c_a, c_v, c_a2, am, af, bt, gm, rnorm, fscale, rnt, lambda, chosen, lam_ok, cw, t_alpha, dth_lin
- REAL(wp) :: e_bal, e_ma, tors_theta_new, tors_mt_new
+ REAL(wp) :: e_bal, e_ma, tors_theta_new, tors_mt_new, t_inc, t_len
REAL(wp) :: axial_qe(12), axial_min
REAL(wp) :: axial_threshold, axial_margin, axial_worst_margin, axial_worst_force, axial_worst_xi
REAL(wp) :: axial_worst_threshold
@@ -3752,6 +5296,9 @@ SUBROUTINE dyn_step_core(model, dt, max_iter, tol, ErrStat, ErrMsg, iters_out, r
REAL(wp), PARAMETER :: MN_CONTRACT = 0.25_wp
! Constant-acceleration predictor gate: relative force imbalance of the committed state.
REAL(wp), PARAMETER :: PRED_BALANCE = 0.5_wp
+ ! Largest change of the length of a free nodal tangent by the predictor, relative to that
+ ! length; a larger change holds the tangent at its committed value (see the predictor).
+ REAL(wp), PARAMETER :: PRED_STRETCH_MAX = 0.25_wp
! Cross-step reuse: at most this many accepted iterations on the carried factor per step;
! a solve still short of the tolerance then refreshes (quadratic convergence from there).
INTEGER, PARAMETER :: XS_MAX_STALE = 3
@@ -3766,6 +5313,10 @@ SUBROUTINE dyn_step_core(model, dt, max_iter, tol, ErrStat, ErrMsg, iters_out, r
! XS_TOL_FACTOR*tol, which keeps the outputs as close to the converged solution as full
! Newton's.
REAL(wp), PARAMETER :: XS_TOL_FACTOR = 0.3_wp
+ ! Round-off acceptance of a stalled iterate (see at_roundoff_floor): the Newton correction
+ ! is within STALL_ROUNDOFF units of eps times the coordinate scale, and the residual within
+ ! STALL_SANITY of the force scale (the EI = 0 route's bound).
+ REAL(wp), PARAMETER :: STALL_ROUNDOFF = 16.0_wp, STALL_SANITY = 1.0e-4_wp
INTEGER(INT64) :: pc0, pc1, pcr, pt0, pt1
CHARACTER(1024) :: em2
@@ -4076,6 +5627,46 @@ SUBROUTINE dyn_step_core(model, dt, max_iter, tol, ErrStat, ErrMsg, iters_out, r
model%ws_qk(iv) = model%ws_qn(iv) + dt*model%ws_vn(iv) + (0.5_wp - bt)*dt*dt*model%ws_an(iv)
END DO
END IF
+ ! Both guesses assume a resolved motion. The length of a nodal tangent m = dr/ds is the
+ ! line's stretch there, its stiffest motion (EA against the tangent's small consistent mass),
+ ! whose committed velocity and acceleration are those of the generalised-alpha recursion far
+ ! outside its resolved range: with little or no numerical damping (rho_inf near 1) it keeps
+ ! ringing about its balance at the offset it started from, and dt v_n or dt^2 a_n along the
+ ! tangent can exceed the tangent itself. A taut 20 m line of 2 m elements (EA 5e7 N) seeded
+ ! with unit tangents at a strain of 7.6e-5 started that mode 7.6e-5 off its balance, with
+ ! a_n = 4.9e3 1/s^2 along the tangents (omega ~ 8e3 rad/s, omega dt ~ 300 at dt 0.037 s, 50
+ ! steps per cycle of its VIV); at rho_inf 1 both guesses carried every tangent across zero
+ ! (dt^2/2 a_n = 3.4, dt^2/4 a_n = 1.7), and Newton converged quadratically to the root with
+ ! every tangent reversed (each element folded into a Z along its chord, 2.4e8 J of strain
+ ! energy against 3.5 J), from which the march failed a few steps on. A guess that changes
+ ! the length of a free tangent by more than PRED_STRETCH_MAX of it (a strain change of 0.25
+ ! in one step, which no step resolves) took that tangent's committed velocity and
+ ! acceleration from the ringing, so the tangent starts at its committed value: the stiff
+ ! mode's true increment, of the order of the strain, is a Newton step from there. Holding
+ ! only its length and keeping the turn of the guess converged too, but the turn rings as
+ ! well (the tangent's rotation is under-resolved at that step): over 20 cycles at 25 steps
+ ! per cycle and rho_inf 0.9 and 1, 132 steps took more than 12 iterations against 31. The
+ ! test is on the length alone because a guess that turns a tangent fast is often right: a
+ ! seabed cable whose span was lengthened 1.3 times turns two tangents 19 degrees in its
+ ! first 0.01 s step, and does not converge from the held tangents. A node with some tangent
+ ! components fixed (a planar model fixes the out-of-plane one) is guarded on its free
+ ! components: the length change is that of the free components' increment, and only they are
+ ! held. Every other start is unchanged.
+ DO i = 1, model%nn
+ iv = 6*(i - 1)
+ IF (.NOT. ANY(model%freemask(iv + 4:iv + 6))) CYCLE
+ t_len = NORM2(model%ws_qn(iv + 4:iv + 6))
+ IF (.NOT. (t_len > CD_ZERO)) CYCLE
+ t_inc = 0.0_wp
+ DO ip = iv + 4, iv + 6
+ IF (model%freemask(ip)) t_inc = t_inc + (model%ws_qk(ip) - model%ws_qn(ip))*model%ws_qn(ip)
+ END DO
+ t_inc = t_inc/t_len
+ IF (ABS(t_inc) <= PRED_STRETCH_MAX*t_len) CYCLE
+ DO ip = iv + 4, iv + 6
+ IF (model%freemask(ip)) model%ws_qk(ip) = model%ws_qn(ip)
+ END DO
+ END DO
! Hold the prescribed DOFs at their target position for the whole solve (Newton never touches
! them -- they are in fixed_dofs, hence not in fmap).
IF (has_pres) THEN
@@ -4388,6 +5979,21 @@ SUBROUTINE dyn_step_core(model, dt, max_iter, tol, ErrStat, ErrMsg, iters_out, r
END IF
EXIT mn_retry
END DO mn_retry
+ ! A fresh correction that no step length improves and that would move no coordinate beyond
+ ! its last bits: the iterate is on the residual's round-off floor and is converged.
+ IF (chosen < CD_ZERO) THEN
+ IF (at_roundoff_floor()) THEN
+ ! the rejected trials overwrote the staged states: restage the iterate's
+ CALL eval_res(model%ws_qk, .FALSE., rnorm, es, em2)
+ IF (es /= CD_HCDYN_OK) THEN
+ ErrStat = es; ErrMsg = 'CD_HermiteCable_Dyn_Step: '//TRIM(em2)
+ IF (attempt < n_attempt) CYCLE predict
+ RETURN
+ END IF
+ IF (PRESENT(res_out)) res_out = rnorm
+ EXIT
+ END IF
+ END IF
IF (chosen < CD_ZERO) THEN
! No step length reduced the residual (with a usable tangent): fall back to the
! SMALLEST step that at least gave a finite evaluation (a safe damped step). Using
@@ -4464,6 +6070,27 @@ SUBROUTINE dyn_step_core(model, dt, max_iter, tol, ErrStat, ErrMsg, iters_out, r
IF (model%tw_active) CALL tw_accept()
rnorm = rnt
END DO
+ ! A nodal tangent turned by 90 degrees or more over one step is a root of the step's
+ ! equations with the element folded back on itself (the reversed-tangent root above), not a
+ ! motion one step resolves: the attempt fails (the next one, or the recovering step's
+ ! subdivision, re-solves the step).
+ DO i = 1, model%nn
+ iv = 6*(i - 1)
+ IF (.NOT. ANY(model%freemask(iv + 4:iv + 6))) CYCLE
+ IF (DOT_PRODUCT(model%ws_qk(iv + 4:iv + 6), model%ws_qn(iv + 4:iv + 6)) > CD_ZERO) CYCLE
+ ErrStat = CD_HCDYN_NOCONVERGE
+ BLOCK
+ CHARACTER(1024) :: wbuf
+ INTEGER :: wios
+ wbuf = ''
+ WRITE (wbuf, '(A,I0,A)', IOSTAT=wios) 'CD_HermiteCable_Dyn_Step: Newton converged with the tangent of node ', &
+ i, ' turned by 90 deg or more in one step (a spurious root with the element folded back); '// &
+ 'a smaller dt resolves the step'
+ ErrMsg = wbuf
+ END BLOCK
+ IF (attempt < n_attempt) CYCLE predict
+ RETURN
+ END DO
EXIT predict
END DO predict
model%ws_stash_solves = nsolve_step
@@ -4868,7 +6495,7 @@ SUBROUTINE eval_res(qcur, use_trial, rn, esx, emx, stash)
REAL(wp), POINTER :: Gout(:)
INTEGER :: ii, nd
INTEGER(INT64) :: ec0, ec1
- REAL(wp) :: xref, xd, xc, ea_r, ka, kt, tw_round
+ REAL(wp) :: xref, xd, xc, ea_r, ka, kb, kt, tw_round
REAL(wp), PARAMETER :: RESID_ROUNDOFF = 16.0_wp
REAL(wp), PARAMETER :: STATE_DIVERGED = 1.0e12_wp
ec0 = 0_INT64 ! defined even with profiling off (see the step-entry note)
@@ -4995,6 +6622,14 @@ SUBROUTINE eval_res(qcur, use_trial, rn, esx, emx, stash)
! held line damped near its first axial mode (BA = 2 zeta EA/omega_1, which at small dt
! puts the damping term well above EA) stagnated at a residual of a few times the
! tolerance and failed its step.
+ ! Bending takes the curvature from the same coordinate differences over l0^2, and its nodal
+ ! forces are the moment over l0, so an element's bending rounding is about eps*|r|/l0^3
+ ! times EI, plus Bb gamma/(beta dt) for the bending damping (the curvature rate from the
+ ! Newmark velocity). Where EA/l0 is small (a soft tensioner in series with the line, a
+ ! fine mesh) this term is the larger: without it a 20 m riser on a 20 kN/m tensioner
+ ! (EA_eff 4e5 N, 80 elements, Bb 500 N m^2 s, dt 1e-3 s) stagnated at 1.06 times the
+ ! tolerance and failed its step, and the step recovery's smaller steps only raised the
+ ! damping term further.
xref = MAXVAL(model%l0)
DO ii = 1, ndof
IF (MOD(ii - 1, 6) < 3) xref = MAX(xref, ABS(qcur(ii)))
@@ -5006,6 +6641,9 @@ SUBROUTINE eval_res(qcur, use_trial, rn, esx, emx, stash)
ka = ka + model%torsion%couple(ii)**2*model%torsion%gj(ii)
IF (model%has_axial_damping) ka = ka + ABS(model%BA(ii))*gm/(bt*dt)
ea_r = MAX(ea_r, ka/model%l0(ii))
+ kb = ABS(model%EI(ii))
+ IF (model%has_bend_damping) kb = kb + ABS(model%Bb(ii))*gm/(bt*dt)
+ ea_r = MAX(ea_r, kb/model%l0(ii)**3)
END DO
fscale = MAX(fscale, RESID_ROUNDOFF*EPSILON(CD_ONE)*ea_r*xref/tol)
! Nodal twist: the torque scale of the angle rows, frozen with fscale and formed like it
@@ -5074,6 +6712,47 @@ SUBROUTINE eval_res(qcur, use_trial, rn, esx, emx, stash)
END IF
END SUBROUTINE eval_res
+ LOGICAL FUNCTION at_roundoff_floor() RESULT(at_floor)
+ !! The iterate sits on the residual's round-off floor: a fresh Newton correction (ws_dq,
+ !! tw_dp) that no step length improves moves no free coordinate by more than
+ !! STALL_ROUNDOFF eps times its scale (the largest coordinate magnitude or element length,
+ !! and for the tangents and twist angles the largest of their magnitudes and 1), and the
+ !! residual is within STALL_SANITY of the force scale. Each coordinate is stored to its
+ !! last bit, and the inertia takes the acceleration c_a (q - q_n) from it, c_a =
+ !! 1/(beta dt^2): a row's inertial force cannot be resolved finer than about c_a M eps |q|,
+ !! which grows like 1/dt^2 and stands above tol*fscale on a line near rest at a small time
+ !! step (its inertia then sets no force scale). The residual test alone then never passes:
+ !! a 13 m riser at rest in a 0.95 m/s current (64 elements, dt 1.25e-4 s) took the VIV
+ !! lift and stagnated at 1.06 times the tolerance on its axial rows, and each 4-fold
+ !! smaller substep of the step recovery raised the stagnation about 16-fold. The criterion
+ !! is the EI = 0 route's (the residual within the operator's backward error of the
+ !! coordinates, eps max|q| ||A||), applied through the correction A^-1 G.
+ INTEGER :: ii
+ REAL(wp) :: xs, ts, ps
+ at_floor = .FALSE.
+ IF (.NOT. (rnorm <= STALL_SANITY)) RETURN
+ xs = MAXVAL(model%l0); ts = CD_ONE
+ DO ii = 1, ndof
+ IF (MOD(ii - 1, 6) < 3) THEN
+ xs = MAX(xs, ABS(model%ws_qk(ii)))
+ ELSE
+ ts = MAX(ts, ABS(model%ws_qk(ii)))
+ END IF
+ END DO
+ DO ii = 1, ndof
+ IF (.NOT. model%solve_mask(ii)) CYCLE
+ IF (.NOT. (ABS(model%ws_dq(ii)) <= STALL_ROUNDOFF*EPSILON(CD_ONE)*MERGE(xs, ts, MOD(ii - 1, 6) < 3))) RETURN
+ END DO
+ IF (model%tw_active) THEN
+ ps = MAX(CD_ONE, MAXVAL(ABS(model%tw_pk)))
+ DO ii = 1, model%nn
+ IF (.NOT. model%tw_free(ii)) CYCLE
+ IF (.NOT. (ABS(model%tw_dp(ii)) <= STALL_ROUNDOFF*EPSILON(CD_ONE)*ps)) RETURN
+ END DO
+ END IF
+ at_floor = .TRUE.
+ END FUNCTION at_roundoff_floor
+
SUBROUTINE impose_step_rigid_kinematics(q_state, v_state, a_state)
!! Eliminate the two prescribed rotational tangent components while leaving
!! the axial magnitude as the single solved coordinate. The scalar magnitude
@@ -5439,6 +7118,11 @@ SUBROUTINE CD_HermiteCable_Dyn_Step_Recovering(model, dt, max_iter, tol, ErrStat
model%ws_recovery_viv_phi = model%viv_phi
model%ws_recovery_viv_ms = model%viv_ms
END IF
+ IF (model%viv_wake) model%ws_recovery_wo_s = model%wo_s
+ IF (model%has_viv_il) THEN
+ model%ws_recovery_vil_phi = model%vil_phi
+ model%ws_recovery_vil_ms = model%vil_ms
+ END IF
IF (model%has_ctrl) THEN
model%ws_recovery_l0_c = model%l0_c
model%ws_recovery_l0_dot_c = model%l0_dot_c
@@ -5536,6 +7220,13 @@ SUBROUTINE CD_HermiteCable_Dyn_Step_Recovering(model, dt, max_iter, tol, ErrStat
model%viv_phi = model%ws_recovery_viv_phi; model%viv_ms = model%ws_recovery_viv_ms
model%viv_phi_eval = model%viv_phi
END IF
+ IF (model%viv_wake) THEN
+ model%wo_s = model%ws_recovery_wo_s; model%wo_q_eval = model%wo_s(1, :)
+ END IF
+ IF (model%has_viv_il) THEN
+ model%vil_phi = model%ws_recovery_vil_phi; model%vil_ms = model%ws_recovery_vil_ms
+ model%vil_phi_eval = model%vil_phi
+ END IF
IF (model%has_ctrl) model%l0_c = model%ws_recovery_l0_c
IF (model%has_ctrl) model%l0_dot_c = model%ws_recovery_l0_dot_c
model%na_steps_done = na_steps_save; model%na_iter_sum = na_sum_save; model%na_mn_active = na_mn_save
@@ -5616,6 +7307,13 @@ SUBROUTINE CD_HermiteCable_Dyn_Step_Recovering(model, dt, max_iter, tol, ErrStat
model%viv_phi = model%ws_recovery_viv_phi; model%viv_ms = model%ws_recovery_viv_ms
model%viv_phi_eval = model%viv_phi
END IF
+ IF (model%viv_wake) THEN
+ model%wo_s = model%ws_recovery_wo_s; model%wo_q_eval = model%wo_s(1, :)
+ END IF
+ IF (model%has_viv_il) THEN
+ model%vil_phi = model%ws_recovery_vil_phi; model%vil_ms = model%ws_recovery_vil_ms
+ model%vil_phi_eval = model%vil_phi
+ END IF
IF (model%has_ctrl) model%l0_c = model%ws_recovery_l0_c
IF (model%has_ctrl) model%l0_dot_c = model%ws_recovery_l0_dot_c
model%na_steps_done = na_steps_save
@@ -5666,6 +7364,13 @@ SUBROUTINE CD_HermiteCable_Dyn_Step_Recovering(model, dt, max_iter, tol, ErrStat
model%viv_phi = model%ws_recovery_viv_phi; model%viv_ms = model%ws_recovery_viv_ms
model%viv_phi_eval = model%viv_phi
END IF
+ IF (model%viv_wake) THEN
+ model%wo_s = model%ws_recovery_wo_s; model%wo_q_eval = model%wo_s(1, :)
+ END IF
+ IF (model%has_viv_il) THEN
+ model%vil_phi = model%ws_recovery_vil_phi; model%vil_ms = model%ws_recovery_vil_ms
+ model%vil_phi_eval = model%vil_phi
+ END IF
IF (model%has_ctrl) model%l0_c = model%ws_recovery_l0_c
IF (model%has_ctrl) model%l0_dot_c = model%ws_recovery_l0_dot_c
model%na_steps_done = na_steps_save; model%na_iter_sum = na_sum_save; model%na_mn_active = na_mn_save
@@ -6383,8 +8088,9 @@ SUBROUTINE CD_HermiteCable_Dyn_Reaction(model, node, freac, ErrStat, ErrMsg, ful
ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Reaction: node out of range'; RETURN
END IF
! Only the node's rows are needed: assemble them from the elements that reach the node
- ! (bit-identical to the full assembly below, which torsion still needs).
- IF (.NOT. (model%torsion%active .OR. full)) THEN
+ ! (bit-identical to the full assembly below, which the condensed torsion still needs: its
+ ! single Theta couples every element; the nodal twist's element torques do not).
+ IF (.NOT. ((model%torsion%active .AND. .NOT. model%tw_active) .OR. full)) THEN
CALL node_reaction(model, node, freac, es, em2)
IF (es /= CD_HCDYN_OK) THEN
freac = CD_ZERO
@@ -6418,8 +8124,10 @@ SUBROUTINE node_reaction(model, node, freac, ErrStat, ErrMsg, tangent_rows)
!! the node's rows of the total mass times the acceleration, with the added mass of those
!! elements. Every row term is formed and summed in the order of the full assembly and of
!! band_matvec, so the reaction is bit-identical, at the cost of one or two elements
- !! instead of the line, and the model's scratch is not touched. Not for a line with
- !! torsion, which couples every element. tangent_rows = .TRUE. returns the node's three
+ !! instead of the line, and the model's scratch is not touched (the rows are assembled in
+ !! ws_Rnode, a buffer of their own: no allocation per call). Not for a line with the
+ !! condensed torsion, which couples every element (the nodal twist is local: its element
+ !! torques reach the node's rows from the same elements). tangent_rows = .TRUE. returns the node's three
!! material-tangent rows instead of its translational ones (a rigid end connection).
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
INTEGER, INTENT(IN) :: node
@@ -6427,12 +8135,13 @@ SUBROUTINE node_reaction(model, node, freac, ErrStat, ErrMsg, tangent_rows)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
LOGICAL, INTENT(IN), OPTIONAL :: tangent_rows
- REAL(wp) :: Rn(SIZE(model%ws_R)), Me(12, 12), mam(3, -KL_D:KU_D), inert(3), m
+ REAL(wp) :: Me(12, 12), mam(3, -KL_D:KU_D), inert(3), m
INTEGER :: e, a, b, k, gi, gj, j, n, es
CHARACTER(1024) :: em
ErrStat = CD_HCDYN_OK; ErrMsg = ''; freac = CD_ZERO
- CALL assemble_residual(model, model%q, model%v, model%t, .TRUE., .FALSE., es, em, node_only=node, R_out=Rn)
+ ! the rows land in ws_Rnode (assemble_residual node_only without R_out)
+ CALL assemble_residual(model, model%q, model%v, model%t, .TRUE., .FALSE., es, em, node_only=node)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es; ErrMsg = TRIM(em); RETURN
END IF
@@ -6473,7 +8182,7 @@ SUBROUTINE node_reaction(model, node, freac, ErrStat, ErrMsg, tangent_rows)
inert(k) = inert(k) + m*model%a(j)
END DO
END DO
- freac = -(inert + Rn(gi + 1:gi + 3))
+ freac = -(inert + model%ws_Rnode(gi + 1:gi + 3))
END SUBROUTINE node_reaction
SUBROUTINE CD_HermiteCable_Dyn_End_Force(model, node, force, ErrStat, ErrMsg)
@@ -6526,15 +8235,8 @@ SUBROUTINE CD_HermiteCable_Dyn_End_Force(model, node, force, ErrStat, ErrMsg)
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_Dyn_End_Force: '//TRIM(em2); RETURN
END IF
r3 = fe(i0 + 1:i0 + 3)
- IF (model%has_axial_damping) THEN
- IF (model%has_ctrl) THEN
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), fdamp, ErrStat=es, ErrMsg=em2, &
- quadrature_order=model%axial_quadrature_order, &
- l0_dot=model%l0_dot(e))
- ELSE
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), fdamp, ErrStat=es, ErrMsg=em2, &
- quadrature_order=model%axial_quadrature_order)
- END IF
+ IF (model%has_axial_damping .OR. model%has_bend_damping .OR. model%has_mass_damping) THEN
+ CALL structural_damping_element(model, e, qe, ve, fdamp, es, em2)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_Dyn_End_Force: '//TRIM(em2); RETURN
END IF
@@ -6596,31 +8298,7 @@ SUBROUTINE CD_HermiteCable_Dyn_End_Force(model, node, force, ErrStat, ErrMsg)
IF (gap > CD_ZERO) r3(3) = r3(3) - model%kn*gap*model%trib(node)
END IF
IF (model%has_drag) THEN
- IF (model%has_wave .AND. model%wv_ncomp > 0) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em2, &
- wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=model%t, &
- wvc_amp=model%wv_ampc, wvc_om=model%wv_omc, &
- wvc_k=model%wv_kc, wvc_ph=model%wv_phc, &
- wvc_e2kd=model%wv_e2kd)
- ELSE IF (model%has_wave) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em2, &
- wv_h=model%wv_h, wv_om=model%wv_om, wv_k=model%wv_k, &
- wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=model%t)
- ELSE IF (model%has_held_field) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), &
- model%current + 0.5_wp*(model%hf_u(:, e) + model%hf_u(:, e + 1)), &
- 0.5_wp*(model%hf_wl(e) + model%hf_wl(e + 1)), &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em2)
- ELSE
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em2)
- END IF
+ CALL element_drag_load(model, e, qe, ve, model%l0(e), model%t, fdrag, es, em2)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es; ErrMsg = 'CD_HermiteCable_Dyn_End_Force: '//TRIM(em2); RETURN
END IF
@@ -6635,9 +8313,10 @@ SUBROUTINE CD_HermiteCable_Dyn_End_Force(model, node, force, ErrStat, ErrMsg)
END IF
IF (model%has_attach) THEN
! A clump or buoy on the end node loads the point holding it, exactly as it loads the
- ! end node in the residual (assemble_attachments).
+ ! end node in the residual (assemble_attachments). The point a free end carries
+ ! (att_point) is the body this force acts on, so its own loads stay out.
DO k = 1, SIZE(model%att_node)
- IF (model%att_node(k) /= node) CYCLE
+ IF (model%att_node(k) /= node .OR. model%att_point(k)) CYCLE
CALL attachment_residual(model, k, model%q, model%v, .FALSE., rk, has_jac, jrel, jtan, es, em2)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es; ErrMsg = 'CD_HermiteCable_Dyn_End_Force: '//TRIM(em2); RETURN
@@ -6786,7 +8465,8 @@ SUBROUTINE CD_HermiteCable_Dyn_Node_Recovery(model, ErrStat, ErrMsg, tension, cu
!! Effective tension, curvature and bend moment at every node (internal order) recovered
!! from nodal equilibrium, in one pass over the elements.
!!
- !! For element e the end residual g_e = f_int + f_damp - f_ext + M_e a_e holds the element's
+ !! For element e the end residual g_e = f_int + f_damp - f_ext + M_e a_e (without the tangent
+ !! rows of the bending damping, a viscous moment that is not EI r'') holds the element's
!! own distributed loads (consistent submerged weight, dry-part buoyancy, drag,
!! Froude-Krylov force, the seabed contact of its end nodes spread over their tributary
!! lengths, and the structural and added-mass inertia): it is the generalized force the two
@@ -7410,7 +9090,7 @@ SUBROUTINE added_mass_force(qe, ae, l0, waterline_z, rho, diam, can, cat, f, Err
CHARACTER(*), INTENT(OUT) :: ErrMsg
INTEGER, PARAMETER :: NGP = 4
REAL(wp), PARAMETER :: PI_L = 3.14159265358979323846_wp
- REAL(wp) :: gp(NGP), gw(NGP), H(4), dH(4), rpos(3), rp(3), acc(3), speed, tangent(3), fa(3), area
+ REAL(wp) :: gp(NGP), gw(NGP), H(4), dH(4), rpos(3), rp(3), acc(3), speed, tangent(3), fa(3), area, wf, dwf
INTEGER :: g, sh, c
ErrStat = CD_HCDYN_OK; ErrMsg = ''
@@ -7427,14 +9107,15 @@ SUBROUTINE added_mass_force(qe, ae, l0, waterline_z, rho, diam, can, cat, f, Err
rp(c) = dH(1)*qe(c) + dH(2)*qe(3 + c) + dH(3)*qe(6 + c) + dH(4)*qe(9 + c)
acc(c) = H(1)*ae(c) + H(2)*ae(3 + c) + H(3)*ae(6 + c) + H(4)*ae(9 + c)
END DO
- IF (rpos(3) > waterline_z) CYCLE ! dry Gauss point: no added mass
+ CALL CD_HermiteCable_Immersion(waterline_z - rpos(3), diam, wf, dwf)
+ IF (.NOT. (wf > CD_ZERO)) CYCLE ! dry Gauss point: no added mass
speed = SQRT(rp(1)**2 + rp(2)**2 + rp(3)**2)
IF (speed <= 1.0e-12_wp) THEN
ErrStat = CD_HCDYN_NOCONVERGE
ErrMsg = 'added-mass force: degenerate centreline (|dr/dxi| ~ 0)'; RETURN
END IF
tangent = rp/speed
- fa = gw(g)*speed*rho*area*(can*acc + (cat - can)*DOT_PRODUCT(tangent, acc)*tangent)
+ fa = (gw(g)*wf)*speed*rho*area*(can*acc + (cat - can)*DOT_PRODUCT(tangent, acc)*tangent)
DO sh = 1, 4
f(3*(sh - 1) + 1:3*sh) = f(3*(sh - 1) + 1:3*sh) + H(sh)*fa
END DO
@@ -7451,7 +9132,7 @@ SUBROUTINE element_end_residual(model, e, g, ErrStat, ErrMsg)
CHARACTER(*), INTENT(OUT) :: ErrMsg
REAL(wp), PARAMETER :: PI_L = 3.14159265358979323846_wp
INTEGER, PARAMETER :: ZS(4) = [3, 6, 9, 12]
- REAL(wp) :: qe(12), ve(12), ae(12), fe(12), fx(12), energy, fdry(4), kdry(4, 4)
+ REAL(wp) :: qe(12), ve(12), ae(12), fe(12), fx(12), fbd(12), energy, fdry(4), kdry(4, 4)
REAL(wp) :: dry_wl, dry_b, dry_r, hf_mid(3), l0, fca(3), fcb(3), c, a4(4), m4(4, 4)
REAL(wp) :: support(3), dsupport(3), nin(3), xa, xb, ca(4), cb(4)
INTEGER :: es, k, inode
@@ -7468,11 +9149,15 @@ SUBROUTINE element_end_residual(model, e, g, ErrStat, ErrMsg)
bending_quadrature_order=model%bending_quadrature_order)
IF (es /= CD_HCABLE_OK) GOTO 900
g = fe
- IF (model%has_axial_damping) THEN
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, l0, model%BA(e), fx, ErrStat=es, ErrMsg=em2, &
- quadrature_order=model%axial_quadrature_order)
+ IF (model%has_axial_damping .OR. model%has_bend_damping .OR. model%has_mass_damping) THEN
+ CALL structural_damping_element(model, e, qe, ve, fx, es, em2, fixed_length=.TRUE., fbend=fbd)
IF (es /= CD_HCDYN_OK) GOTO 900
g = g + fx
+ ! the viscous bending moment is not elastic: its tangent rows (the section moment the outputs
+ ! turn into curvature over EI) are left out, its position rows (the shear it carries) stay in
+ ! the section forces
+ g(4:6) = g(4:6) - fbd(4:6)
+ g(10:12) = g(10:12) - fbd(10:12)
END IF
! consistent submerged weight (as assemble_residual)
g(3) = g(3) + model%w(e)*0.5_wp*l0
@@ -7494,31 +9179,7 @@ SUBROUTINE element_end_residual(model, e, g, ErrStat, ErrMsg)
IF (dry) g(ZS) = g(ZS) + fdry
END IF
IF (model%has_drag) THEN
- IF (model%has_wave .AND. model%wv_ncomp > 0) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, l0, model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fx, ErrStat=es, ErrMsg=em2, &
- wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=model%t, &
- wvc_amp=model%wv_ampc, wvc_om=model%wv_omc, &
- wvc_k=model%wv_kc, wvc_ph=model%wv_phc, &
- wvc_e2kd=model%wv_e2kd)
- ELSE IF (model%has_wave) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, l0, model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fx, ErrStat=es, ErrMsg=em2, &
- wv_h=model%wv_h, wv_om=model%wv_om, wv_k=model%wv_k, &
- wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=model%t)
- ELSE IF (model%has_held_field) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, l0, &
- model%current + 0.5_wp*(model%hf_u(:, e) + model%hf_u(:, e + 1)), &
- 0.5_wp*(model%hf_wl(e) + model%hf_wl(e + 1)), &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fx, ErrStat=es, ErrMsg=em2)
- ELSE
- CALL CD_HermiteCable_Drag_Element(qe, ve, l0, model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fx, ErrStat=es, ErrMsg=em2)
- END IF
+ CALL element_drag_load(model, e, qe, ve, l0, model%t, fx, es, em2)
IF (es /= CD_HCDYN_OK) GOTO 900
g = g - fx
END IF
@@ -7736,7 +9397,7 @@ PURE REAL(wp) FUNCTION vector_angle(a, b) RESULT(angle)
angle = ATAN2(NORM2(c), DOT_PRODUCT(a, b))
END FUNCTION vector_angle
- SUBROUTINE CD_HermiteCable_Dyn_EndConnection_Moment(model, node, moment, ErrStat, ErrMsg)
+ SUBROUTINE CD_HermiteCable_Dyn_EndConnection_Moment(model, node, moment, ErrStat, ErrMsg, full_assembly)
!! Moment exerted by the line-end connection on its supporting body. Finite
!! mode evaluates the spring force; rigid mode recovers the exact constraint
!! reaction from the committed equation of motion. Pinned mode returns zero.
@@ -7745,8 +9406,12 @@ SUBROUTINE CD_HermiteCable_Dyn_EndConnection_Moment(model, node, moment, ErrStat
REAL(wp), INTENT(OUT) :: moment(3)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ ! .TRUE.: a rigid end's reaction from the full assembly, the reference the node's rows
+ ! reproduce bit for bit (as CD_HermiteCable_Dyn_Reaction)
+ LOGICAL, INTENT(IN), OPTIONAL :: full_assembly
INTEGER :: iend, base, es
+ LOGICAL :: full
REAL(wp) :: f_ec(3), k_ec(3, 3), direction(3), bend_moment(3)
CHARACTER(1024) :: em
@@ -7847,9 +9512,11 @@ SUBROUTINE CD_HermiteCable_Dyn_EndConnection_Moment(model, node, moment, ErrStat
! required in the residual is -G0 in the transverse tangent plane; under
! virtual work, m cross that contribution is the line's moment on the
! supporting body, matching the finite-spring convention. Only the end tangent's three
- ! rows are needed: without torsion (which couples every element) they come from the
- ! elements at the node, bit-identical to the full assembly (node_reaction).
- IF (model%torsion%active) THEN
+ ! rows are needed: without the condensed torsion (which couples every element) they come
+ ! from the elements at the node, bit-identical to the full assembly (node_reaction).
+ full = .FALSE.
+ IF (PRESENT(full_assembly)) full = full_assembly
+ IF ((model%torsion%active .AND. .NOT. model%tw_active) .OR. full) THEN
CALL assemble_residual(model, model%q, model%v, model%t, .TRUE., .FALSE., es, em)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es
@@ -8250,6 +9917,11 @@ SUBROUTINE CD_HermiteCable_Dyn_Snapshot(model, ErrStat, ErrMsg)
model%snap_viv_phi = model%viv_phi
model%snap_viv_ms = model%viv_ms
END IF
+ IF (model%viv_wake) model%snap_wo_s = model%wo_s
+ IF (model%has_viv_il) THEN
+ model%snap_vil_phi = model%vil_phi
+ model%snap_vil_ms = model%vil_ms
+ END IF
! the cached committed force goes with the state it describes (see fc_clears)
model%snap_fc_valid = model%fc_valid .AND. ALLOCATED(model%fc_R)
model%snap_fc_clears = model%fc_clears
@@ -8332,6 +10004,13 @@ SUBROUTINE CD_HermiteCable_Dyn_Restore(model, ErrStat, ErrMsg)
model%viv_phi = model%snap_viv_phi; model%viv_ms = model%snap_viv_ms
model%viv_phi_eval = model%viv_phi
END IF
+ IF (model%viv_wake) THEN
+ model%wo_s = model%snap_wo_s; model%wo_q_eval = model%wo_s(1, :)
+ END IF
+ IF (model%has_viv_il) THEN
+ model%vil_phi = model%snap_vil_phi; model%vil_ms = model%snap_vil_ms
+ model%vil_phi_eval = model%vil_phi
+ END IF
model%na_steps_done = model%snap_na_steps_done
model%na_iter_sum = model%snap_na_iter_sum
model%na_mn_active = model%snap_na_mn_active
@@ -8369,7 +10048,10 @@ SUBROUTINE CD_HermiteCable_Dyn_End(model)
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
IF (ALLOCATED(model%att_node)) DEALLOCATE (model%att_node, model%att_w, model%att_b, model%att_fk, &
model%att_cda, model%att_cdax)
+ IF (ALLOCATED(model%att_r)) DEALLOCATE (model%att_r)
IF (ALLOCATED(model%att_mass)) DEALLOCATE (model%att_mass, model%att_madd)
+ IF (ALLOCATED(model%att_iso)) DEALLOCATE (model%att_iso)
+ IF (ALLOCATED(model%att_point)) DEALLOCATE (model%att_point)
model%has_attach = .FALSE.
IF (ALLOCATED(model%l0_dot)) DEALLOCATE (model%l0_dot, model%l0_c, model%l0_dot_c, model%ws_recovery_l0_c, &
model%ws_recovery_l0_dot_c)
@@ -8389,6 +10071,10 @@ SUBROUTINE CD_HermiteCable_Dyn_End(model)
IF (ALLOCATED(model%w)) DEALLOCATE (model%w)
IF (ALLOCATED(model%BA)) DEALLOCATE (model%BA)
model%has_axial_damping = .FALSE.
+ IF (ALLOCATED(model%Bb)) DEALLOCATE (model%Bb)
+ model%has_bend_damping = .FALSE.
+ IF (ALLOCATED(model%ray_alpha)) DEALLOCATE (model%ray_alpha)
+ model%has_mass_damping = .FALSE.
IF (ALLOCATED(model%trib)) DEALLOCATE (model%trib)
IF (ALLOCATED(model%contact_kn)) DEALLOCATE (model%contact_kn)
IF (ALLOCATED(model%contact_cn)) DEALLOCATE (model%contact_cn)
@@ -8405,6 +10091,7 @@ SUBROUTINE CD_HermiteCable_Dyn_End(model)
model%ws_G, model%ws_Gt, model%ws_inert, model%ws_qtrial, model%ws_dq, &
model%ws_recovery_q0, model%ws_recovery_v0, model%ws_recovery_a0)
DEALLOCATE (model%ws_Rk, model%ws_Rt, model%fc_R, model%fc_q, model%fc_v)
+ IF (ALLOCATED(model%ws_Rnode)) DEALLOCATE (model%ws_Rnode)
DEALLOCATE (model%ws_Kb, model%ws_Kvb, &
model%ws_Keffb, model%ws_Msumb, model%ws_Mamb)
DEALLOCATE (model%ws_ipiv)
@@ -8529,8 +10216,10 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
! node_only: assemble only the residual rows of that node, into R_out (sized like the
! residual) instead of the model's residual: the elements that reach the node and its own
! nodal terms, each added in the order of the full assembly, so those rows are bit-identical
- ! and the model's scratch is untouched (node_reaction). Residual only, without torsion
- ! (which couples every element). The other rows of R_out are partial.
+ ! and the model's scratch is untouched (node_reaction). Residual only, without the
+ ! condensed torsion (which couples every element; the nodal twist adds the torques of the
+ ! node's elements and end spring, assemble_twist node_only). The other rows of R_out are partial.
+ ! Without R_out the rows land in the model's ws_Rnode.
INTEGER, INTENT(IN), OPTIONAL :: node_only
REAL(wp), INTENT(INOUT), TARGET, OPTIONAL :: R_out(:)
! stash_tangent: a full residual-only assembly that evaluates each element kernel once for
@@ -8602,9 +10291,9 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
Kvb => model%ws_Kvb
e_lo = 1; e_hi = ne; n_lo = 1; n_hi = model%nn
IF (PRESENT(node_only)) THEN
- IF (want_tangent .OR. model%torsion%active .OR. .NOT. PRESENT(R_out)) THEN
+ IF (want_tangent .OR. (model%torsion%active .AND. .NOT. model%tw_active)) THEN
ErrStat = CD_HCDYN_BADINPUT
- ErrMsg = 'a single-node assembly is residual-only, without torsion, into a caller residual'
+ ErrMsg = 'a single-node assembly is residual-only, without the condensed torsion'
RETURN
END IF
IF (node_only < 1 .OR. node_only > model%nn) THEN
@@ -8612,6 +10301,7 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
END IF
e_lo = MAX(1, node_only - 1); e_hi = MIN(ne, node_only)
n_lo = node_only; n_hi = node_only
+ R => model%ws_Rnode
END IF
IF (PRESENT(R_out)) THEN
IF (SIZE(R_out) /= SIZE(model%ws_R)) THEN
@@ -8823,7 +10513,8 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
CALL asm_mark(HC_ASM_CONTACT, asm_t)
! Scatter the element-private hydrodynamic tangents in the same phase and element
! order as the serial formulation, retaining its floating-point accumulation order.
- IF (tangent_only .AND. (model%has_drag .OR. model%has_axial_damping)) THEN
+ IF (tangent_only .AND. (model%has_drag .OR. model%has_axial_damping .OR. model%has_bend_damping .OR. &
+ model%has_mass_damping)) THEN
DO e = 1, ne
CALL scatter12_band(Kb, model%ws_elem_Kdrag(:, :, e), e)
CALL scatter12_band(Kvb, model%ws_elem_Kv(:, :, e), e)
@@ -8843,7 +10534,7 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
CALL asm_mark(HC_ASM_SCATTER, asm_t)
! Axial Kelvin-Voigt damping is an internal constitutive force. It uses the same
! reference-arc Hermite interpolation and axial quadrature as the elastic resultant.
- IF (model%has_axial_damping .AND. .NOT. tangent_only) THEN
+ IF ((model%has_axial_damping .OR. model%has_bend_damping .OR. model%has_mass_damping) .AND. .NOT. tangent_only) THEN
DO e = e_lo, e_hi
IF (kept) THEN
DO a = 1, 12
@@ -8856,23 +10547,10 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
qe(7:9) = q_cfg(6*e + 1:6*e + 3); qe(10:12) = q_cfg(6*e + 4:6*e + 6)
ve(1:3) = v_cfg(6*(e - 1) + 1:6*(e - 1) + 3); ve(4:6) = v_cfg(6*(e - 1) + 4:6*(e - 1) + 6)
ve(7:9) = v_cfg(6*e + 1:6*e + 3); ve(10:12) = v_cfg(6*e + 4:6*e + 6)
- IF (want_tangent .AND. model%has_ctrl) THEN
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), &
- fdamp, kdq, kdv, es, em_e, &
- model%axial_quadrature_order, model%l0_dot(e))
- ELSE IF (want_tangent) THEN
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), &
- fdamp, kdq, kdv, es, em_e, &
- model%axial_quadrature_order)
- ELSE IF (model%has_ctrl) THEN
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), &
- fdamp, ErrStat=es, ErrMsg=em_e, &
- quadrature_order=model%axial_quadrature_order, &
- l0_dot=model%l0_dot(e))
+ IF (want_tangent) THEN
+ CALL structural_damping_element(model, e, qe, ve, fdamp, es, em_e, kdq, kdv)
ELSE
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), &
- fdamp, ErrStat=es, ErrMsg=em_e, &
- quadrature_order=model%axial_quadrature_order)
+ CALL structural_damping_element(model, e, qe, ve, fdamp, es, em_e)
END IF
IF (es /= CD_HCDYN_OK) THEN
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = TRIM(em_e); RETURN
@@ -8912,18 +10590,23 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
IF (want_tangent) THEN
IF (model%has_wave .AND. model%wv_ncomp > 0) THEN
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
fdrag, djq, djv, es, em_e, &
wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=t_eval, &
wvc_amp=model%wv_ampc, wvc_om=model%wv_omc, &
wvc_k=model%wv_kc, wvc_ph=model%wv_phc, &
- wvc_e2kd=model%wv_e2kd)
+ wvc_e2kd=model%wv_e2kd, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
ELSE IF (model%has_wave) THEN
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
fdrag, djq, djv, es, em_e, &
wv_h=model%wv_h, wv_om=model%wv_om, wv_k=model%wv_k, &
- wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=t_eval)
+ wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=t_eval, &
+ cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
ELSE IF (model%has_held_field) THEN
! HELD host field: the element's ambient velocity = the drag config's constant
! current + the two end nodes' held-velocity average; the element waterline =
@@ -8931,39 +10614,19 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), &
model%current + 0.5_wp*(model%hf_u(:, e) + model%hf_u(:, e + 1)), &
0.5_wp*(model%hf_wl(e) + model%hf_wl(e + 1)), &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, djq, djv, es, em_e)
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
+ fdrag, djq, djv, es, em_e, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
ELSE
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, djq, djv, es, em_e)
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
+ fdrag, djq, djv, es, em_e, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
END IF
ELSE
- IF (model%has_wave .AND. model%wv_ncomp > 0) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em_e, &
- wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=t_eval, &
- wvc_amp=model%wv_ampc, wvc_om=model%wv_omc, &
- wvc_k=model%wv_kc, wvc_ph=model%wv_phc, &
- wvc_e2kd=model%wv_e2kd)
- ELSE IF (model%has_wave) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em_e, &
- wv_h=model%wv_h, wv_om=model%wv_om, wv_k=model%wv_k, &
- wv_depth=model%wv_depth, wv_dir=model%wv_dir, wv_t=t_eval)
- ELSE IF (model%has_held_field) THEN
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), &
- model%current + 0.5_wp*(model%hf_u(:, e) + model%hf_u(:, e + 1)), &
- 0.5_wp*(model%hf_wl(e) + model%hf_wl(e + 1)), &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em_e)
- ELSE
- CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fdrag, ErrStat=es, ErrMsg=em_e)
- END IF
+ CALL element_drag_load(model, e, qe, ve, model%l0(e), t_eval, fdrag, es, em_e)
END IF
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es; ErrMsg = TRIM(em_e); RETURN
@@ -9155,7 +10818,12 @@ SUBROUTINE assemble_residual(model, q_cfg, v_cfg, t_eval, want_residual, want_ta
! rank-one g g^T / C joins the solve by Sherman-Morrison; g is kept in tors_g). Nodal
! twist: the element torques and end springs (assemble_twist).
IF (model%tw_active .AND. (want_residual .OR. want_tangent)) THEN
- CALL assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, Kb, Kvb, es, em2)
+ IF (PRESENT(node_only)) THEN
+ CALL assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, Kb, Kvb, es, em2, &
+ node_only=node_only)
+ ELSE
+ CALL assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, Kb, Kvb, es, em2)
+ END IF
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es; ErrMsg = TRIM(em2); RETURN
END IF
@@ -9283,6 +10951,8 @@ PURE SUBROUTINE tw_unpack(model, buf)
model%tw_psi = buf(9*nn + 2*ne + 1:9*nn + 2*ne + 2)
model%tw_om = RESHAPE(buf(9*nn + 2*ne + 3:9*nn + 2*ne + 8), [3, 2])
model%tw_oal = RESHAPE(buf(9*nn + 2*ne + 9:9*nn + 2*ne + 14), [3, 2])
+ ! (tw_rq stays: it is a configuration this model evaluated, and a reloaded reference is used
+ ! there only where its tangents are those of tw_rq, see tw_advance_reference)
END SUBROUTINE tw_unpack
ELEMENTAL REAL(wp) FUNCTION tw_wrap(x) RESULT(y)
@@ -9542,7 +11212,8 @@ SUBROUTINE twist_link(model, iend, q_cfg, ends, want_hess, psi, gl, hl, ErrStat,
END IF
END SUBROUTINE twist_link
- SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, Kb, Kvb, ErrStat, ErrMsg)
+ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, Kb, Kvb, ErrStat, ErrMsg, &
+ node_only)
!! Nodal-twist part of assemble_residual: every element's torque M_e = (GJ/l0) tw_e + (Bt/l0)
!! d tw_e/dt (tw_e = phi_{e+1} - phi_e + rho_e(q), d/dt from the nodal rates and g . q_dot)
!! and every elastic end's spring, at q_cfg, v_cfg and the angles and rates of the running
@@ -9552,6 +11223,10 @@ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, K
!! for the solve (tw_eg, tw_ehv, tw_ek, tw_ed, tw_lg, tw_lk; want_tangent). tw_me holds the
!! element torques and tw_tsum the summed twist.
!!
+ !! node_only (residual only): the rows of that node alone, from the elements that reach it
+ !! and its end spring, each added as the full assembly adds it (assemble_residual node_only);
+ !! the model's twist scratch (tw_R, tw_me, tw_tsum) is not touched.
+ !!
!! An element whose length changes at the rate l0_dot (active line control) damps the rate of
!! its twist per length, the quantity tau/l0 its elastic torque GJ tau/l0 reads, as the axial
!! damping takes the rate of the strain: M_e = (GJ/l0) tau + (Bt/l0) (d tau/dt - tau l0_dot/l0),
@@ -9568,6 +11243,7 @@ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, K
REAL(wp), INTENT(INOUT) :: R(:), Kb(:, :), Kvb(:, :)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER, INTENT(IN), OPTIONAL :: node_only
REAL(wp), POINTER :: phi(:), w(:)
REAL(wp) :: ends(3, 4), phi_end, rho, beta, g(12), h(12, 12), ve(12), hv(12), ke(12, 12), kel, kd
REAL(wp) :: om(3, 2), ew(3, 2)
@@ -9576,12 +11252,24 @@ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, K
! length-rate share of the damping (active line control): l0_dot/l0, the element's tangent
! handles (m in the 12-DOF layout, the r slots zero) and the angle stiffness it leaves
REAL(wp) :: rr, mv(12), gmv(12), kel_t, cpl
- LOGICAL :: ctrl_rate
- INTEGER :: e, iend, node, b, i, j, es
+ LOGICAL :: ctrl_rate, one_node
+ INTEGER :: e, iend, node, b, i, j, es, e_lo, e_hi
CHARACTER(1024) :: em
ErrStat = CD_HCDYN_OK
ErrMsg = ''
+ one_node = PRESENT(node_only)
+ e_lo = 1
+ e_hi = model%ne
+ IF (one_node) THEN
+ IF (want_tangent .OR. .NOT. want_residual .OR. node_only < 1 .OR. node_only > model%nn) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'assemble_twist: a single-node assembly is residual-only, at a node of the line'
+ RETURN
+ END IF
+ e_lo = MAX(1, node_only - 1)
+ e_hi = MIN(model%ne, node_only)
+ END IF
CALL tw_frames(model, ends, phi_end)
IF (model%tors_use_step) THEN
phi => model%tw_pe
@@ -9590,11 +11278,11 @@ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, K
phi => model%tw_phi
w => model%tw_w
END IF
- IF (want_residual) model%tw_R = CD_ZERO
- model%tw_tsum = CD_ZERO
+ IF (want_residual .AND. .NOT. one_node) model%tw_R = CD_ZERO
+ IF (.NOT. one_node) model%tw_tsum = CD_ZERO
om = MERGE(model%tw_som, model%tw_om, model%tors_use_step)
turning = ANY(ABS(om) > CD_ZERO) .AND. ALLOCATED(model%torsion%bt)
- DO e = 1, model%ne
+ DO e = e_lo, e_hi
kd = CD_ZERO
IF (ALLOCATED(model%torsion%bt)) kd = model%torsion%bt(e)/model%l0(e)
! an element at a rigid end twists through rho as its end frame turns: its damping rate
@@ -9631,6 +11319,10 @@ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, K
kel_t = kel - kd*rr
END IF
mt = kel*tau + kd*rate
+ IF (one_node) THEN
+ R(6*e - 5:6*e + 6) = R(6*e - 5:6*e + 6) + mt*g
+ CYCLE
+ END IF
model%tw_me(e) = mt
model%tw_tsum = model%tw_tsum + tau
IF (want_residual) THEN
@@ -9674,6 +11366,9 @@ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, K
END IF
DO iend = 1, 2
IF (.NOT. tw_spring(model, iend)) CYCLE
+ IF (one_node) THEN
+ IF (MERGE(1, model%nn, iend == 1) /= node_only) CYCLE
+ END IF
CALL twist_link(model, iend, q_cfg, ends, want_tangent, psi, gl, hl, es, em)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es
@@ -9689,6 +11384,14 @@ SUBROUTINE assemble_twist(model, q_cfg, v_cfg, want_residual, want_tangent, R, K
tw = psi + phi_end - phi(model%nn)
END IF
mt = k*tw
+ IF (one_node) THEN
+ IF (iend == 1) THEN
+ R(b + 1:b + 3) = R(b + 1:b + 3) - mt*gl
+ ELSE
+ R(b + 1:b + 3) = R(b + 1:b + 3) + mt*gl
+ END IF
+ CYCLE
+ END IF
model%tw_tsum = model%tw_tsum + tw
IF (want_residual) THEN
IF (iend == 1) THEN
@@ -9869,7 +11572,7 @@ SUBROUTINE tw_init(model, mt, ErrStat, ErrMsg)
model%tw_we(nn))
ALLOCATE (model%tw_eg(12, ne), model%tw_ehv(12, ne), model%tw_ek(ne), model%tw_ed(ne), model%tw_me(ne))
ALLOCATE (model%tw_K7(3*KB7 + 1, 7*nn), model%tw_x7(7*nn), model%tw_ipiv(7*nn))
- ALLOCATE (model%tw_su(3, nn), model%tw_stn(3, nn), model%tw_sbeta(ne))
+ ALLOCATE (model%tw_su(3, nn), model%tw_stn(3, nn), model%tw_sbeta(ne), model%tw_sq(6*nn), model%tw_rq(6*nn))
ALLOCATE (model%ws_recovery_tw(tw_pack_size(model)))
END IF
model%tw_pn = CD_ZERO; model%tw_wn = CD_ZERO; model%tw_an = CD_ZERO; model%tw_pk = CD_ZERO
@@ -9965,6 +11668,7 @@ SUBROUTINE tw_init(model, mt, ErrStat, ErrMsg)
model%tw_w = CD_ZERO
model%tw_al = CD_ZERO
model%tw_mt = mt
+ model%tw_rq_ok = .FALSE.
model%tw_active = .TRUE.
CONTAINS
PURE FUNCTION unit_perp(x, ax) RESULT(y)
@@ -10025,6 +11729,8 @@ SUBROUTINE tw_release(model)
IF (ALLOCATED(model%tw_eg)) DEALLOCATE (model%tw_eg, model%tw_ehv, model%tw_ek, model%tw_ed, model%tw_me)
IF (ALLOCATED(model%tw_K7)) DEALLOCATE (model%tw_K7, model%tw_x7, model%tw_ipiv)
IF (ALLOCATED(model%tw_su)) DEALLOCATE (model%tw_su, model%tw_stn, model%tw_sbeta)
+ IF (ALLOCATED(model%tw_sq)) DEALLOCATE (model%tw_sq, model%tw_rq)
+ model%tw_rq_ok = .FALSE.
IF (ALLOCATED(model%ws_recovery_tw)) DEALLOCATE (model%ws_recovery_tw)
IF (ALLOCATED(model%snap_tw)) DEALLOCATE (model%snap_tw)
IF (ALLOCATED(model%snap_tw_fcR)) DEALLOCATE (model%snap_tw_fcR)
@@ -10035,18 +11741,47 @@ SUBROUTINE tw_advance_reference(model, q_new, ends_new, ErrStat, ErrMsg)
!! reference twists and end-frame references (the step's own formulas, so the committed
!! state reproduces the converged iterate bit for bit), the unit tangents and the directors
!! carried over by the smallest rotation (a rigid end's: its end frame's normal carried).
+ !!
+ !! An interior element (not at a rigid end) whose 12 DOFs are those of the last committed step
+ !! (tw_rq) and whose unit node tangents are those of the reference, bit for bit, keeps its
+ !! reference twist: its transport solid angles are those of the reference terms they are
+ !! differenced against, so twist_reference returns tw_beta(e) + tw_wrap(0) + 0, which is
+ !! formed here without the evaluation; and it passed every check of twist_reference (the
+ !! element's fold and handle checks) at that very shape. A frame-only transfer between steps
+ !! (CD_HermiteCable_Dyn_Set_Torsion_Frames at the committed shape, where a host writes only
+ !! the end nodes) so evaluates only the elements at a rigid end or at a node the host moved;
+ !! the commit of a step evaluates every element that moved.
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
REAL(wp), INTENT(IN) :: q_new(:), ends_new(3, 4)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
INTEGER :: e, i, iend
- REAL(wp) :: rho, beta, g(12), h(12, 12), psi, gl(3), hl(3, 3), u(3), t(3)
+ REAL(wp) :: rho, beta, g(12), h(12, 12), psi, gl(3), hl(3, 3), u(3), t(3), rn
+ LOGICAL :: kept_prev, kept_i
ErrStat = CD_HCDYN_OK
ErrMsg = ''
+ ! the unit tangents at q_new first: an element whose two tangents are the reference's keeps
+ ! its reference twist
+ ! (a zero handle keeps a zero tangent here, so its elements are evaluated and report it)
+ DO i = 1, model%nn
+ rn = NORM2(q_new(6*i - 2:6*i))
+ model%tw_stn(:, i) = CD_ZERO
+ IF (rn > CD_ZERO) model%tw_stn(:, i) = q_new(6*i - 2:6*i)/rn
+ END DO
+ model%tw_sq = q_new
+ kept_prev = .FALSE.
DO e = 1, model%ne
- CALL twist_reference(model, e, q_new, ends_new, .FALSE., rho, beta, g, h, ErrStat, ErrMsg)
- IF (ErrStat /= CD_HCDYN_OK) RETURN
- model%tw_sbeta(e) = beta
+ kept_i = node_kept(e + 1)
+ IF (e == 1) kept_prev = node_kept(1)
+ IF (kept_prev .AND. kept_i .AND. .NOT. ((e == 1 .AND. model%tw_rigid(1)) .OR. &
+ (e == model%ne .AND. model%tw_rigid(2)))) THEN
+ model%tw_sbeta(e) = model%tw_beta(e) + tw_wrap(CD_ZERO) + CD_ZERO
+ ELSE
+ CALL twist_reference(model, e, q_new, ends_new, .FALSE., rho, beta, g, h, ErrStat, ErrMsg)
+ IF (ErrStat /= CD_HCDYN_OK) RETURN
+ model%tw_sbeta(e) = beta
+ END IF
+ kept_prev = kept_i
END DO
model%tw_spsi = model%tw_psi
DO iend = 1, 2
@@ -10056,8 +11791,7 @@ SUBROUTINE tw_advance_reference(model, q_new, ends_new, ErrStat, ErrMsg)
model%tw_spsi(iend) = psi
END DO
DO i = 1, model%nn
- t = q_new(6*i - 2:6*i)/NORM2(q_new(6*i - 2:6*i))
- model%tw_stn(:, i) = t
+ t = model%tw_stn(:, i)
IF (i == 1 .AND. model%tw_rigid(1)) THEN
u = CD_HermiteTwist_Carry(ends_new(:, 1), t, ends_new(:, 2))
ELSE IF (i == model%nn .AND. model%tw_rigid(2)) THEN
@@ -10068,6 +11802,22 @@ SUBROUTINE tw_advance_reference(model, q_new, ends_new, ErrStat, ErrMsg)
u = u - DOT_PRODUCT(u, t)*t
model%tw_su(:, i) = u/NORM2(u)
END DO
+ CONTAINS
+ LOGICAL FUNCTION node_kept(k) RESULT(kept)
+ !! Node k's six DOFs are those of the committed reference configuration and its unit
+ !! tangent the reference tangent, bit for bit.
+ INTEGER, INTENT(IN) :: k
+ INTEGER :: jj
+ kept = model%tw_rq_ok
+ DO jj = 6*k - 5, 6*k
+ IF (.NOT. kept) RETURN
+ kept = bits_equal(q_new(jj), model%tw_rq(jj))
+ END DO
+ DO jj = 1, 3
+ IF (.NOT. kept) RETURN
+ kept = bits_equal(model%tw_stn(jj, k), model%tw_tn(jj, k))
+ END DO
+ END FUNCTION node_kept
END SUBROUTINE tw_advance_reference
SUBROUTINE tw_frame_rates(model, dt)
@@ -10089,12 +11839,22 @@ SUBROUTINE tw_frame_rates(model, dt)
END DO
END SUBROUTINE tw_frame_rates
- SUBROUTINE tw_commit_reference(model)
- !! Make the reference state of tw_advance_reference the committed one.
+ SUBROUTINE tw_commit_reference(model, frames_only)
+ !! Make the reference state of tw_advance_reference the committed one. After a step it also
+ !! records the step's configuration as tw_rq; a frame-only transfer (frames_only) keeps the
+ !! tw_rq of the last step, as it moves no element DOF but the end nodes'.
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
+ LOGICAL, INTENT(IN), OPTIONAL :: frames_only
+ LOGICAL :: record
+ record = .TRUE.
+ IF (PRESENT(frames_only)) record = .NOT. frames_only
model%tw_beta = model%tw_sbeta
model%tw_psi = model%tw_spsi
model%tw_tn = model%tw_stn
+ IF (record) THEN
+ model%tw_rq = model%tw_sq
+ model%tw_rq_ok = .TRUE.
+ END IF
model%tw_u = model%tw_su
END SUBROUTINE tw_commit_reference
@@ -10468,16 +12228,8 @@ SUBROUTINE evaluate_tangent_element(model, e, q_cfg, v_cfg, t_eval, Kstruct, Kdr
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'element: '//TRIM(em); RETURN
END IF
- IF (model%has_axial_damping) THEN
- IF (model%has_ctrl) THEN
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), &
- fload, djq, djv, es, em, &
- model%axial_quadrature_order, model%l0_dot(e))
- ELSE
- CALL CD_HermiteCable_Axial_Damping_Element(qe, ve, model%l0(e), model%BA(e), &
- fload, djq, djv, es, em, &
- model%axial_quadrature_order)
- END IF
+ IF (model%has_axial_damping .OR. model%has_bend_damping .OR. model%has_mass_damping) THEN
+ CALL structural_damping_element(model, e, qe, ve, fload, es, em, djq, djv)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = TRIM(em); RETURN
END IF
@@ -10489,26 +12241,35 @@ SUBROUTINE evaluate_tangent_element(model, e, q_cfg, v_cfg, t_eval, Kstruct, Kdr
IF (model%has_drag) THEN
IF (model%has_wave .AND. model%wv_ncomp > 0) THEN
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
fload, djq, djv, es, em, wv_depth=model%wv_depth, &
wv_dir=model%wv_dir, wv_t=t_eval, wvc_amp=model%wv_ampc, &
wvc_om=model%wv_omc, wvc_k=model%wv_kc, wvc_ph=model%wv_phc, &
- wvc_e2kd=model%wv_e2kd)
+ wvc_e2kd=model%wv_e2kd, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
ELSE IF (model%has_wave) THEN
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
fload, djq, djv, es, em, wv_h=model%wv_h, wv_om=model%wv_om, &
wv_k=model%wv_k, wv_depth=model%wv_depth, wv_dir=model%wv_dir, &
- wv_t=t_eval)
+ wv_t=t_eval, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
ELSE IF (model%has_held_field) THEN
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), &
model%current + 0.5_wp*(model%hf_u(:, e) + model%hf_u(:, e + 1)), &
0.5_wp*(model%hf_wl(e) + model%hf_wl(e + 1)), model%rho_w, &
- model%diam(e), model%cdn(e), model%cdt(e), fload, djq, djv, es, em)
+ model%diam(e), elem_cdn(model, e), model%cdt(e), fload, djq, djv, es, em, &
+ cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
ELSE
CALL CD_HermiteCable_Drag_Element(qe, ve, model%l0(e), model%current, model%waterline_z, &
- model%rho_w, model%diam(e), model%cdn(e), model%cdt(e), &
- fload, djq, djv, es, em)
+ model%rho_w, model%diam(e), elem_cdn(model, e), model%cdt(e), &
+ fload, djq, djv, es, em, cdy=elem_cdy(model, e), &
+ cdy_lin=elem_cdy_lin(model, e), &
+ frame_v=elem_frame_v(model, e))
END IF
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es; ErrMsg = TRIM(em); RETURN
@@ -10771,10 +12532,91 @@ SUBROUTINE fail(msg)
END SUBROUTINE fail
END SUBROUTINE CD_HermiteCable_Axial_Damping_Element
+ PURE SUBROUTINE CD_HermiteCable_Immersion(depth, diam, wf, dwf)
+ !! Immersed fraction wf of a cable section whose centre lies depth below the free surface
+ !! (negative above it), linear across one diameter: 0 from D/2 above the surface, 1 from D/2
+ !! below, 1/2 at the surface, and its derivative dwf = d wf/d z with respect to the height of
+ !! the centre (-1/D in the band, 0 outside). A fully submerged point has wf exactly 1; across
+ !! the surface the hydrodynamic load of a Gauss point is continuous in the position, where a
+ !! wet/dry switch made it jump (a static equilibrium with a Gauss point at the surface then had
+ !! no root and the solve stalled).
+ REAL(wp), INTENT(IN) :: depth, diam
+ REAL(wp), INTENT(OUT) :: wf, dwf
+ REAL(wp) :: x
+ x = 0.5_wp + depth/diam
+ IF (x >= CD_ONE) THEN
+ wf = CD_ONE
+ dwf = CD_ZERO
+ ELSE IF (x <= CD_ZERO) THEN
+ wf = CD_ZERO
+ dwf = CD_ZERO
+ ELSE
+ wf = x
+ dwf = -CD_ONE/diam
+ END IF
+ END SUBROUTINE CD_HermiteCable_Immersion
+
+ PURE REAL(wp) FUNCTION CD_HermiteCable_Point_Radius(volume, cda) RESULT(r)
+ !! Radius of the sphere whose immersion wets a point attachment at the free surface: the
+ !! sphere of its volume, r = (3 V/(4 pi))^(1/3), or without a volume that of its projected
+ !! drag area, CdA = pi r^2 (as rigid6_wet_fraction sizes a Rigid6 body); 0 for neither.
+ REAL(wp), INTENT(IN) :: volume, cda
+ REAL(wp), PARAMETER :: PI_ = 3.14159265358979323846_wp
+ IF (volume > CD_ZERO) THEN
+ r = (3.0_wp*volume/(4.0_wp*PI_))**(CD_ONE/3.0_wp)
+ ELSE IF (cda > CD_ZERO) THEN
+ r = SQRT(cda/PI_)
+ ELSE
+ r = CD_ZERO
+ END IF
+ END FUNCTION CD_HermiteCable_Point_Radius
+
+ PURE SUBROUTINE CD_HermiteCable_Point_Immersion(depth, radius, wf, dwf, psi)
+ !! Immersed fraction wf of a sphere of radius r whose centre lies depth below the free
+ !! surface (negative above it), the formula of a Rigid6 body (rigid6_wet_fraction): with the
+ !! immersed height h = clamp(depth + r, 0, 2 r), wf = h^2 (3 r - h)/(4 r^3), 0 from r above
+ !! the surface, 1 from r below, 1/2 at the surface, continuous with its slope (C1). dwf =
+ !! d wf/d z, the derivative with respect to the height of the centre: -3 h (2 r - h)/(4 r^3)
+ !! in the band, 0 outside. psi (optional) = the integral of wf over the height, zero above
+ !! the band and -depth below it (in the band -(r h^3 - h^4/4)/(4 r^3)): the buoyancy
+ !! rho g V wf is the force of the potential -rho g V psi. A point (r = 0) is wet at and below
+ !! the surface (the old switch, dwf 0).
+ REAL(wp), INTENT(IN) :: depth, radius
+ REAL(wp), INTENT(OUT) :: wf, dwf
+ REAL(wp), INTENT(OUT), OPTIONAL :: psi
+ REAL(wp) :: h, r3
+ IF (.NOT. (radius > CD_ZERO)) THEN
+ IF (depth >= CD_ZERO) THEN
+ wf = CD_ONE
+ IF (PRESENT(psi)) psi = -depth
+ ELSE
+ wf = CD_ZERO
+ IF (PRESENT(psi)) psi = CD_ZERO
+ END IF
+ dwf = CD_ZERO
+ RETURN
+ END IF
+ IF (depth >= radius) THEN
+ wf = CD_ONE
+ dwf = CD_ZERO
+ IF (PRESENT(psi)) psi = -depth
+ ELSE IF (depth <= -radius) THEN
+ wf = CD_ZERO
+ dwf = CD_ZERO
+ IF (PRESENT(psi)) psi = CD_ZERO
+ ELSE
+ h = depth + radius
+ r3 = 4.0_wp*radius**3
+ wf = h*h*(3.0_wp*radius - h)/r3
+ dwf = -3.0_wp*h*(2.0_wp*radius - h)/r3
+ IF (PRESENT(psi)) psi = -(radius*h**3 - 0.25_wp*h**4)/r3
+ END IF
+ END SUBROUTINE CD_HermiteCable_Point_Immersion
+
SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, diam, cdn, cdt, &
fdrag, djq, djv, ErrStat, ErrMsg, &
wv_h, wv_om, wv_k, wv_depth, wv_dir, wv_t, &
- wvc_amp, wvc_om, wvc_k, wvc_ph, wvc_e2kd)
+ wvc_amp, wvc_om, wvc_k, wvc_ph, wvc_e2kd, cdy, cdy_lin, frame_v)
!! Consistent Gauss-integrated Morison quadratic drag on one cubic-Hermite bending-cable element.
!! qe(12), ve(12) = [r1, m1, r2, m2] nodal positions and velocities; the interior velocity and
!! tangent use the SAME cubic-Hermite interpolation as the geometry, so the material-tangent (m)
@@ -10784,13 +12626,13 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
!! rel-velocity / tangent Jacobians come from the analytical Morison primitive, so djq/djv are
!! exact (FD-verified) and vanish smoothly at zero relative velocity (fixed-point safe).
!!
- !! Submergence is evaluated per Gauss point (a point with r_z above waterline_z contributes no
- !! drag). For a FULLY submerged element -- the production regime for a lazy-wave power cable or a
- !! mooring, which hangs entirely below the free surface -- every Gauss point is wet and the
- !! integral is exact. For an element that STRADDLES the waterline this is a bounded Gauss-sampling
- !! approximation (the wetted length is quantised to the abscissae and the crossing-point
- !! derivative is dropped); surface-piercing elements do not get an exact wet-portion
- !! integration, which fully-submerged cables do not need.
+ !! Submergence is evaluated per Gauss point as the immersed fraction of its section, linear
+ !! across one diameter about the surface (CD_HermiteCable_Immersion), with its derivative in
+ !! djq. For a FULLY submerged element -- the production regime for a lazy-wave power cable or a
+ !! mooring, which hangs entirely below the free surface -- every fraction is exactly 1 and the
+ !! integral is exact. For an element that STRADDLES the waterline the load stays continuous in
+ !! the position (a wet/dry switch per point made it jump, and a static equilibrium with a point
+ !! at the surface had no root); the wetted length is still sampled at the abscissae.
!! OPTIONAL WAVES: supplying a wave family adds the wave velocity at each wet Gauss point
!! (Wheeler-stretched, z measured from waterline_z) to the fluid velocity the drag sees.
!! Exactly one family with the shared wv_depth/wv_dir/wv_t: the scalar REGULAR trio
@@ -10800,6 +12642,16 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
!! the standard explicit-field treatment (the residual is exact; the tangent omits a term of
!! order k*H*omega, far below the structural stiffness), so Newton convergence is preserved.
REAL(wp), INTENT(IN) :: qe(12), ve(12), l0, fluid(3), waterline_z, rho, diam, cdn, cdt
+ ! cross-flow damping coefficient C_dy >= 0 of Thorsen et al. (2016): the normal drag splits into
+ ! Morison in line and 1/2 rho D C_dy |w_y| w_y across the ambient flow (fluid plus the waves at the
+ ! point), CD_Morison_Drag_Split_Per_Length_Jac with u_ref CD_HCDYN_CDY_UREF; absent or negative:
+ ! Morison's drag
+ REAL(wp), INTENT(IN), OPTIONAL :: cdy
+ ! with cdy: the Morison-form cross-flow coefficient (CD_Morison_Drag_Split_Per_Length_Jac cdy_lin)
+ REAL(wp), INTENT(IN), OPTIONAL :: cdy_lin
+ ! with cdy: the velocity of the flow frame (VIV FRAME), which the ambient flow of the split's axes
+ ! and blend is taken relative to (the drag itself keeps the flow relative to the cable)
+ REAL(wp), INTENT(IN), OPTIONAL :: frame_v(3)
REAL(wp), INTENT(OUT) :: fdrag(12)
! djq/djv are OPTIONAL as a pair: a residual-only evaluation (a line-search trial, which
! never solves with a tangent) omits both and skips the 12x12 Jacobian accumulation --
@@ -10816,8 +12668,8 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
REAL(wp), PARAMETER :: G3 = 0.7745966692414834_wp ! sqrt(3/5)
REAL(wp) :: gp(NGP), gw(NGP), H(4), dH(4)
REAL(wp) :: rpos(3), vvel(3), rp(3), speed, tangent(3), urel(3), fpl(3), Jrel(3, 3), Jtan(3, 3)
- REAL(wp) :: jq3(3, 3), scale, eta_w, uw(3), aw(3)
- LOGICAL :: has_wv, has_shared, has_trio, has_cmp, any_wv_arg, want_jac
+ REAL(wp) :: jq3(3, 3), scale, eta_w, uw(3), aw(3), uamb(3), wf, dwf, gww, zsurf
+ LOGICAL :: has_wv, has_shared, has_trio, has_cmp, any_wv_arg, want_jac, split
INTEGER :: g, s, c, sp, cp, a, b, es
! the message of a per-Gauss-point CableDyn_Hydro kinematics or Morison call (at most 154
! characters): a short buffer, as these calls reset it at every Gauss point
@@ -10833,6 +12685,9 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
IF (want_jac) THEN
djq = CD_ZERO; djv = CD_ZERO
END IF
+ split = PRESENT(cdy)
+ IF (split) split = cdy >= CD_ZERO
+ uw = CD_ZERO
has_shared = PRESENT(wv_depth) .AND. PRESENT(wv_dir) .AND. PRESENT(wv_t)
has_trio = PRESENT(wv_h) .AND. PRESENT(wv_om) .AND. PRESENT(wv_k)
has_cmp = PRESENT(wvc_amp) .AND. PRESENT(wvc_om) .AND. PRESENT(wvc_k) .AND. PRESENT(wvc_ph)
@@ -10907,10 +12762,28 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
IF (es /= CD_HYDRO_OK) THEN
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_Drag_Element: '//TRIM(em2); RETURN
END IF
- IF (rpos(3) - waterline_z > eta_w) CYCLE ! above the instantaneous surface: dry
+ CALL CD_HermiteCable_Immersion(waterline_z + eta_w - rpos(3), diam, wf, dwf)
+ IF (wf > CD_ZERO .AND. rpos(3) - waterline_z > eta_w) THEN
+ ! a centre above the surface inside the band: its immersed part takes the wave velocity at
+ ! the surface (the Wheeler kinematics vanish above it), so the drag stays continuous
+ IF (has_cmp) THEN
+ zsurf = eta_w
+ CALL CD_Component_Wave_Kinematics(rpos(1), rpos(2), zsurf, wv_t, wv_depth, wv_dir, .TRUE., wvc_om, &
+ wvc_k, wvc_amp, wvc_ph, eta_w, uw, aw, es, em2, &
+ inputs_validated=.TRUE., exp_m2kd=wvc_e2kd)
+ ELSE
+ zsurf = eta_w
+ CALL CD_Airy_Wave_Kinematics_Precomputed(rpos(1), rpos(2), zsurf, wv_t, wv_h, wv_om, wv_k, wv_depth, &
+ wv_dir, .TRUE., eta_w, uw, aw, es, em2)
+ END IF
+ IF (es /= CD_HYDRO_OK) THEN
+ ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_Drag_Element: '//TRIM(em2); RETURN
+ END IF
+ END IF
ELSE
- IF (rpos(3) > waterline_z) CYCLE ! dry Gauss point: no drag, no Jacobian
+ CALL CD_HermiteCable_Immersion(waterline_z - rpos(3), diam, wf, dwf)
END IF
+ IF (.NOT. (wf > CD_ZERO)) CYCLE ! dry Gauss point: no drag, no Jacobian
speed = SQRT(rp(1)**2 + rp(2)**2 + rp(3)**2) ! |dr/dxi| = deformed arc length per unit xi
IF (speed <= 1.0e-12_wp) THEN
ErrStat = CD_HCDYN_NOCONVERGE
@@ -10922,7 +12795,18 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
! Pass the raw dr/dxi as the tangent vector: the primitive normalises it and returns Jtan =
! d f_perlen / d(dr/dxi), so d f_perlen/d qe folds in through d(dr/dxi)/d qe = dH directly.
! rho, diam, cdn and cdt were validated above, before the Gauss loop.
- IF (want_jac) THEN
+ IF (split) THEN
+ uamb = fluid
+ IF (has_wv) uamb = uamb + uw
+ IF (PRESENT(frame_v)) uamb = uamb - frame_v
+ IF (want_jac) THEN
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(urel, uamb, rp, rho, diam, cdn, cdy, cdt, CD_HCDYN_CDY_UREF, &
+ fpl, Jrel, Jtan, es, em2, cdy_lin=cdy_lin)
+ ELSE
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(urel, uamb, rp, rho, diam, cdn, cdy, cdt, CD_HCDYN_CDY_UREF, &
+ fpl, ErrStat=es, ErrMsg=em2, cdy_lin=cdy_lin)
+ END IF
+ ELSE IF (want_jac) THEN
CALL CD_Morison_Drag_Per_Length_Jac(urel, rp, rho, diam, cdn, cdt, fpl, Jrel, Jtan, es, em2, &
scalars_validated=.TRUE.)
ELSE
@@ -10934,7 +12818,10 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
IF (es /= CD_HYDRO_OK) THEN
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_Drag_Element: '//TRIM(em2); RETURN
END IF
- scale = gw(g)*speed ! ds = |dr/dxi| dxi (deformed cable length)
+ ! ds = |dr/dxi| dxi (deformed cable length), times the immersed fraction of the section
+ ! (exactly 1 at a fully submerged point, so its products are unchanged)
+ gww = gw(g)*wf
+ scale = gww*speed
DO s = 1, 4
DO c = 1, 3
a = 3*(s - 1) + c
@@ -10959,9 +12846,17 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
b = 3*(sp - 1) + cp
! velocity: d urel/d ve(b) = -H(sp), scaled by the deformed length measure
djv(a, b) = djv(a, b) - scale*H(s)*H(sp)*Jrel(c, cp)
- djq(a, b) = djq(a, b) + gw(g)*H(s)*dH(sp)*jq3(c, cp)
+ djq(a, b) = djq(a, b) + gww*H(s)*dH(sp)*jq3(c, cp)
END DO
END DO
+ ! the immersed fraction moves with the height of the point (in the surface band only):
+ ! d wf/d qe(b) = dwf H(sp) for the vertical DOFs, dwf = d wf/d z
+ IF (.NOT. (ABS(dwf) <= CD_ZERO)) THEN
+ DO sp = 1, 4
+ b = 3*sp
+ djq(a, b) = djq(a, b) + gw(g)*speed*H(s)*fpl(c)*dwf*H(sp)
+ END DO
+ END IF
END DO
END DO
END DO
@@ -10978,21 +12873,28 @@ SUBROUTINE CD_HermiteCable_Drag_Element(qe, ve, l0, fluid, waterline_z, rho, dia
END SUBROUTINE CD_HermiteCable_Drag_Element
SUBROUTINE CD_HermiteCable_VIV_Lift_Element(qe, ve, l0, fluid, waterline_z, k_node, flift, djq, djv, &
- ErrStat, ErrMsg)
+ ErrStat, ErrMsg, kx_node, diam)
!! Consistent Gauss-integrated cross-flow VIV lift on one cubic-Hermite element: the load
!! integral N^T f ds of the per-length lift f = k(xi) U (t x v_r) (CD_VIV_Lift_Per_Length),
!! with k = 1/2 rho D Cl cos(phi) interpolated linearly between the element's end nodes
!! (k_node), and its force Jacobians djq = d flift/d qe, djv = d flift/d ve (both or neither).
!! The interpolation, measure and wet/dry culling are the drag element's (still waterline).
+ !! kx_node (optional) adds the in-line shedding force k_x U v_n (CD_VIV_Inline_Per_Length),
+ !! k_x = 1/2 rho D C_vx cos(phi_x) interpolated the same way.
REAL(wp), INTENT(IN) :: qe(12), ve(12), l0, fluid(3), waterline_z, k_node(2)
REAL(wp), INTENT(OUT) :: flift(12)
REAL(wp), INTENT(OUT), OPTIONAL :: djq(12, 12), djv(12, 12)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ REAL(wp), INTENT(IN), OPTIONAL :: kx_node(2)
+ !! diam (optional): the section diameter; with it a Gauss point carries the immersed fraction of
+ !! its section (CD_HermiteCable_Immersion) across the free surface, without it a point above
+ !! waterline_z carries no load
+ REAL(wp), INTENT(IN), OPTIONAL :: diam
INTEGER, PARAMETER :: NGP = 3
REAL(wp), PARAMETER :: G3 = 0.7745966692414834_wp ! sqrt(3/5)
REAL(wp) :: gp(NGP), gw(NGP), H(4), dH(4), rpos(3), vvel(3), rp(3), speed, tangent(3), fpl(3)
- REAL(wp) :: jrel(3, 3), jtan(3, 3), scale, kg
+ REAL(wp) :: jrel(3, 3), jtan(3, 3), scale, kg, fx(3), jrx(3, 3), jtx(3, 3), wf, dwf, gww
LOGICAL :: want_jac, ok
INTEGER :: g, s, c, sp, cp, a, b
@@ -11011,7 +12913,13 @@ SUBROUTINE CD_HermiteCable_VIV_Lift_Element(qe, ve, l0, fluid, waterline_z, k_no
vvel(c) = H(1)*ve(c) + H(2)*ve(3 + c) + H(3)*ve(6 + c) + H(4)*ve(9 + c)
rp(c) = dH(1)*qe(c) + dH(2)*qe(3 + c) + dH(3)*qe(6 + c) + dH(4)*qe(9 + c)
END DO
- IF (rpos(3) > waterline_z) CYCLE ! dry Gauss point: no lift
+ IF (PRESENT(diam)) THEN
+ CALL CD_HermiteCable_Immersion(waterline_z - rpos(3), diam, wf, dwf)
+ ELSE
+ wf = MERGE(CD_ZERO, CD_ONE, rpos(3) > waterline_z)
+ dwf = CD_ZERO
+ END IF
+ IF (.NOT. (wf > CD_ZERO)) CYCLE ! dry Gauss point: no lift
kg = (CD_ONE - gp(g))*k_node(1) + gp(g)*k_node(2)
IF (want_jac) THEN
CALL CD_VIV_Lift_Per_Length(fluid - vvel, rp, kg, fpl, ok, jrel, jtan)
@@ -11022,9 +12930,21 @@ SUBROUTINE CD_HermiteCable_VIV_Lift_Element(qe, ve, l0, fluid, waterline_z, k_no
ErrStat = CD_HCDYN_NOCONVERGE
ErrMsg = 'CD_HermiteCable_VIV_Lift_Element: degenerate centreline (|dr/dxi| ~ 0)'; RETURN
END IF
+ IF (PRESENT(kx_node)) THEN
+ kg = (CD_ONE - gp(g))*kx_node(1) + gp(g)*kx_node(2)
+ IF (want_jac) THEN
+ CALL CD_VIV_Inline_Per_Length(fluid - vvel, rp, kg, fx, ok, jrx, jtx)
+ jrel = jrel + jrx
+ jtan = jtan + jtx
+ ELSE
+ CALL CD_VIV_Inline_Per_Length(fluid - vvel, rp, kg, fx, ok)
+ END IF
+ fpl = fpl + fx
+ END IF
speed = SQRT(rp(1)**2 + rp(2)**2 + rp(3)**2)
tangent = rp/speed
- scale = gw(g)*speed
+ gww = gw(g)*wf
+ scale = gww*speed
DO s = 1, 4
DO c = 1, 3
a = 3*(s - 1) + c
@@ -11039,9 +12959,15 @@ SUBROUTINE CD_HermiteCable_VIV_Lift_Element(qe, ve, l0, fluid, waterline_z, k_no
DO cp = 1, 3
b = 3*(sp - 1) + cp
djv(a, b) = djv(a, b) - scale*H(s)*H(sp)*jrel(c, cp)
- djq(a, b) = djq(a, b) + gw(g)*H(s)*dH(sp)*(speed*jtan(c, cp) + fpl(c)*tangent(cp))
+ djq(a, b) = djq(a, b) + gww*H(s)*dH(sp)*(speed*jtan(c, cp) + fpl(c)*tangent(cp))
END DO
END DO
+ IF (.NOT. (ABS(dwf) <= CD_ZERO)) THEN ! the immersed fraction moves with the height of the point
+ DO sp = 1, 4
+ b = 3*sp
+ djq(a, b) = djq(a, b) + gw(g)*speed*H(s)*fpl(c)*dwf*H(sp)
+ END DO
+ END IF
END DO
END DO
END DO
@@ -11067,7 +12993,7 @@ SUBROUTINE CD_HermiteCable_AddedMass_Element(qe, l0, waterline_z, rho, diam, can
INTEGER, PARAMETER :: NGP = 4
REAL(wp), PARAMETER :: PI_L = 3.14159265358979323846_wp
REAL(wp) :: gp(NGP), gw(NGP), H(4), dH(4)
- REAL(wp) :: rpos(3), rp(3), speed, tangent(3), ma3(3, 3), area, scale
+ REAL(wp) :: rpos(3), rp(3), speed, tangent(3), ma3(3, 3), area, scale, wf, dwf
INTEGER :: g, s, c, sp, cp, a, b
ErrStat = CD_HCDYN_OK; ErrMsg = ''
@@ -11095,7 +13021,8 @@ SUBROUTINE CD_HermiteCable_AddedMass_Element(qe, l0, waterline_z, rho, diam, can
rpos(c) = H(1)*qe(c) + H(2)*qe(3 + c) + H(3)*qe(6 + c) + H(4)*qe(9 + c)
rp(c) = dH(1)*qe(c) + dH(2)*qe(3 + c) + dH(3)*qe(6 + c) + dH(4)*qe(9 + c)
END DO
- IF (rpos(3) > waterline_z) CYCLE ! dry Gauss point: no added mass
+ CALL CD_HermiteCable_Immersion(waterline_z - rpos(3), diam, wf, dwf)
+ IF (.NOT. (wf > CD_ZERO)) CYCLE ! dry Gauss point: no added mass
speed = SQRT(rp(1)**2 + rp(2)**2 + rp(3)**2)
IF (speed <= 1.0e-12_wp) THEN
ErrStat = CD_HCDYN_NOCONVERGE
@@ -11109,7 +13036,8 @@ SUBROUTINE CD_HermiteCable_AddedMass_Element(qe, l0, waterline_z, rho, diam, can
END DO
ma3(cp, cp) = ma3(cp, cp) + rho*area*can
END DO
- scale = gw(g)*speed ! ds = |dr/dxi| dxi (deformed cable length)
+ ! ds = |dr/dxi| dxi (deformed cable length), times the immersed fraction of the section
+ scale = (gw(g)*wf)*speed
DO s = 1, 4
DO c = 1, 3
a = 3*(s - 1) + c
@@ -11172,8 +13100,8 @@ SUBROUTINE CD_HermiteCable_FK_Element(qe, l0, waterline_z, rho, diam, can, cat,
REAL(wp), PARAMETER :: G3 = 0.7745966692414834_wp ! sqrt(3/5)
REAL(wp), PARAMETER :: PI_L = 3.14159265358979323846_wp
REAL(wp) :: gp(NGP), gw(NGP), H(4), dH(4)
- REAL(wp) :: rpos(3), rp(3), speed, tangent(3), eta_w, uw(3), aw(3), area, alpha
- REAL(wp) :: fpl(3), Jtan(3, 3), proj(3, 3), projk(3), dalpha, jq3(3, 3)
+ REAL(wp) :: rpos(3), rp(3), speed, tangent(3), eta_w, uw(3), aw(3), area, alpha, zsurf
+ REAL(wp) :: fpl(3), Jtan(3, 3), proj(3, 3), projk(3), dalpha, jq3(3, 3), wf, dwf
LOGICAL :: has_trio, has_cmp, has_held, want_jac
INTEGER :: g, s, c, sp, cp, a, b, k, es
! the message of a per-Gauss-point CableDyn_Hydro kinematics call (at most 154 characters): a
@@ -11284,7 +13212,25 @@ SUBROUTINE CD_HermiteCable_FK_Element(qe, l0, waterline_z, rho, diam, can, cat,
IF (es /= CD_HYDRO_OK) THEN
ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_FK_Element: '//TRIM(em2); RETURN
END IF
- IF (rpos(3) - waterline_z > eta_w) CYCLE ! above the instantaneous surface: dry
+ CALL CD_HermiteCable_Immersion(waterline_z + eta_w - rpos(3), diam, wf, dwf)
+ IF (.NOT. (wf > CD_ZERO)) CYCLE ! above the instantaneous surface: dry
+ IF (.NOT. has_held .AND. rpos(3) - waterline_z > eta_w) THEN
+ ! a centre above the surface inside the band: its immersed part takes the field at the
+ ! surface (the Wheeler kinematics vanish above it), so the load stays continuous
+ IF (has_cmp) THEN
+ zsurf = eta_w
+ CALL CD_Component_Wave_Kinematics(rpos(1), rpos(2), zsurf, wv_t, wv_depth, wv_dir, .TRUE., wvc_om, &
+ wvc_k, wvc_amp, wvc_ph, eta_w, uw, aw, es, em2, inputs_validated=.TRUE., &
+ exp_m2kd=wvc_e2kd)
+ ELSE
+ zsurf = eta_w
+ CALL CD_Airy_Wave_Kinematics_Precomputed(rpos(1), rpos(2), zsurf, wv_t, wv_h, wv_om, wv_k, wv_depth, &
+ wv_dir, .TRUE., eta_w, uw, aw, es, em2)
+ END IF
+ IF (es /= CD_HYDRO_OK) THEN
+ ErrStat = CD_HCDYN_NOCONVERGE; ErrMsg = 'CD_HermiteCable_FK_Element: '//TRIM(em2); RETURN
+ END IF
+ END IF
speed = SQRT(rp(1)**2 + rp(2)**2 + rp(3)**2)
IF (speed <= 1.0e-12_wp) THEN
ErrStat = CD_HCDYN_NOCONVERGE
@@ -11312,7 +13258,7 @@ SUBROUTINE CD_HermiteCable_FK_Element(qe, l0, waterline_z, rho, diam, can, cat,
DO s = 1, 4
DO c = 1, 3
a = 3*(s - 1) + c
- ffk(a) = ffk(a) + gw(g)*speed*H(s)*fpl(c)
+ ffk(a) = ffk(a) + (gw(g)*wf)*speed*H(s)*fpl(c)
END DO
END DO
IF (.NOT. want_jac) CYCLE
@@ -11329,9 +13275,15 @@ SUBROUTINE CD_HermiteCable_FK_Element(qe, l0, waterline_z, rho, diam, can, cat,
DO sp = 1, 4
DO cp = 1, 3
b = 3*(sp - 1) + cp
- fjq(a, b) = fjq(a, b) + gw(g)*H(s)*dH(sp)*jq3(c, cp)
+ fjq(a, b) = fjq(a, b) + (gw(g)*wf)*H(s)*dH(sp)*jq3(c, cp)
END DO
END DO
+ IF (.NOT. (ABS(dwf) <= CD_ZERO)) THEN ! the immersed fraction moves with the height of the point
+ DO sp = 1, 4
+ b = 3*sp
+ fjq(a, b) = fjq(a, b) + gw(g)*speed*H(s)*fpl(c)*dwf*H(sp)
+ END DO
+ END IF
END DO
END DO
END DO
diff --git a/src/CableDyn_HermiteCableStatic.f90 b/src/CableDyn_HermiteCableStatic.f90
index 6451254e..778a84c1 100644
--- a/src/CableDyn_HermiteCableStatic.f90
+++ b/src/CableDyn_HermiteCableStatic.f90
@@ -47,7 +47,7 @@ MODULE CableDyn_HermiteCableStatic
USE CableDyn_Bathymetry, ONLY: CD_BathymetryType, CD_Bathymetry_Is_Initialized, &
CD_Bathymetry_Floor, CD_Bathymetry_Floor_Gradient, CD_BATHY_OK, &
CD_Bathymetry_Rotate_Curvature
- USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCable_Drag_Element, CD_HCDYN_OK
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCable_Drag_Element, CD_HCDYN_OK, CD_HermiteCable_Point_Immersion
USE CableDyn_Static, ONLY: CD_Static_As_Laid_Reference, CD_STATIC_OK
USE CableDyn_Hydro, ONLY: CD_Current_Profile_Velocity, CD_CurrentGridType, CD_Current_Grid_Velocity, &
CD_Current_Profile_Gradient, CD_Current_Grid_Gradient, CD_HYDRO_OK
@@ -309,7 +309,8 @@ SUBROUTINE CD_HermiteCable_Static_Solve(l0, EA, EI, w, seed, fixed_dofs, seabed_
waterline_z, dry_buoyancy, merit_line_search, pseudo_transient, &
energy_minimization, stable, water_weight, current, residual_out, &
tangent_out, friction, residual_unmet, torsion, energy_out, &
- end_share_hold, f_nodal_twist, stall_limit)
+ end_share_hold, f_nodal_twist, stall_limit, att_node, att_buoyancy, &
+ att_radius)
!! Solve the finite-EI static equilibrium of a Hermite bending-cable line.
!!
!! l0(ne), EA(ne), EI(ne), w(ne) : per-element rest length, axial/bending stiffness,
@@ -460,6 +461,18 @@ SUBROUTINE CD_HermiteCable_Static_Solve(l0, EA, EI, w, seed, fixed_dofs, seabed_
!! fixed count; the norm, unlike the largest component
!! that decides convergence, does not change when the
!! line is turned.
+ !! att_node, att_buoyancy, att_radius (optional, together, one entry per attachment):
+ !! point attachments whose buoyancy rho g V [N]
+ !! (att_buoyancy) at node att_node f_nodal carries in full
+ !! (their net weight (m - rho V) g). The buoyancy they
+ !! lose at the free surface (waterline_z, 0 without it),
+ !! rho g V (1 - wf(z)) downward, is added at the node
+ !! height of each iterate with its stiffness and
+ !! potential, wf the immersed fraction of the sphere of
+ !! radius att_radius (CD_HermiteCable_Point_Immersion),
+ !! ramped with the load-continuation factor as f_nodal. A
+ !! buoy floating at the surface then has an equilibrium;
+ !! a node deeper than its radius adds nothing.
REAL(wp), INTENT(IN) :: l0(:), EA(:), EI(:), w(:), seed(:)
INTEGER, INTENT(IN) :: fixed_dofs(:)
REAL(wp), INTENT(IN) :: seabed_z, kn, tol, damping
@@ -499,6 +512,8 @@ SUBROUTINE CD_HermiteCable_Static_Solve(l0, EA, EI, w, seed, fixed_dofs, seabed_
TYPE(CD_HermiteTorsionType), INTENT(INOUT), OPTIONAL :: torsion
REAL(wp), INTENT(IN), OPTIONAL :: f_nodal_twist(:)
INTEGER, INTENT(IN), OPTIONAL :: stall_limit
+ INTEGER, INTENT(IN), OPTIONAL :: att_node(:)
+ REAL(wp), INTENT(IN), OPTIONAL :: att_buoyancy(:), att_radius(:)
INTEGER :: ne, nn, ndof, c, it, es, i, b, nci, n_buoy, omp_threads, axial_order, bending_order
! stall_limit: the residual merit at the start of an update, its value at the last halving
@@ -680,6 +695,23 @@ SUBROUTINE CD_HermiteCable_Static_Solve(l0, EA, EI, w, seed, fixed_dofs, seabed_
CALL fail('contact_kn must be finite, positive, and have length n_nodes'); RETURN
END IF
END IF
+ IF (PRESENT(att_node) .OR. PRESENT(att_buoyancy) .OR. PRESENT(att_radius)) THEN
+ IF (.NOT. (PRESENT(att_node) .AND. PRESENT(att_buoyancy) .AND. PRESENT(att_radius))) THEN
+ CALL fail('att_node, att_buoyancy and att_radius must be supplied together'); RETURN
+ END IF
+ IF (SIZE(att_buoyancy) /= SIZE(att_node) .OR. SIZE(att_radius) /= SIZE(att_node)) THEN
+ CALL fail('att_node, att_buoyancy and att_radius must share one length'); RETURN
+ END IF
+ IF (ANY(att_node < 1) .OR. ANY(att_node > nn)) THEN
+ CALL fail('att_node out of range'); RETURN
+ END IF
+ IF (.NOT. (CD_All_Finite(att_buoyancy) .AND. CD_All_Finite(att_radius))) THEN
+ CALL fail('att_buoyancy and att_radius must be finite'); RETURN
+ END IF
+ IF (ANY(att_buoyancy < CD_ZERO) .OR. ANY(att_radius < CD_ZERO)) THEN
+ CALL fail('att_buoyancy and att_radius must be >= 0'); RETURN
+ END IF
+ END IF
IF (use_bathymetry) THEN
IF (.NOT. CD_Bathymetry_Is_Initialized(bathymetry)) THEN
CALL fail('bathymetry must be initialized'); RETURN
@@ -1209,6 +1241,8 @@ RECURSIVE SUBROUTINE newton_step(rnorm, es, em, do_update)
LOGICAL, INTENT(IN) :: do_update
REAL(wp) :: qe(12)
REAL(wp) :: pen, dqnorm, z_floor, gxg, gyg, gx, gy, xg, yg, normal, normal_gap, kn_eff
+ ! an attachment's surface waterline, immersed fraction, its height derivative and potential
+ REAL(wp) :: z_wl_att, wf_att, dwf_att, psi_att
REAL(wp) :: curv_g(3), curv_l(3)
REAL(wp) :: step_scale, trial_norm, row_scale, column_scale, merit, trial_merit, merit_base, diag_floor
REAL(wp) :: gradient_component, column_norm2, fdry(4), kdry(4, 4), e_term
@@ -1351,6 +1385,25 @@ RECURSIVE SUBROUTINE newton_step(rnorm, es, em, do_update)
END IF
END IF
+ ! ---- buoyancy the point attachments lose at the free surface ----
+ ! downward rho g V (1 - wf(z)) on top of f_nodal's net weight, with its stiffness
+ ! -rho g V dwf/dz >= 0 and potential rho g V (z - psi(z) - z_w), zero below the band
+ IF (PRESENT(att_node)) THEN
+ DO a = 1, SIZE(att_node)
+ IF (.NOT. (att_buoyancy(a) > CD_ZERO)) CYCLE
+ gi = 6*(att_node(a) - 1) + 3
+ z_wl_att = CD_ZERO
+ IF (PRESENT(waterline_z)) z_wl_att = waterline_z
+ CALL CD_HermiteCable_Point_Immersion(z_wl_att - q(gi), att_radius(a), wf_att, dwf_att, psi_att)
+ IF (.NOT. (wf_att < CD_ONE)) CYCLE
+ R(gi) = R(gi) + eifac*att_buoyancy(a)*(CD_ONE - wf_att)
+ ab(KL_H + KU_H + 1, gi) = ab(KL_H + KU_H + 1, gi) - eifac*att_buoyancy(a)*dwf_att
+ e_term = eifac*att_buoyancy(a)*(q(gi) - psi_att - z_wl_att)
+ pi_total = pi_total + e_term
+ pi_abs = pi_abs + ABS(e_term)
+ END DO
+ END IF
+
! ---- optional rotational line-end connections ----
! Ramped with the same factor as EI: a stiff connection introduced at full strength
! against a cold seed would fight the bending continuation it is meant to ride along.
diff --git a/src/CableDyn_HermiteTorsion.f90 b/src/CableDyn_HermiteTorsion.f90
index 752b5586..8929f748 100644
--- a/src/CableDyn_HermiteTorsion.f90
+++ b/src/CableDyn_HermiteTorsion.f90
@@ -1396,7 +1396,7 @@ PURE SUBROUTINE CD_HermiteTwist_Reference(qe, L, tri, tslot, tsign, value, grad,
LOGICAL, INTENT(IN), OPTIONAL :: holonomy
INTEGER, INTENT(IN), OPTIONAL :: quadrature_order
INTEGER :: order, k, j, i, ntri, si, sj
- LOGICAL :: want_hess, with_h, need(2), finite
+ LOGICAL :: want_hess, with_h, need(2), finite, free(3)
REAL(wp) :: node_t(3, 2), proj(3, 3, 2), x(3, 3), om, g9(9), h9(9, 9), gt(3, 2), htt(3, 3, 2, 2)
REAL(wp) :: he, ge(12), hk(12, 12), dmy, blk(3, 3), blk2(3, 3)
CHARACTER(200) :: em
@@ -1433,13 +1433,8 @@ PURE SUBROUTINE CD_HermiteTwist_Reference(qe, L, tri, tslot, tsign, value, grad,
END IF
need(1) = ANY(tslot == 1) .OR. with_h
need(2) = ANY(tslot == 2) .OR. with_h
- ! (column by column: a reshaped copy of the assumed-shape tri would be a heap temporary)
- finite = CD_All_Finite(qe) .AND. CD_Is_Finite(L) .AND. CD_All_Finite(tsign)
- DO k = 1, ntri
- DO j = 1, 3
- finite = finite .AND. CD_All_Finite(tri(:, j, k))
- END DO
- END DO
+ ! (the rank-3 test reads tri in place: a reshaped copy would be a heap temporary)
+ finite = CD_All_Finite(qe) .AND. CD_Is_Finite(L) .AND. CD_All_Finite(tsign) .AND. CD_All_Finite(tri)
IF (.NOT. finite) THEN
ErrStat = CD_HTORS_NONFINITE
ErrMsg = 'CD_HermiteTwist_Reference: non-finite input'
@@ -1488,7 +1483,11 @@ PURE SUBROUTINE CD_HermiteTwist_Reference(qe, L, tri, tslot, tsign, value, grad,
RETURN
END IF
END DO
- CALL solid_angle(x(:, 1), x(:, 2), x(:, 3), want_hess, om, g9, h9)
+ ! (a local mask: the expression tslot(:, k) /= 0 as the argument is a heap temporary)
+ DO j = 1, 3
+ free(j) = tslot(j, k) /= 0
+ END DO
+ CALL solid_angle(x(:, 1), x(:, 2), x(:, 3), want_hess, om, g9, h9, free=free)
value = value + tsign(k)*om
DO j = 1, 3
si = tslot(j, k)
@@ -1544,11 +1543,7 @@ PURE SUBROUTINE CD_HermiteTwist_Reference(qe, L, tri, tslot, tsign, value, grad,
RETURN
END IF
IF (want_hess) THEN
- finite = .TRUE.
- DO j = 1, 12
- finite = finite .AND. CD_All_Finite(hess(:, j))
- END DO
- IF (.NOT. finite) THEN
+ IF (.NOT. CD_All_Finite(hess)) THEN
ErrStat = CD_HTORS_NONFINITE
ErrMsg = 'CD_HermiteTwist_Reference: non-finite twist Hessian'
value = CD_ZERO
@@ -1727,8 +1722,14 @@ PURE SUBROUTINE element_holonomy(qe, L, order, want_hess, h, grad, hess, margin,
margin = HUGE(CD_ONE)
CALL CD_HermiteCable_Gauss_Rule(order, gp, gw)
DO ig = 1, order
+ ! (element_ab, on the shape derivatives at hand)
CALL shape_derivatives(L, gp(ig), dh, ddh)
- CALL element_ab(qe, L, gp(ig), a, b)
+ a = CD_ZERO
+ b = CD_ZERO
+ DO i = 1, 4
+ a = a + dh(i)*qe(3*i - 2:3*i)
+ b = b + ddh(i)*qe(3*i - 2:3*i)
+ END DO
s2 = DOT_PRODUCT(a, a)
sp = SQRT(s2)
IF (sp <= GEOM_TOL) THEN
@@ -1771,7 +1772,12 @@ PURE SUBROUTINE element_holonomy(qe, L, order, want_hess, h, grad, hess, margin,
hd(1:3, 1:3) = 2.0_wp*eye + ta*(eye/sp - outer(a, a)/(sp*s2)) + (outer(a, t) + outer(t, a))/sp
hd(1:3, 7:9) = outer(a, a)/sp + sp*eye
hd(7:9, 1:3) = TRANSPOSE(hd(1:3, 7:9))
- hf = (hn - f*hd - outer9(gf, gd) - outer9(gd, gf))/den
+ ! (the blocks read below: rows 7:9 only against columns 7:9)
+ DO j = 1, 9
+ DO i = 1, MERGE(9, 6, j > 6)
+ hf(i, j) = (hn(i, j) - f*hd(i, j) - gf(i)*gd(j) - gd(i)*gf(j))/den
+ END DO
+ END DO
DO j = 1, 4
DO i = 1, 4
blk = dh(i)*dh(j)*hf(1:3, 1:3) + dh(i)*ddh(j)*hf(1:3, 4:6) + ddh(i)*dh(j)*hf(4:6, 1:3) &
@@ -1871,14 +1877,18 @@ PURE FUNCTION smallest_rotation(a, b, v) RESULT(r)
r = c*v + cross(w, v) + w*DOT_PRODUCT(w, v)/(CD_ONE + c)
END FUNCTION smallest_rotation
- PURE SUBROUTINE solid_angle(x, y, z, want_hess, om, g, h)
+ PURE SUBROUTINE solid_angle(x, y, z, want_hess, om, g, h, free)
!! Omega = 2 atan2(N, D), N = x.(y x z), D = 1 + x.y + y.z + z.x (signed solid angle of the
!! geodesic triangle x, y, z), with gradient g and Hessian h in the raw vectors (x, y, z).
- !! Under the fold guard every triangle used here has D >= 1.5.
+ !! Under the fold guard every triangle used here has D >= 1.5. With free, only the Hessian
+ !! blocks between two free vertices (free(j): vertex j is a variable of the caller) are
+ !! formed, each entry as the full Hessian forms it; the others are zero.
REAL(wp), INTENT(IN) :: x(3), y(3), z(3)
LOGICAL, INTENT(IN) :: want_hess
REAL(wp), INTENT(OUT) :: om, g(9), h(9, 9)
- REAL(wp) :: nv, dv, r2, gn(9), gd(9), eye(3, 3)
+ LOGICAL, INTENT(IN), OPTIONAL :: free(3)
+ REAL(wp) :: nv, dv, r2, gn(9), gd(9), eye(3, 3), h0(3, 3), c1, c2, s(3, 3)
+ INTEGER :: bi, bj, i, j, ii, jj
nv = DOT_PRODUCT(x, cross(y, z))
dv = CD_ONE + DOT_PRODUCT(x, y) + DOT_PRODUCT(y, z) + DOT_PRODUCT(z, x)
@@ -1894,6 +1904,42 @@ PURE SUBROUTINE solid_angle(x, y, z, want_hess, om, g, h)
h = CD_ZERO
IF (.NOT. want_hess) RETURN
eye = identity3()
+ IF (PRESENT(free)) THEN
+ c1 = nv*nv - dv*dv
+ c2 = 2.0_wp*dv*nv
+ DO bj = 1, 3
+ IF (.NOT. free(bj)) CYCLE
+ DO bi = 1, 3
+ IF (.NOT. free(bi)) CYCLE
+ ! the block (bi, bj) of d2N and d2D before the scaling below
+ IF (bi == bj) THEN
+ h0 = CD_ZERO
+ ELSE
+ IF (bi + bj == 3) THEN
+ s = skew(z)
+ ELSE IF (bi + bj == 5) THEN
+ s = skew(x)
+ ELSE
+ s = skew(y)
+ END IF
+ IF (bj == MOD(bi, 3) + 1) THEN
+ h0 = -dv*s - nv*eye
+ ELSE
+ h0 = dv*s - nv*eye
+ END IF
+ END IF
+ DO j = 1, 3
+ jj = 3*(bj - 1) + j
+ DO i = 1, 3
+ ii = 3*(bi - 1) + i
+ h(ii, jj) = 2.0_wp*(h0(i, j)/r2 + (c1*(gn(ii)*gd(jj) + gd(ii)*gn(jj)) &
+ - c2*(gn(ii)*gn(jj) - gd(ii)*gd(jj)))/(r2*r2))
+ END DO
+ END DO
+ END DO
+ END DO
+ RETURN
+ END IF
! d2N: (x,y) = -S(z), (y,z) = -S(x), (z,x) = -S(y); d2D: identity off-diagonal blocks
h(1:3, 4:6) = -dv*skew(z) - nv*eye
h(4:6, 1:3) = dv*skew(z) - nv*eye
@@ -1959,28 +2005,52 @@ PURE FUNCTION cross(a, b) RESULT(c)
c = [a(2)*b(3) - a(3)*b(2), a(3)*b(1) - a(1)*b(3), a(1)*b(2) - a(2)*b(1)]
END FUNCTION cross
+ ! (element by element: the RESHAPE and SPREAD forms of these are run-time library calls on the
+ ! torsion kernels' hot path; the entries are the same products)
+
PURE FUNCTION skew(v) RESULT(s)
!! S(v) w = v x w.
REAL(wp), INTENT(IN) :: v(3)
REAL(wp) :: s(3, 3)
- s = RESHAPE([CD_ZERO, v(3), -v(2), -v(3), CD_ZERO, v(1), v(2), -v(1), CD_ZERO], [3, 3])
+ s(1, 1) = CD_ZERO
+ s(2, 1) = v(3)
+ s(3, 1) = -v(2)
+ s(1, 2) = -v(3)
+ s(2, 2) = CD_ZERO
+ s(3, 2) = v(1)
+ s(1, 3) = v(2)
+ s(2, 3) = -v(1)
+ s(3, 3) = CD_ZERO
END FUNCTION skew
PURE FUNCTION outer(a, b) RESULT(m)
REAL(wp), INTENT(IN) :: a(3), b(3)
REAL(wp) :: m(3, 3)
- m = SPREAD(a, 2, 3)*SPREAD(b, 1, 3)
+ INTEGER :: i, j
+ DO j = 1, 3
+ DO i = 1, 3
+ m(i, j) = a(i)*b(j)
+ END DO
+ END DO
END FUNCTION outer
PURE FUNCTION outer9(a, b) RESULT(m)
REAL(wp), INTENT(IN) :: a(9), b(9)
REAL(wp) :: m(9, 9)
- m = SPREAD(a, 2, 9)*SPREAD(b, 1, 9)
+ INTEGER :: i, j
+ DO j = 1, 9
+ DO i = 1, 9
+ m(i, j) = a(i)*b(j)
+ END DO
+ END DO
END FUNCTION outer9
PURE FUNCTION identity3() RESULT(m)
REAL(wp) :: m(3, 3)
- m = RESHAPE([CD_ONE, CD_ZERO, CD_ZERO, CD_ZERO, CD_ONE, CD_ZERO, CD_ZERO, CD_ZERO, CD_ONE], [3, 3])
+ m = CD_ZERO
+ m(1, 1) = CD_ONE
+ m(2, 2) = CD_ONE
+ m(3, 3) = CD_ONE
END FUNCTION identity3
END MODULE CableDyn_HermiteTorsion
diff --git a/src/CableDyn_Hydro.f90 b/src/CableDyn_Hydro.f90
index 45514fc9..6d6f238f 100644
--- a/src/CableDyn_Hydro.f90
+++ b/src/CableDyn_Hydro.f90
@@ -23,6 +23,7 @@ MODULE CableDyn_Hydro
PUBLIC :: CD_Split_Normal_Tangential
PUBLIC :: CD_Morison_Drag_Per_Length
PUBLIC :: CD_Morison_Drag_Per_Length_Jac
+ PUBLIC :: CD_Morison_Drag_Split_Per_Length_Jac
PUBLIC :: CD_Morison_Added_Mass_Per_Length
PUBLIC :: CD_Froude_Krylov_Per_Length
PUBLIC :: CD_Solve_Dispersion_Wavenumber
@@ -1459,6 +1460,167 @@ SUBROUTINE CD_Morison_Drag_Per_Length_Jac(rel_velocity, tangent, rho, diameter,
END IF
END SUBROUTINE CD_Morison_Drag_Per_Length_Jac
+ SUBROUTINE CD_Morison_Drag_Split_Per_Length_Jac(rel_velocity, ambient, tangent, rho, diameter, cdn, cdy, cdt, &
+ u_ref, force, jac_rel, jac_tan, ErrStat, ErrMsg, scalars_validated, &
+ cdy_lin)
+ !! Drag per unit length [N/m] with the cross-flow part of Thorsen, Saevik and Larsen (J. Fluids
+ !! Struct. 61, 2016, Eq. 1): in the frame of the AMBIENT normal flow u_n = P u (P = I - t t^T),
+ !! e_x = u_n/|u_n| in line and e_y = t x e_x across, the relative normal velocity w = P rel splits
+ !! into w_x = w . e_x and w_y = w . e_y, and the normal drag
+ !!
+ !! f_s = 1/2 rho D [cdn |w| w_x e_x + cdy |w_y| w_y e_y]
+ !!
+ !! keeps Morison's in-line part and replaces its cross-flow part by the quadratic cross-flow
+ !! damping cdy |w_y| w_y (w_y = -y', the node's cross-flow velocity reversed). Where the ambient
+ !! normal flow vanishes the axes are undefined, so the normal drag blends to Morison's,
+ !! f_n = beta f_s + (1 - beta) f_M, f_M = 1/2 rho D cdn |w| w, beta = U^2/(U^2 + u_ref^2) with
+ !! U = |u_n|; below U = 1e-9 u_ref (beta < 1e-18) the result is CD_Morison_Drag_Per_Length_Jac's
+ !! own, bit for bit. The tangential drag is CD_Morison_Drag_Per_Length_Jac's. ambient is the
+ !! undisturbed fluid velocity at the point (rel_velocity = ambient - structure velocity). Jacobians as in
+ !! CD_Morison_Drag_Per_Length_Jac: jac_rel = d force/d rel_velocity at fixed ambient, jac_tan =
+ !! d force/d tangent (the input vector, normalised inside), both exact; OPTIONAL as a pair, the
+ !! force identical with or without them. cdy >= 0 and u_ref > 0 are checked with the scalars.
+ !! cdy_lin (optional, >= 0, default 0) adds a Morison-form cross-flow term 1/2 rho D cdy_lin |w| w_y
+ !! e_y: with cdy = 0 and cdy_lin the unamplified Morison coefficient, a drag amplification passed
+ !! in cdn acts on the in-line drag alone while the cross-flow drag stays Morison's.
+ REAL(wp), INTENT(IN) :: rel_velocity(3), ambient(3), tangent(3), rho, diameter, cdn, cdy, cdt, u_ref
+ REAL(wp), INTENT(OUT) :: force(3)
+ REAL(wp), INTENT(OUT), OPTIONAL :: jac_rel(3, 3), jac_tan(3, 3)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ LOGICAL, INTENT(IN), OPTIONAL :: scalars_validated
+ REAL(wp), INTENT(IN), OPTIONAL :: cdy_lin
+ REAL(wp) :: tnorm, tu(3), pm(3, 3), w(3), wm, un(3), ua, ex(3), ey(3), wx, wy, fm(3), fs(3), beta, cn, cy, cl
+ REAL(wp) :: dfm(3, 3), dfs(3, 3), dt(3), dw(3), dun(3), dua, dex(3), dey(3), dwx, dwy, dwm, dfmv(3), dfsv(3)
+ REAL(wp) :: dbeta, ft(3), jrt(3, 3), jtt(3, 3)
+ INTEGER :: k
+ LOGICAL :: want_jac, check_scalars, split
+
+ want_jac = PRESENT(jac_rel)
+ force = CD_ZERO
+ IF (want_jac .NEQV. PRESENT(jac_tan)) THEN
+ CALL fail(ErrStat, ErrMsg, 'jac_rel and jac_tan must be supplied together (or neither)')
+ RETURN
+ END IF
+ IF (want_jac) THEN
+ jac_rel = CD_ZERO; jac_tan = CD_ZERO
+ END IF
+ ErrStat = CD_HYDRO_OK; ErrMsg = ''
+ check_scalars = .TRUE.
+ IF (PRESENT(scalars_validated)) check_scalars = .NOT. scalars_validated
+ IF (check_scalars) THEN
+ IF (.NOT. (CD_Is_Finite(cdy) .AND. cdy >= CD_ZERO .AND. CD_Is_Finite(u_ref) .AND. u_ref > CD_ZERO .AND. &
+ CD_Is_Finite(cdn) .AND. cdn >= CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the drag coefficients must be finite and non-negative and u_ref positive')
+ RETURN
+ END IF
+ END IF
+ IF (.NOT. CD_All_Finite(ambient)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the ambient fluid velocity must be finite')
+ RETURN
+ END IF
+ ! tangential drag (and every other input check) from the Morison primitive with cdn = 0
+ IF (want_jac) THEN
+ CALL CD_Morison_Drag_Per_Length_Jac(rel_velocity, tangent, rho, diameter, CD_ZERO, cdt, ft, jrt, jtt, &
+ ErrStat, ErrMsg, scalars_validated)
+ ELSE
+ CALL CD_Morison_Drag_Per_Length_Jac(rel_velocity, tangent, rho, diameter, CD_ZERO, cdt, ft, ErrStat=ErrStat, &
+ ErrMsg=ErrMsg, scalars_validated=scalars_validated)
+ END IF
+ IF (ErrStat /= CD_HYDRO_OK) RETURN
+ tnorm = SQRT(DOT_PRODUCT(tangent, tangent))
+ tu = tangent/tnorm
+ pm = identity3() - outer3(tu, tu)
+ cn = 0.5_wp*rho*diameter*cdn
+ cy = 0.5_wp*rho*diameter*cdy
+ cl = CD_ZERO
+ IF (PRESENT(cdy_lin)) THEN
+ IF (.NOT. (CD_Is_Finite(cdy_lin) .AND. cdy_lin >= CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the linear cross-flow drag coefficient must be finite and non-negative')
+ RETURN
+ END IF
+ cl = 0.5_wp*rho*diameter*cdy_lin
+ END IF
+ un = MATMUL(pm, ambient)
+ ua = SQRT(DOT_PRODUCT(un, un))
+ split = ua > 1.0e-9_wp*u_ref
+ IF (.NOT. split) THEN
+ ! no ambient normal flow: Morison's drag, from its own primitive (bit for bit)
+ IF (want_jac) THEN
+ CALL CD_Morison_Drag_Per_Length_Jac(rel_velocity, tangent, rho, diameter, cdn, cdt, force, jac_rel, jac_tan, &
+ ErrStat, ErrMsg, scalars_validated)
+ ELSE
+ CALL CD_Morison_Drag_Per_Length_Jac(rel_velocity, tangent, rho, diameter, cdn, cdt, force, ErrStat=ErrStat, &
+ ErrMsg=ErrMsg, scalars_validated=scalars_validated)
+ END IF
+ RETURN
+ END IF
+ w = MATMUL(pm, rel_velocity)
+ wm = SQRT(DOT_PRODUCT(w, w))
+ fm = cn*wm*w
+ beta = CD_ZERO
+ fs = fm
+ ex = CD_ZERO; ey = CD_ZERO; wx = CD_ZERO; wy = CD_ZERO
+ IF (split) THEN
+ ex = un/ua
+ ey = cross3(tu, ex)
+ wx = DOT_PRODUCT(w, ex)
+ wy = DOT_PRODUCT(w, ey)
+ fs = cn*wm*wx*ex + cy*ABS(wy)*wy*ey + cl*wm*wy*ey
+ beta = ua*ua/(ua*ua + u_ref*u_ref)
+ END IF
+ force = ft + beta*fs + (CD_ONE - beta)*fm
+ IF (want_jac) THEN
+ ! d/d rel at fixed ambient and tangent: d w/d rel = P
+ dfm = CD_ZERO
+ dfs = CD_ZERO
+ IF (wm > MIN_TANGENT_NORM) THEN
+ dfm = cn*(wm*identity3() + outer3(w, w)/wm)
+ IF (split) dfs = cn*outer3(ex, wx*w/wm + wm*ex) + cl*outer3(ey, wy*w/wm + wm*ey)
+ END IF
+ IF (split) dfs = dfs + cy*2.0_wp*ABS(wy)*outer3(ey, ey)
+ jac_rel = jrt + MATMUL(beta*dfs + (CD_ONE - beta)*dfm, pm)
+ ! d/d tangent: directional derivatives along dt = P e_k/|tangent| (the unit-tangent change of
+ ! the input vector's k-th component), through P (so w and u_n), e_x, e_y and beta
+ jac_tan = jtt
+ DO k = 1, 3
+ dt = pm(:, k)/tnorm
+ dw = -(dt*DOT_PRODUCT(tu, rel_velocity) + tu*DOT_PRODUCT(dt, rel_velocity))
+ dwm = CD_ZERO
+ IF (wm > MIN_TANGENT_NORM) dwm = DOT_PRODUCT(w, dw)/wm
+ dfmv = cn*(dwm*w + wm*dw)
+ dfsv = dfmv
+ dbeta = CD_ZERO
+ IF (split) THEN
+ dun = -(dt*DOT_PRODUCT(tu, ambient) + tu*DOT_PRODUCT(dt, ambient))
+ dua = DOT_PRODUCT(ex, dun)
+ dex = (dun - ex*dua)/ua
+ dey = cross3(dt, ex) + cross3(tu, dex)
+ dwx = DOT_PRODUCT(dw, ex) + DOT_PRODUCT(w, dex)
+ dwy = DOT_PRODUCT(dw, ey) + DOT_PRODUCT(w, dey)
+ dfsv = cn*(dwm*wx*ex + wm*dwx*ex + wm*wx*dex) + cy*(2.0_wp*ABS(wy)*dwy*ey + ABS(wy)*wy*dey) + &
+ cl*(dwm*wy*ey + wm*dwy*ey + wm*wy*dey)
+ dbeta = 2.0_wp*ua*dua*u_ref*u_ref/(ua*ua + u_ref*u_ref)**2
+ END IF
+ jac_tan(:, k) = jac_tan(:, k) + dbeta*(fs - fm) + beta*dfsv + (CD_ONE - beta)*dfmv
+ END DO
+ END IF
+ IF (.NOT. CD_All_Finite(force)) THEN
+ force = CD_ZERO
+ IF (want_jac) THEN
+ jac_rel = CD_ZERO; jac_tan = CD_ZERO
+ END IF
+ CALL fail(ErrStat, ErrMsg, 'split drag result or Jacobian overflowed')
+ RETURN
+ END IF
+ IF (want_jac) THEN
+ IF (.NOT. CD_All_Finite(jac_rel) .OR. .NOT. CD_All_Finite(jac_tan)) THEN
+ force = CD_ZERO; jac_rel = CD_ZERO; jac_tan = CD_ZERO
+ CALL fail(ErrStat, ErrMsg, 'split drag result or Jacobian overflowed')
+ END IF
+ END IF
+ END SUBROUTINE CD_Morison_Drag_Split_Per_Length_Jac
+
SUBROUTINE CD_Morison_Added_Mass_Per_Length(tangent, rho, diameter, can, cat, M_a, ErrStat, ErrMsg)
!! Morison added-mass matrix per unit length [kg/m]:
!! M_a = rho A (Can (I - qq^T) + Cat qq^T), A = pi d^2 / 4.
@@ -3453,6 +3615,12 @@ PURE FUNCTION outer3(a, b) RESULT(out)
END DO
END FUNCTION outer3
+ PURE FUNCTION cross3(a, b) RESULT(c)
+ REAL(wp), INTENT(IN) :: a(3), b(3)
+ REAL(wp) :: c(3)
+ c = [a(2)*b(3) - a(3)*b(2), a(3)*b(1) - a(1)*b(3), a(1)*b(2) - a(2)*b(1)]
+ END FUNCTION cross3
+
PURE REAL(wp) FUNCTION deterministic_phase(i) RESULT(phase)
INTEGER, INTENT(IN) :: i
REAL(wp), PARAMETER :: GOLDEN = 0.618033988749894848204586834365638118_wp
diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90
index 638ba1fc..6eea0f34 100644
--- a/src/CableDyn_Model.f90
+++ b/src/CableDyn_Model.f90
@@ -57,7 +57,12 @@ MODULE CableDyn_Model
CD_Added_Mass_Element, CD_Added_Mass_Element_Matrix, CD_Added_Mass_Element_Force, &
CD_Submerged_Fraction
USE CableDyn_VIV, ONLY: CD_VIV_Node_Lift, CD_VIV_Crossflow_Motion, CD_VIV_Phase_Rate, CD_VIV_Mean_Square, &
- CD_VIV_Wrap_Phase, CD_VIV_NM, CD_VIV_TWO_PI
+ CD_VIV_Wrap_Phase, CD_VIV_NM, CD_VIV_TWO_PI, CD_VIV_Node_Inline, CD_VIV_Inline_Phase_Rate, &
+ 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, &
CD_DYN_OK, CD_DYN_ALLOCFAIL, &
@@ -97,7 +102,10 @@ MODULE CableDyn_Model
PUBLIC :: CD_Set_Model_Syrope_State
PUBLIC :: CD_Set_Model_VIV
PUBLIC :: CD_Latch_Model_VIV_Window
- PUBLIC :: CD_Get_Model_VIV_State, CD_Set_Model_VIV_State, CD_Model_Has_VIV, CD_Get_Model_VIV_Lift
+ PUBLIC :: CD_Get_Model_VIV_State, CD_Set_Model_VIV_State, CD_Model_Has_VIV, CD_Get_Model_VIV_Lift, &
+ CD_Model_VIV_NMS, CD_Get_Model_VIV_Amplitude
+ PUBLIC :: CD_Model_Has_VIV_Inline
+ PUBLIC :: CD_Get_Model_Load_Power
PUBLIC :: CD_Get_Model_Tension
PUBLIC :: CD_Get_Model_Internal_Rates
PUBLIC :: CD_Get_Model_EndForces
@@ -153,6 +161,7 @@ MODULE CableDyn_Model
TYPE :: CD_ModelCommitSlot
REAL(wp), ALLOCATABLE :: q(:), v(:), a(:), ve_dl_1(:), syrope_slow(:), syrope_tmax(:)
REAL(wp), ALLOCATABLE :: fr_anchor(:, :), l0_c(:), l0_dot_c(:), viv_phi(:), viv_ms(:, :)
+ REAL(wp), ALLOCATABLE :: vil_phi(:), vil_ms(:, :)
END TYPE CD_ModelCommitSlot
! Diagnostics of the rotation- and snap-resolved sub-stepping (CD_Step_Model): calls counts
@@ -395,8 +404,11 @@ MODULE CableDyn_Model
! viv_tw is the averaging time of the mean squares [s]; 0 until CD_Latch_Model_VIV_Window
! (or the first step) sets MoorDyn's 500 steps. viv_phi_eval is the phase the lift
! contributor uses: the committed phase, except inside CD_Step_Model, where it is the
- ! explicit generalised-alpha force-level phase. viv_rate (phase rate at the step start)
- ! and viv_ms_next (mean squares updated with the step-start sample) are step scratch.
+ ! explicit generalised-alpha force-level phase. Row viv_pred_row of viv_ms (after the motion
+ ! statistics) is the step predictor, the phase rate at the mid-point of the last step (the
+ ! in-line one in the row after it, with in-line VIV): the step predicts the phase its lift
+ ! takes with it (viv_step_begin). viv_rate (that rate in a step) and viv_ms_next (the
+ ! end-of-step statistics) are step scratch.
LOGICAL :: has_viv = .FALSE.
! the cross-flow phase of a node at rest (CD_VIV_Phase_Rate phi_rest): pi where the node
! tangent runs against MoorDyn's (End B to End A), 0 where it runs as MoorDyn's
@@ -410,6 +422,62 @@ MODULE CableDyn_Model
REAL(wp), ALLOCATABLE :: viv_phi_rollback(:), viv_ms_rollback(:, :)
REAL(wp), ALLOCATABLE :: recovery_viv_phi(:), recovery_viv_ms(:, :)
REAL(wp), ALLOCATABLE :: viv_phi_eval(:), viv_rate(:), viv_ms_next(:, :), viv_phi_next(:)
+ ! In-line VIV (CD_Set_Model_VIV clx, il_alpha; Ulveseter et al. 2018): per element the in-line
+ ! shedding coefficient vil_cx (0 = no in-line force), per node the band vil_alpha, the in-line
+ ! phase vil_phi and the running mean squares of the in-line velocity and acceleration vil_ms,
+ ! with the cross-flow state's rollback, recovery, eval, rate and next twins. vil_node marks a
+ ! cross-flow node next to a vil_cx > 0 element.
+ LOGICAL :: has_viv_il = .FALSE.
+ REAL(wp), ALLOCATABLE :: vil_cx(:), vil_alpha(:)
+ ! the higher-harmonic coefficient C_hh per element (Ulveseter et al. 2019), with in-line VIV
+ REAL(wp), ALLOCATABLE :: vhh_cx(:)
+ LOGICAL, ALLOCATABLE :: vil_node(:)
+ REAL(wp), ALLOCATABLE :: vil_phi(:), vil_ms(:, :), vil_phi_rollback(:), vil_ms_rollback(:, :)
+ REAL(wp), ALLOCATABLE :: recovery_vil_phi(:), recovery_vil_ms(:, :)
+ REAL(wp), ALLOCATABLE :: vil_phi_eval(:), vil_rate(:), vil_ms_next(:, :), vil_phi_next(:)
+ ! Amplitude-dependent VIV coefficients (CD_Set_Model_VIV amp, amp_n; VIV AMPLITUDE section):
+ ! per element a table of amp_n rows (A/D, C_v, drag factor) in viv_amp(:, 1:amp_n, e) (amp_n 0
+ ! = none). With it viv_ms carries CD_VIV_NMS_AMP rows: after the mean squares, the amplitude
+ ! estimate of Thorsen et al. (2016) per node (CD_VIV_Amplitude_Update, row 5 the smoothed
+ ! amplitude). An element takes C_v and the factor of its normal drag coefficient from its table
+ ! at the mean smoothed amplitude of its VIV nodes over its diameter.
+ LOGICAL :: has_viv_amp = .FALSE.
+ REAL(wp), ALLOCATABLE :: viv_amp(:, :, :)
+ INTEGER, ALLOCATABLE :: viv_amp_n(:)
+ ! The flow frame of the synchronisation model (CD_Set_Model_VIV tf; VIV FRAME section): with a
+ ! filter time viv_ftf(nd) > 0 on some node (viv_frame) viv_ms has CD_VIV_NMS_FRAME rows, rows
+ ! 7:9 the node's (smoothed) velocity low-pass filtered over viv_ftf (first order; the
+ ! length-weighted average over its lifting elements), rows 3:6 the amplitude estimate (0
+ ! without amplitude tables). The node's velocity relative to it drives the phases (the relative
+ ! 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
+ ! non-dimensional distance theta = integral U/D dt; node nd's band centre is then
+ ! CD_VIV_Sto_Centre(viv_cf(nd), viv_sto_a(nd), viv_sto_f(1:n, nd), viv_sto_p(1:n, nd), theta)
+ ! with n = viv_sto_n(nd) components (0: the constant viv_cf(nd); viv_centre).
+ LOGICAL :: viv_sto = .FALSE.
+ REAL(wp), ALLOCATABLE :: viv_sto_a(:), viv_sto_f(:, :), viv_sto_p(:, :)
+ INTEGER, ALLOCATABLE :: viv_sto_n(:)
+ ! Wake-oscillator VIV (CD_Set_Model_VIV wake; Facchinetti et al. 2004): the van der Pol wake
+ ! variable q = 2 C_L/C_L0 replaces the synchronisation phase of the whole line, the lift scale
+ ! taking viv_cl = C_L0/2. Per node the Strouhal number, van der Pol eps and coupling A
+ ! (length-weighted over its lifting elements). The state rides in the VIV state slots, so the
+ ! rollback, step-recovery, sub-step and checkpoint copies carry it unchanged: viv_phi holds q
+ ! (viv_phi_eval q at the step's evaluation point, viv_phi_next q at the step end) and row 1 of
+ ! viv_ms dq/dt, row 2 the step predictor, the cross-flow acceleration at the mid-point of the
+ ! last step; in a step, viv_rate holds the step-start wake frequency. With a wake filter time
+ ! wo_tf > 0 on some node (wo_filter) viv_ms has CD_VIV_NMS_AMP rows, rows 3:5 the node's
+ ! velocity low-pass filtered over wo_tf (first order), and the wake frequency takes the flow
+ ! normal to the line relative to it (a line moved through still water sheds).
+ LOGICAL :: viv_wake = .FALSE., wo_filter = .FALSE.
+ REAL(wp), ALLOCATABLE :: wo_st(:), wo_eps(:), wo_a(:), wo_tf(:)
TYPE(GenAlphaConfig) :: cfg
! Run audit of the committed host steps (CD_Audit_Model_Step), diagnostics only: never part
! of the state, of a copy, or of a result. audit_t holds the segment tensions of the last two
@@ -2256,6 +2324,7 @@ LOGICAL FUNCTION sub_alloc(model, has_pres) RESULT(ok)
TYPE(CD_ModelType), INTENT(INOUT) :: model
LOGICAL, INTENT(IN) :: has_pres
INTEGER :: istat, k
+ LOGICAL :: reuse
ok = .FALSE.
istat = 0
DO k = 1, 2
@@ -2295,9 +2364,22 @@ LOGICAL FUNCTION sub_alloc(model, has_pres) RESULT(ok)
END IF
END IF
IF (model%has_viv) THEN
- IF (.NOT. sized(s%viv_phi, SIZE(model%viv_phi))) THEN
- IF (ALLOCATED(s%viv_phi)) DEALLOCATE (s%viv_phi, s%viv_ms)
- ALLOCATE (s%viv_phi(SIZE(model%viv_phi)), s%viv_ms(2, SIZE(model%viv_phi)), STAT=istat)
+ ! the motion statistics change rows with amplitude tables (CD_Model_VIV_NMS) on a line
+ ! whose VIV is set again after it has stepped: the slot follows both dimensions
+ reuse = sized(s%viv_phi, SIZE(model%viv_phi))
+ IF (reuse) reuse = ALLOCATED(s%viv_ms)
+ IF (reuse) reuse = SIZE(s%viv_ms, 1) == SIZE(model%viv_ms, 1) .AND. SIZE(s%viv_ms, 2) == SIZE(model%viv_ms, 2)
+ IF (.NOT. reuse) THEN
+ IF (ALLOCATED(s%viv_phi)) DEALLOCATE (s%viv_phi)
+ IF (ALLOCATED(s%viv_ms)) DEALLOCATE (s%viv_ms)
+ ALLOCATE (s%viv_phi(SIZE(model%viv_phi)), s%viv_ms(SIZE(model%viv_ms, 1), SIZE(model%viv_phi)), STAT=istat)
+ IF (istat /= 0) RETURN
+ END IF
+ END IF
+ IF (model%has_viv_il) THEN
+ IF (.NOT. sized(s%vil_phi, SIZE(model%vil_phi))) THEN
+ IF (ALLOCATED(s%vil_phi)) DEALLOCATE (s%vil_phi, s%vil_ms)
+ ALLOCATE (s%vil_phi(SIZE(model%vil_phi)), s%vil_ms(2, SIZE(model%vil_phi)), STAT=istat)
IF (istat /= 0) RETURN
END IF
END IF
@@ -2331,11 +2413,12 @@ END FUNCTION sized
END FUNCTION sub_alloc
SUBROUTINE commit_state_copy(model, to_model, q, v, a, ve_dl_1, syrope_slow, syrope_tmax, fr_anchor, &
- l0_c, l0_dot_c, viv_phi, viv_ms)
+ l0_c, l0_dot_c, viv_phi, viv_ms, vil_phi, vil_ms)
!! The one list of the state a line step commits: the kinematics, the viscoelastic dl_1, the
!! Syrope slow strain and running maximum tension, the friction anchors, the unstretched
!! lengths and rates the committed state was reached with (l0_c, l0_dot_c, active line
- !! control), and the VIV shedding phases and running mean squares. to_model =
+ !! control), and the VIV shedding phases and running mean squares (cross-flow, and in-line
+ !! with vil_phi, vil_ms). to_model =
!! .FALSE. saves the model's state into the arrays given, .TRUE. returns the model to them.
!! Every snapshot of the committed state in this module goes through here (the sub-step
!! slots of CD_Step_Model, save_recovery_state and restore_recovery_state). A state a step
@@ -2349,6 +2432,7 @@ SUBROUTINE commit_state_copy(model, to_model, q, v, a, ve_dl_1, syrope_slow, syr
REAL(wp), INTENT(INOUT) :: q(:), v(:), a(:)
REAL(wp), INTENT(INOUT), OPTIONAL :: ve_dl_1(:), syrope_slow(:), syrope_tmax(:), fr_anchor(:, :)
REAL(wp), INTENT(INOUT), OPTIONAL :: l0_c(:), l0_dot_c(:), viv_phi(:), viv_ms(:, :)
+ REAL(wp), INTENT(INOUT), OPTIONAL :: vil_phi(:), vil_ms(:, :)
IF (to_model) THEN
model%q = q
model%v = v
@@ -2368,6 +2452,11 @@ SUBROUTINE commit_state_copy(model, to_model, q, v, a, ve_dl_1, syrope_slow, syr
model%viv_ms = viv_ms
model%viv_phi_eval = viv_phi
END IF
+ IF (model%has_viv_il .AND. PRESENT(vil_phi) .AND. PRESENT(vil_ms)) THEN
+ model%vil_phi = vil_phi
+ model%vil_ms = vil_ms
+ model%vil_phi_eval = vil_phi
+ END IF
ELSE
q = model%q
v = model%v
@@ -2386,6 +2475,10 @@ SUBROUTINE commit_state_copy(model, to_model, q, v, a, ve_dl_1, syrope_slow, syr
viv_phi = model%viv_phi
viv_ms = model%viv_ms
END IF
+ IF (model%has_viv_il .AND. PRESENT(vil_phi) .AND. PRESENT(vil_ms)) THEN
+ vil_phi = model%vil_phi
+ vil_ms = model%vil_ms
+ END IF
END IF
END SUBROUTINE commit_state_copy
@@ -2397,7 +2490,8 @@ SUBROUTINE sub_store(model, slot)
model%sub_slot(slot)%ve_dl_1, model%sub_slot(slot)%syrope_slow, &
model%sub_slot(slot)%syrope_tmax, model%sub_slot(slot)%fr_anchor, &
model%sub_slot(slot)%l0_c, model%sub_slot(slot)%l0_dot_c, &
- model%sub_slot(slot)%viv_phi, model%sub_slot(slot)%viv_ms)
+ model%sub_slot(slot)%viv_phi, model%sub_slot(slot)%viv_ms, &
+ model%sub_slot(slot)%vil_phi, model%sub_slot(slot)%vil_ms)
END SUBROUTINE sub_store
SUBROUTINE sub_load(model, slot)
@@ -2408,7 +2502,8 @@ SUBROUTINE sub_load(model, slot)
model%sub_slot(slot)%ve_dl_1, model%sub_slot(slot)%syrope_slow, &
model%sub_slot(slot)%syrope_tmax, model%sub_slot(slot)%fr_anchor, &
model%sub_slot(slot)%l0_c, model%sub_slot(slot)%l0_dot_c, &
- model%sub_slot(slot)%viv_phi, model%sub_slot(slot)%viv_ms)
+ model%sub_slot(slot)%viv_phi, model%sub_slot(slot)%viv_ms, &
+ model%sub_slot(slot)%vil_phi, model%sub_slot(slot)%vil_ms)
END SUBROUTINE sub_load
SUBROUTINE sub_lengths_target(model)
@@ -2723,10 +2818,9 @@ SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrM
CALL step_start_load(ErrStat, ErrMsg)
IF (force_lengths) CALL leave_committed_lengths(model, aside)
IF (ErrStat /= CD_MODEL_OK) RETURN
- ! VIV: phase rate and mean squares at the step-start state (after the committed-state
- ! load above, which takes the committed phase), and the explicit phase for the in-step
- ! lift (see viv_step_begin). Nothing is
- ! committed until the step succeeds; viv_phi_eval returns to the committed phase on
+ ! VIV: the predicted phase rate and the explicit phase for the in-step lift (after the
+ ! committed-state load above, which takes the committed phase; see viv_step_begin). Nothing
+ ! is committed until the step succeeds; viv_phi_eval returns to the committed phase on
! every exit, as ve_dt below.
IF (model%has_viv) THEN
IF (.NOT. (CD_Is_Finite(dt) .AND. dt > CD_ZERO)) THEN
@@ -2736,6 +2830,7 @@ SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrM
CALL viv_step_begin(model, dt, ErrStat, ErrMsg)
IF (ErrStat /= CD_MODEL_OK) THEN
model%viv_phi_eval = model%viv_phi
+ IF (model%has_viv_il) model%vil_phi_eval = model%vil_phi
RETURN
END IF
END IF
@@ -2857,6 +2952,7 @@ SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrM
IF (ALLOCATED(f_ext_new)) model%f_ext = f_ext_new
model%ve_dt = CD_ZERO
IF (model%has_viv) model%viv_phi_eval = model%viv_phi
+ IF (model%has_viv_il) model%vil_phi_eval = model%vil_phi
CALL CD_Profile_Count_Line_Step(n_iter)
IF (es /= CD_DYN_OK) THEN
ErrStat = model_status_from_dyn(es)
@@ -2926,7 +3022,8 @@ SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrM
RETURN
END IF
END IF
- ! VIV pass 1: the end-of-step phase (Heun) into viv_phi_next; committed below.
+ ! VIV pass 1: the end-of-step phase (mid-point rule) and statistics into viv_phi_next and
+ ! viv_ms_next; committed below.
IF (model%has_viv) THEN
CALL viv_step_end(model, dt, ErrStat, ErrMsg)
IF (ErrStat /= CD_MODEL_OK) THEN
@@ -2988,11 +3085,15 @@ SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrM
END BLOCK
END IF
IF (model%has_viv) THEN
- ! VIV pass 2 (mutate): the phase and the mean squares updated with the step-start
- ! sample (the next step starts by adding its own sample, the end state of this one)
+ ! VIV pass 2 (mutate): the phase, the statistics and the step predictor at the step end
model%viv_phi = model%viv_phi_next
model%viv_ms = model%viv_ms_next
model%viv_phi_eval = model%viv_phi
+ IF (model%has_viv_il) THEN
+ model%vil_phi = model%vil_phi_next
+ model%vil_ms = model%vil_ms_next
+ model%vil_phi_eval = model%vil_phi
+ END IF
END IF
model%q = model%q_step
model%v = model%v_step
@@ -3376,7 +3477,8 @@ SUBROUTINE save_recovery_state(model)
CALL commit_state_copy(model, .FALSE., model%recovery_q0, model%recovery_v0, model%recovery_a0, &
model%recovery_ve_dl_1, model%recovery_syrope_slow, model%recovery_syrope_tmax, &
model%recovery_fr_anchor, model%recovery_l0_c, model%recovery_l0_dot_c, &
- model%recovery_viv_phi, model%recovery_viv_ms)
+ model%recovery_viv_phi, model%recovery_viv_ms, model%recovery_vil_phi, &
+ model%recovery_vil_ms)
END SUBROUTINE save_recovery_state
SUBROUTINE restore_recovery_state(model)
@@ -3385,7 +3487,8 @@ SUBROUTINE restore_recovery_state(model)
CALL commit_state_copy(model, .TRUE., model%recovery_q0, model%recovery_v0, model%recovery_a0, &
model%recovery_ve_dl_1, model%recovery_syrope_slow, model%recovery_syrope_tmax, &
model%recovery_fr_anchor, model%recovery_l0_c, model%recovery_l0_dot_c, &
- model%recovery_viv_phi, model%recovery_viv_ms)
+ model%recovery_viv_phi, model%recovery_viv_ms, model%recovery_vil_phi, &
+ model%recovery_vil_ms)
model%ve_dt = CD_ZERO
END SUBROUTINE restore_recovery_state
@@ -3883,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)
+ 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;
@@ -3899,6 +4002,34 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat,
!! An all-zero cl leaves the model without VIV. The mesh must be the single chain the
!! line builder makes (element e joins nodes e and e+1). The caller recomputes the
!! acceleration if the lift should enter the initial state (CD_Recompute_Model_Acceleration).
+ !! In-line VIV (Ulveseter et al. 2018; both or neither): clx, per element, the in-line shedding
+ !! coefficient (0: none; > 0 only where cl > 0, the in-line phase running at twice the
+ !! cross-flow one) and il_alpha its band (0 <= alpha < 1); the in-line phase of a node starts at
+ !! twice its cross-flow phase. chh (optional, with clx), per element, the coefficient C_hh >= 0
+ !! of the higher-harmonic force of Ulveseter et al. (2019), the lift's form at the phase sum
+ !! phi_y + phi_x (0: none; > 0 only where clx > 0).
+ !! Amplitude-dependent coefficients (both or neither): amp (3, CD_VIV_AMP_MAXP, n_elem) and
+ !! amp_n (n_elem), per element a table of amp_n rows (0: none; only where cl > 0) of the
+ !! amplitude ratio A/D >= 0 (strictly increasing), the cross-flow coefficient C_v >= 0 that
+ !! replaces cl, and the factor > 0 of the element's normal drag coefficient, at the smoothed
+ !! amplitude estimate of Thorsen et al. (2016); piecewise linear, held beyond the end rows.
+ !! Wake oscillator (Facchinetti et al. 2004; not with in-line VIV or amplitude tables): wake
+ !! (3, n_elem), per element the Strouhal number St > 0, van der Pol eps > 0 and acceleration
+ !! coupling A >= 0 (each at most 1e15) where cl > 0, with cl then the reference lift
+ !! coefficient C_L0 of a fixed cylinder; cf and df are unused. The wake variable q of a node
+ !! starts on its limit cycle at the node's start phase, q = 2 cos(phi_0), with dq/dt = 0. An
+ !! optional fourth row wake(4, :) = Tf [s] >= 0 takes the flow relative to the node velocity
+ !! low-pass filtered over Tf (0: the ambient flow).
+ !! tf (optional, n_elem; not with wake), per element the filter time Tf [s] of the flow frame of
+ !! the synchronisation model (0: the ambient flow; > 0 only where cl > 0, at most 1e15), vbar
+ !! the node's smoothed velocity low-pass filtered over Tf (first order): the cross-flow and
+ !! 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
@@ -3908,8 +4039,23 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat,
!! MoorDyn's, so a node at rest takes the cross-flow phase pi (CD_VIV_Phase_Rate phi_rest);
!! .FALSE. on a line the reader turned around, whose tangent runs as MoorDyn's
LOGICAL, INTENT(IN), OPTIONAL :: tangent_reversed
- INTEGER :: n_nodes, n_elem, e, nd, istat, k
- REAL(wp) :: wsum
+ REAL(wp), INTENT(IN), OPTIONAL :: clx(:), il_alpha(:), chh(:)
+ REAL(wp), INTENT(IN), OPTIONAL :: amp(:, :, :)
+ 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
+ !! (only where cl > 0) 0 < c <= 1, an integer N_f from 1 to CD_VIV_STO_MAXF and an integer seed
+ !! from 0 to 2^31 - 2. A node takes the length-weighted sigma over its lifting elements, the
+ !! length-weighted c over those with sigma > 0, the most components and the seed of the first.
+ 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, want_cyc
+ CHARACTER(160) :: amsg
ErrStat = CD_MODEL_OK
ErrMsg = ''
@@ -3943,6 +4089,147 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat,
RETURN
END IF
END IF
+ IF (PRESENT(clx) .NEQV. PRESENT(il_alpha)) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV clx and il_alpha go together')
+ RETURN
+ END IF
+ want_il = .FALSE.
+ IF (PRESENT(clx)) THEN
+ IF (SIZE(clx) /= n_elem .OR. SIZE(il_alpha) /= n_elem) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV clx and il_alpha must each have shape (n_elem)')
+ RETURN
+ END IF
+ IF (.NOT. (CD_All_Finite(clx) .AND. CD_All_Finite(il_alpha))) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV clx and il_alpha must be finite')
+ RETURN
+ END IF
+ IF (ANY(clx < CD_ZERO) .OR. ANY(clx > CD_ZERO .AND. .NOT. (il_alpha >= CD_ZERO .AND. il_alpha < CD_ONE))) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV needs clx >= 0 and 0 <= il_alpha < 1 where clx > 0')
+ RETURN
+ END IF
+ IF (ANY(clx > CD_ZERO .AND. .NOT. (cl > CD_ZERO))) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV (clx > 0) needs the cross-flow lift (cl > 0) on the same '// &
+ 'element: its phase rate is twice the cross-flow one')
+ RETURN
+ END IF
+ want_il = ANY(clx > CD_ZERO)
+ END IF
+ IF (PRESENT(chh)) THEN
+ IF (.NOT. PRESENT(clx)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the higher-harmonic VIV chh needs the in-line clx')
+ RETURN
+ END IF
+ IF (SIZE(chh) /= n_elem .OR. .NOT. CD_All_Finite(chh)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the higher-harmonic VIV chh must be finite with shape (n_elem)')
+ RETURN
+ END IF
+ IF (ANY(chh < CD_ZERO) .OR. ANY(chh > CD_ZERO .AND. .NOT. (clx > CD_ZERO))) THEN
+ CALL fail(ErrStat, ErrMsg, 'the higher-harmonic VIV needs chh >= 0, and chh > 0 only where clx > 0 '// &
+ '(it runs at the cross-flow plus in-line phase)')
+ RETURN
+ END IF
+ END IF
+ IF (PRESENT(amp) .NEQV. PRESENT(amp_n)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV amplitude tables amp and amp_n go together')
+ RETURN
+ END IF
+ want_amp = .FALSE.
+ IF (PRESENT(amp)) THEN
+ CALL CD_VIV_Check_Amp_Table(amp, amp_n, cl, amsg)
+ IF (LEN_TRIM(amsg) > 0) THEN
+ CALL fail(ErrStat, ErrMsg, TRIM(amsg))
+ RETURN
+ END IF
+ want_amp = ANY(amp_n > 0)
+ END IF
+ want_wake = .FALSE.
+ want_filter = .FALSE.
+ IF (PRESENT(wake)) THEN
+ IF ((SIZE(wake, 1) /= 3 .AND. SIZE(wake, 1) /= 4) .OR. SIZE(wake, 2) /= n_elem) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV wake oscillator wake must have shape (3 or 4, n_elem)')
+ RETURN
+ END IF
+ IF (.NOT. CD_All_Finite(wake)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV wake oscillator St, eps, A and Tf must be finite')
+ RETURN
+ END IF
+ DO e = 1, n_elem
+ IF (.NOT. (cl(e) > CD_ZERO)) CYCLE
+ IF (.NOT. (wake(1, e) > CD_ZERO .AND. wake(2, e) > CD_ZERO .AND. wake(3, e) >= CD_ZERO .AND. &
+ ALL(wake(:, e) <= 1.0e15_wp))) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV wake oscillator needs St > 0, eps > 0 and A >= 0, each at most '// &
+ '1e15, where cl > 0')
+ RETURN
+ END IF
+ IF (SIZE(wake, 1) == 4) THEN
+ IF (wake(4, e) < CD_ZERO) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV wake oscillator filter time Tf must be >= 0 (0 = the ambient '// &
+ 'flow) and at most 1e15')
+ RETURN
+ END IF
+ IF (wake(4, e) > CD_ZERO) want_filter = .TRUE.
+ END IF
+ END DO
+ want_wake = ANY(cl > CD_ZERO)
+ IF (want_wake .AND. want_il) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV wake oscillator takes no in-line VIV (clx > 0)')
+ RETURN
+ END IF
+ IF (want_wake .AND. want_amp) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV wake oscillator takes no amplitude tables')
+ RETURN
+ END IF
+ END IF
+ want_frame = .FALSE.
+ IF (PRESENT(tf)) THEN
+ IF (PRESENT(wake)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV wake oscillator takes its filter time as wake(4, :), not tf')
+ RETURN
+ END IF
+ IF (SIZE(tf) /= n_elem .OR. .NOT. CD_All_Finite(tf)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV flow-frame filter time tf must be finite with shape (n_elem)')
+ RETURN
+ END IF
+ IF (ANY(tf < CD_ZERO) .OR. ANY(tf > 1.0e15_wp)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV flow-frame filter time Tf must be >= 0 (0 = the ambient flow) and '// &
+ 'at most 1e15')
+ RETURN
+ END IF
+ IF (ANY(tf > CD_ZERO .AND. .NOT. (cl > CD_ZERO))) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV flow frame (tf > 0) acts on the VIV model: tf > 0 only where cl > 0')
+ RETURN
+ END IF
+ want_frame = ANY(tf > CD_ZERO)
+ END IF
+ want_sto = .FALSE.
+ IF (PRESENT(sto)) THEN
+ IF (SIZE(sto, 1) /= 4 .OR. SIZE(sto, 2) /= n_elem .OR. .NOT. CD_All_Finite(sto)) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV stochastic band centre sto must be finite with shape (4, n_elem)')
+ RETURN
+ END IF
+ DO e = 1, n_elem
+ IF (sto(1, e) < CD_ZERO) THEN
+ CALL fail(ErrStat, ErrMsg, 'the VIV stochastic band centre needs sigma >= 0')
+ RETURN
+ END IF
+ IF (.NOT. (sto(1, e) > CD_ZERO)) CYCLE
+ IF (.NOT. (cl(e) > CD_ZERO) .OR. want_wake) THEN
+ CALL fail(ErrStat, ErrMsg, 'a VIV stochastic band centre (sigma > 0) acts on the synchronisation model: '// &
+ 'only where cl > 0, and not with the wake oscillator')
+ RETURN
+ END IF
+ IF (.NOT. (sto(1, e) <= 1.0e3_wp .AND. sto(2, e) > CD_ZERO .AND. sto(2, e) <= CD_ONE .AND. &
+ sto(3, e) >= CD_ONE .AND. sto(3, e) <= REAL(CD_VIV_STO_MAXF, wp) .AND. &
+ .NOT. (ABS(sto(3, e) - AINT(sto(3, e))) > CD_ZERO) .AND. sto(4, e) >= CD_ZERO .AND. &
+ sto(4, e) <= 2147483646.0_wp .AND. .NOT. (ABS(sto(4, e) - AINT(sto(4, e))) > CD_ZERO))) THEN
+ WRITE (amsg, '(A,I0,A)') 'the VIV stochastic band centre needs sigma at most 1e3, 0 < c <= 1, an '// &
+ 'integer N_f from 1 to ', CD_VIV_STO_MAXF, ' and an integer seed from 0 to 2147483646'
+ CALL fail(ErrStat, ErrMsg, TRIM(amsg))
+ RETURN
+ END IF
+ END DO
+ want_sto = ANY(sto(1, :) > CD_ZERO)
+ END IF
CALL clear_viv(model)
IF (.NOT. ANY(cl > CD_ZERO)) RETURN
IF (.NOT. (CD_Is_Finite(rho) .AND. rho > CD_ZERO)) THEN
@@ -3955,6 +4242,7 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat,
CALL fail(ErrStat, ErrMsg, 'VIV needs a positive diameter on every Cl > 0 element')
RETURN
END IF
+ IF (want_wake) CYCLE
IF (.NOT. (cf(e) > CD_ZERO .AND. df(e) >= CD_ZERO .AND. df(e) < cf(e))) THEN
CALL fail(ErrStat, ErrMsg, 'VIV synchronisation needs cF > 0 and 0 <= dF < cF (a positive '// &
'shedding frequency)')
@@ -3967,17 +4255,38 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat,
RETURN
END IF
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)
+ IF (want_sto) nms = nms + 1
ALLOCATE (model%viv_cl(n_elem), model%viv_d(n_elem), model%viv_node(n_nodes), model%viv_cf(n_nodes), &
- model%viv_df(n_nodes), model%viv_dn(n_nodes), model%viv_phi(n_nodes), model%viv_ms(2, n_nodes), &
- model%viv_phi_rollback(n_nodes), model%viv_ms_rollback(2, n_nodes), &
- model%recovery_viv_phi(n_nodes), model%recovery_viv_ms(2, n_nodes), &
- model%viv_phi_eval(n_nodes), model%viv_rate(n_nodes), model%viv_ms_next(2, n_nodes), &
+ model%viv_df(n_nodes), model%viv_dn(n_nodes), model%viv_phi(n_nodes), model%viv_ms(nms, n_nodes), &
+ model%viv_phi_rollback(n_nodes), model%viv_ms_rollback(nms, n_nodes), &
+ model%recovery_viv_phi(n_nodes), model%recovery_viv_ms(nms, n_nodes), &
+ model%viv_phi_eval(n_nodes), model%viv_rate(n_nodes), model%viv_ms_next(nms, n_nodes), &
model%viv_phi_next(n_nodes), STAT=istat)
IF (istat /= 0) THEN
CALL clear_viv(model)
CALL alloc_fail(ErrStat, ErrMsg, 'VIV storage allocation failed')
RETURN
END IF
+ IF (want_amp) THEN
+ ALLOCATE (model%viv_amp(3, CD_VIV_AMP_MAXP, n_elem), model%viv_amp_n(n_elem), STAT=istat)
+ IF (istat /= 0) THEN
+ CALL clear_viv(model)
+ CALL alloc_fail(ErrStat, ErrMsg, 'VIV amplitude table allocation failed')
+ RETURN
+ END IF
+ model%viv_amp = amp
+ model%viv_amp_n = amp_n
+ model%has_viv_amp = .TRUE.
+ END IF
model%viv_rho = rho
model%viv_tw = t_window
model%viv_cl = MERGE(cl, CD_ZERO, cl > CD_ZERO)
@@ -4009,6 +4318,75 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat,
model%viv_phi(nd) = CD_VIV_Wrap_Phase(CD_VIV_TWO_PI*(REAL(n_nodes - nd, wp)/REAL(n_elem, wp) + 0.5_wp))
IF (PRESENT(phase_seed)) model%viv_phi(nd) = CD_VIV_TWO_PI*phase_seed(nd)
END DO
+ IF (want_sto) THEN
+ ! per node the length-weighted sigma over its lifting elements, the length-weighted c over
+ ! those with sigma > 0, their most components and the seed of the first; theta starts at 0
+ nfm = NINT(MAXVAL(sto(3, :), MASK=sto(1, :) > CD_ZERO))
+ ALLOCATE (model%viv_sto_a(n_nodes), model%viv_sto_f(nfm, n_nodes), model%viv_sto_p(nfm, n_nodes), &
+ model%viv_sto_n(n_nodes), STAT=istat)
+ IF (istat /= 0) THEN
+ CALL clear_viv(model)
+ CALL alloc_fail(ErrStat, ErrMsg, 'VIV stochastic band centre allocation failed')
+ RETURN
+ END IF
+ model%viv_sto_a = CD_ZERO
+ model%viv_sto_f = CD_ZERO
+ model%viv_sto_p = CD_ZERO
+ model%viv_sto_n = 0
+ DO nd = 2, n_nodes - 1
+ IF (.NOT. model%viv_node(nd)) CYCLE
+ wsum = CD_ZERO; ssum = CD_ZERO; csum = CD_ZERO; cw = CD_ZERO; nfk = 0; seedk = -1
+ DO k = nd - 1, nd
+ IF (.NOT. (cl(k) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(k)
+ ssum = ssum + model%l0(k)*sto(1, k)
+ IF (.NOT. (sto(1, k) > CD_ZERO)) CYCLE
+ cw = cw + model%l0(k)
+ csum = csum + model%l0(k)*sto(2, k)
+ nfk = MAX(nfk, NINT(sto(3, k)))
+ IF (seedk < 0) seedk = NINT(sto(4, k))
+ END DO
+ IF (nfk < 1) CYCLE
+ CALL CD_VIV_Sto_Node(ssum/wsum, csum/cw, model%viv_cf(nd), nfk, seedk, nd, model%viv_sto_a(nd), &
+ model%viv_sto_f(1:nfk, nd), model%viv_sto_p(1:nfk, nd))
+ model%viv_sto_n(nd) = nfk
+ END DO
+ model%viv_sto = .TRUE.
+ END IF
+ IF (want_frame) THEN
+ ALLOCATE (model%viv_ftf(n_nodes), STAT=istat)
+ IF (istat /= 0) THEN
+ CALL clear_viv(model)
+ CALL alloc_fail(ErrStat, ErrMsg, 'VIV flow frame storage allocation failed')
+ RETURN
+ END IF
+ ! 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
+ DO k = nd - 1, nd
+ IF (.NOT. (cl(k) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(k)
+ model%viv_ftf(nd) = model%viv_ftf(nd) + model%l0(k)*tf(k)
+ 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
model%recovery_viv_phi = model%viv_phi
@@ -4019,7 +4397,97 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat,
model%viv_phi_next = model%viv_phi
model%viv_phi_rest = 0.5_wp*CD_VIV_TWO_PI
IF (PRESENT(tangent_reversed)) model%viv_phi_rest = MERGE(0.5_wp*CD_VIV_TWO_PI, CD_ZERO, tangent_reversed)
+ IF (want_wake) THEN
+ ALLOCATE (model%wo_st(n_nodes), model%wo_eps(n_nodes), model%wo_a(n_nodes), model%wo_tf(n_nodes), STAT=istat)
+ IF (istat /= 0) THEN
+ CALL clear_viv(model)
+ CALL alloc_fail(ErrStat, ErrMsg, 'VIV wake oscillator storage allocation failed')
+ RETURN
+ END IF
+ ! the node's lift scale (viv_node_coef, 1/2 rho D viv_cl over its tributary length) is then
+ ! that of 1/4 rho D C_L0, the lift per unit length 1/4 rho D C_L0 q U^2
+ model%viv_cl = 0.5_wp*model%viv_cl
+ model%wo_st = CD_ZERO
+ model%wo_eps = CD_ZERO
+ model%wo_a = CD_ZERO
+ model%wo_tf = CD_ZERO
+ model%wo_filter = want_filter
+ DO nd = 2, n_nodes - 1
+ IF (.NOT. model%viv_node(nd)) CYCLE
+ wsum = CD_ZERO
+ DO k = nd - 1, nd
+ IF (.NOT. (cl(k) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(k)
+ model%wo_st(nd) = model%wo_st(nd) + model%l0(k)*wake(1, k)
+ model%wo_eps(nd) = model%wo_eps(nd) + model%l0(k)*wake(2, k)
+ model%wo_a(nd) = model%wo_a(nd) + model%l0(k)*wake(3, k)
+ IF (want_filter) model%wo_tf(nd) = model%wo_tf(nd) + model%l0(k)*wake(4, k)
+ END DO
+ model%wo_st(nd) = model%wo_st(nd)/wsum
+ model%wo_eps(nd) = model%wo_eps(nd)/wsum
+ model%wo_a(nd) = model%wo_a(nd)/wsum
+ model%wo_tf(nd) = model%wo_tf(nd)/wsum
+ ! on the limit cycle at the node's start phase
+ model%viv_phi(nd) = 2.0_wp*COS(model%viv_phi(nd))
+ ! the filtered velocity starts at the node's (smoothed) velocity
+ IF (want_filter) model%viv_ms(3:5, nd) = smoothed(model%v, 3*nd - 2)
+ END DO
+ model%viv_cf = CD_ZERO
+ model%viv_df = CD_ZERO
+ model%viv_phi_rollback = model%viv_phi
+ model%recovery_viv_phi = model%viv_phi
+ model%viv_phi_eval = model%viv_phi
+ model%viv_phi_next = model%viv_phi
+ model%viv_ms_rollback = model%viv_ms
+ model%recovery_viv_ms = model%viv_ms
+ model%viv_ms_next = model%viv_ms
+ model%viv_wake = .TRUE.
+ END IF
model%has_viv = .TRUE.
+ IF (.NOT. want_il) THEN
+ CALL viv_seed_predictor(model)
+ RETURN
+ END IF
+ ALLOCATE (model%vil_cx(n_elem), model%vil_alpha(n_nodes), model%vil_node(n_nodes), model%vil_phi(n_nodes), &
+ model%vil_ms(2, n_nodes), model%vil_phi_rollback(n_nodes), model%vil_ms_rollback(2, n_nodes), &
+ model%recovery_vil_phi(n_nodes), model%recovery_vil_ms(2, n_nodes), model%vil_phi_eval(n_nodes), &
+ model%vil_rate(n_nodes), model%vil_ms_next(2, n_nodes), model%vil_phi_next(n_nodes), &
+ model%vhh_cx(n_elem), STAT=istat)
+ IF (istat /= 0) THEN
+ CALL clear_viv(model)
+ CALL alloc_fail(ErrStat, ErrMsg, 'in-line VIV storage allocation failed')
+ RETURN
+ END IF
+ model%vil_cx = MERGE(clx, CD_ZERO, clx > CD_ZERO)
+ model%vhh_cx = CD_ZERO
+ IF (PRESENT(chh)) model%vhh_cx = MERGE(chh, CD_ZERO, chh > CD_ZERO)
+ model%vil_alpha = CD_ZERO
+ model%vil_node = .FALSE.
+ model%vil_phi = CD_ZERO
+ model%vil_ms = CD_ZERO
+ DO nd = 2, n_nodes - 1
+ IF (.NOT. model%viv_node(nd)) CYCLE
+ wsum = CD_ZERO
+ DO k = nd - 1, nd
+ IF (.NOT. (clx(k) > CD_ZERO)) CYCLE
+ wsum = wsum + model%l0(k)
+ model%vil_alpha(nd) = model%vil_alpha(nd) + model%l0(k)*il_alpha(k)
+ END DO
+ IF (.NOT. (wsum > CD_ZERO)) CYCLE
+ model%vil_node(nd) = .TRUE.
+ model%vil_alpha(nd) = model%vil_alpha(nd)/wsum
+ model%vil_phi(nd) = CD_VIV_Wrap_Phase(2.0_wp*model%viv_phi(nd))
+ END DO
+ model%vil_phi_rollback = model%vil_phi
+ model%vil_ms_rollback = model%vil_ms
+ model%recovery_vil_phi = model%vil_phi
+ model%recovery_vil_ms = model%vil_ms
+ model%vil_phi_eval = model%vil_phi
+ model%vil_rate = CD_ZERO
+ model%vil_ms_next = model%vil_ms
+ model%vil_phi_next = model%vil_phi
+ model%has_viv_il = .TRUE.
+ CALL viv_seed_predictor(model)
END SUBROUTINE CD_Set_Model_VIV
SUBROUTINE CD_Latch_Model_VIV_Window(model, dt)
@@ -4034,17 +4502,25 @@ SUBROUTINE CD_Latch_Model_VIV_Window(model, dt)
model%viv_tw = REAL(CD_VIV_NM, wp)*dt
END SUBROUTINE CD_Latch_Model_VIV_Window
- SUBROUTINE CD_Get_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg)
+ SUBROUTINE CD_Get_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg, phi_x, ms_x)
!! Copy the committed VIV state for a checkpoint: the shedding phase per node (n_nodes),
- !! the running mean squares of the cross-flow velocity and acceleration (2, n_nodes), and
- !! the averaging time (0 while unlatched). A model without VIV returns zeros.
+ !! the motion statistics (CD_Model_VIV_NMS, n_nodes: the running mean squares of the
+ !! cross-flow velocity and acceleration, the amplitude estimate and the flow frame where the
+ !! line has them, and the step predictor), and the averaging time (0 while unlatched). A model
+ !! without VIV returns zeros. phi_x and ms_x (both or neither, shapes (n_nodes) and (2,
+ !! n_nodes)) take the in-line phase and mean squares, zero without in-line VIV. On a
+ !! wake-oscillator line phi is the wake variable q, row 1 of ms its rate dq/dt and row 2 the
+ !! step predictor.
TYPE(CD_ModelType), INTENT(IN) :: model
REAL(wp), INTENT(OUT) :: phi(:), ms(:, :), t_window
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ REAL(wp), INTENT(OUT), OPTIONAL :: phi_x(:), ms_x(:, :)
phi = CD_ZERO
ms = CD_ZERO
t_window = CD_ZERO
+ IF (PRESENT(phi_x)) phi_x = CD_ZERO
+ IF (PRESENT(ms_x)) ms_x = CD_ZERO
ErrStat = CD_MODEL_OK
ErrMsg = ''
IF (.NOT. model%initialized) THEN
@@ -4052,24 +4528,42 @@ SUBROUTINE CD_Get_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg)
ErrMsg = 'CableDyn_Model: model is not initialized'
RETURN
END IF
- IF (SIZE(phi) /= model%n_dof/3 .OR. SIZE(ms, 1) /= 2 .OR. SIZE(ms, 2) /= model%n_dof/3) THEN
- CALL fail(ErrStat, ErrMsg, 'VIV state outputs must have shapes (n_nodes) and (2, n_nodes)')
+ IF (SIZE(phi) /= model%n_dof/3 .OR. SIZE(ms, 1) /= CD_Model_VIV_NMS(model) .OR. SIZE(ms, 2) /= model%n_dof/3) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV state outputs must have shapes (n_nodes) and (CD_Model_VIV_NMS, n_nodes)')
RETURN
END IF
+ IF (PRESENT(phi_x) .NEQV. PRESENT(ms_x)) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV state outputs phi_x and ms_x go together')
+ RETURN
+ END IF
+ IF (PRESENT(phi_x)) THEN
+ IF (SIZE(phi_x) /= model%n_dof/3 .OR. SIZE(ms_x, 1) /= 2 .OR. SIZE(ms_x, 2) /= model%n_dof/3) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV state outputs must have shapes (n_nodes) and (2, n_nodes)')
+ RETURN
+ END IF
+ END IF
IF (.NOT. model%has_viv) RETURN
phi = model%viv_phi
ms = model%viv_ms
t_window = model%viv_tw
+ IF (PRESENT(phi_x) .AND. model%has_viv_il) THEN
+ phi_x = model%vil_phi
+ ms_x = model%vil_ms
+ END IF
END SUBROUTINE CD_Get_Model_VIV_State
- SUBROUTINE CD_Set_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg)
+ SUBROUTINE CD_Set_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg, phi_x, ms_x)
!! Overwrite the committed VIV state from a checkpoint (see CD_Get_Model_VIV_State).
!! Fails closed on a model without VIV, a shape mismatch, non-finite values, a negative
- !! mean square or averaging time.
+ !! mean square, amplitude or averaging time. A model with in-line VIV needs phi_x and ms_x,
+ !! one without refuses them.
TYPE(CD_ModelType), INTENT(INOUT) :: model
REAL(wp), INTENT(IN) :: phi(:), ms(:, :), t_window
INTEGER, INTENT(OUT) :: ErrStat
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
@@ -4081,18 +4575,59 @@ SUBROUTINE CD_Set_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg)
CALL fail(ErrStat, ErrMsg, 'model carries no VIV state to set')
RETURN
END IF
- IF (SIZE(phi) /= model%n_dof/3 .OR. SIZE(ms, 1) /= 2 .OR. SIZE(ms, 2) /= model%n_dof/3) THEN
- CALL fail(ErrStat, ErrMsg, 'VIV state inputs must have shapes (n_nodes) and (2, n_nodes)')
+ IF (SIZE(phi) /= model%n_dof/3 .OR. SIZE(ms, 1) /= CD_Model_VIV_NMS(model) .OR. SIZE(ms, 2) /= model%n_dof/3) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV state inputs must have shapes (n_nodes) and (CD_Model_VIV_NMS, n_nodes)')
RETURN
END IF
IF (.NOT. (CD_All_Finite(phi) .AND. CD_All_Finite(ms) .AND. CD_Is_Finite(t_window))) THEN
CALL fail(ErrStat, ErrMsg, 'VIV state mirror must be finite')
RETURN
END IF
- IF (ANY(ms < CD_ZERO) .OR. t_window < CD_ZERO) THEN
- CALL fail(ErrStat, ErrMsg, 'VIV mean squares and averaging time must be non-negative')
+ ! the mean squares (rows 1:2) and the amplitudes y0, y0s (rows 4:5) cannot be negative; the
+ ! travel and the last cross-flow velocity of the amplitude estimate (rows 3, 6) and the step
+ ! predictor's rates (row viv_pred_row on) are signed (a wake-oscillator line holds dq/dt in row 1
+ ! and its predictor, the mid-point cross-flow acceleration, in row 2, both signed)
+ 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
+ END IF
+ IF (((PRESENT(phi_x) .AND. PRESENT(ms_x)) .NEQV. model%has_viv_il) .OR. (PRESENT(phi_x) .NEQV. PRESENT(ms_x))) THEN
+ CALL fail(ErrStat, ErrMsg, 'the in-line VIV state (phi_x, ms_x) goes with a model with in-line VIV')
RETURN
END IF
+ IF (model%has_viv_il) THEN
+ IF (SIZE(phi_x) /= model%n_dof/3 .OR. SIZE(ms_x, 1) /= 2 .OR. SIZE(ms_x, 2) /= model%n_dof/3) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV state inputs must have shapes (n_nodes) and (2, n_nodes)')
+ RETURN
+ END IF
+ IF (.NOT. (CD_All_Finite(phi_x) .AND. CD_All_Finite(ms_x))) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV state mirror must be finite')
+ RETURN
+ END IF
+ IF (ANY(ms_x < CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV mean squares must be non-negative')
+ RETURN
+ END IF
+ model%vil_phi = phi_x
+ model%vil_ms = ms_x
+ model%vil_phi_rollback = phi_x
+ model%vil_ms_rollback = ms_x
+ model%recovery_vil_phi = phi_x
+ model%recovery_vil_ms = ms_x
+ model%vil_phi_eval = phi_x
+ END IF
model%viv_phi = phi
model%viv_ms = ms
model%viv_tw = t_window
@@ -4111,8 +4646,7 @@ SUBROUTINE CD_Get_Model_VIV_Lift(model, lift, ErrStat, ErrMsg)
REAL(wp), INTENT(OUT) :: lift(:, :)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: nd, ia
- REAL(wp) :: coef, uu(3)
+ INTEGER :: nd
LOGICAL :: ok
lift = CD_ZERO
ErrStat = CD_MODEL_OK
@@ -4129,30 +4663,267 @@ SUBROUTINE CD_Get_Model_VIV_Lift(model, lift, ErrStat, ErrMsg)
IF (.NOT. model%has_viv) RETURN
DO nd = 2, model%n_dof/3 - 1
IF (.NOT. model%viv_node(nd)) CYCLE
- CALL viv_node_coef(model, model%q, nd, coef, uu)
- ia = 3*nd - 2
- CALL CD_VIV_Node_Lift(model%q(ia - 3:ia - 1), model%q(ia + 3:ia + 5), smoothed(model%v, ia), uu, coef, &
- model%viv_phi(nd), lift(:, nd), ok)
+ CALL viv_node_load(model, model%q, model%v, nd, .FALSE., lift(:, nd), ok)
END DO
END SUBROUTINE CD_Get_Model_VIV_Lift
+ SUBROUTINE CD_Get_Model_Load_Power(model, p_viv, p_drag, p_damp, ErrStat, ErrMsg)
+ !! The power [W] three loads deliver to the line at the committed state, per node (n_nodes):
+ !! the VIV loads (cross-flow lift, and the in-line force where it is on) at the committed
+ !! phases, the Morison drag and the axial structural damping (BA). An element's force on its
+ !! two nodes delivers f_a . v_a + f_b . v_b, half to each node, and a node load f . v to its
+ !! node, so the node values sum to the exact power of the load. The damping power of every
+ !! element, and so of every node, is never positive; the viscoelastic and Syrope laws' own
+ !! damping is not included.
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ REAL(wp), INTENT(OUT) :: p_viv(:), p_drag(:), p_damp(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER :: e, nd, nn, idx(6), lk
+ REAL(wp) :: q2(6), v2(6), f2(6), fluid2(3, 2), wl2(2), fl(3)
+ LOGICAL :: ok
+ p_viv = CD_ZERO
+ p_drag = CD_ZERO
+ p_damp = CD_ZERO
+ ErrStat = CD_MODEL_OK
+ ErrMsg = ''
+ IF (.NOT. model%initialized) THEN
+ CALL fail(ErrStat, ErrMsg, 'load power: the model is not initialised')
+ RETURN
+ END IF
+ nn = model%n_dof/3
+ IF (SIZE(p_viv) /= nn .OR. SIZE(p_drag) /= nn .OR. SIZE(p_damp) /= nn) THEN
+ CALL fail(ErrStat, ErrMsg, 'load power: the powers must have one entry per node')
+ RETURN
+ END IF
+ lk = MIN(LEN(ErrMsg), KERNEL_MSG_LEN)
+ DO e = 1, model%n_elem
+ CALL extract_element_state(model, e, model%q, model%v, idx, q2, v2)
+ IF (model%has_damping) THEN
+ CALL CD_Axial_Damping_Element_Force(q2(1:3), q2(4:6), v2(1:3), v2(4:6), model%l0(e), &
+ model%ba_dyn(e), f2, ErrStat, ErrMsg(1:lk), &
+ l0_dot=model%l0_dot(e), inputs_validated=.TRUE.)
+ IF (ErrStat /= 0) RETURN
+ CALL add_shares(p_damp)
+ END IF
+ IF (model%has_morison_drag) THEN
+ CALL extract_nodal_vector(model%fluid_velocity, model, e, fluid2)
+ CALL extract_nodal_scalar(model%drag_waterline_z, model, e, wl2)
+ CALL CD_Morison_Drag_Element_Force(q2(1:3), q2(4:6), v2(1:3), v2(4:6), model%l0(e), &
+ fluid2(:, 1), fluid2(:, 2), wl2(1), wl2(2), model%drag_rho, &
+ model%drag_diameter_elem(e), elem_cdn(model, e), &
+ model%drag_cdt_elem(e), f2, ErrStat, ErrMsg(1:lk), inputs_validated=.TRUE.)
+ IF (ErrStat /= 0) RETURN
+ CALL add_shares(p_drag)
+ END IF
+ END DO
+ IF (model%has_viv) THEN
+ DO nd = 2, nn - 1
+ IF (.NOT. model%viv_node(nd)) CYCLE
+ CALL viv_node_load(model, model%q, model%v, nd, .FALSE., fl, ok)
+ IF (.NOT. ok) THEN
+ CALL fail(ErrStat, ErrMsg, 'load power: the neighbours of a VIV node coincide (no line tangent)')
+ RETURN
+ END IF
+ p_viv(nd) = DOT_PRODUCT(fl, model%v(3*nd - 2:3*nd))
+ END DO
+ END IF
+ IF (.NOT. (CD_All_Finite(p_viv) .AND. CD_All_Finite(p_drag) .AND. CD_All_Finite(p_damp))) THEN
+ CALL fail(ErrStat, ErrMsg, 'load power: non-finite load power')
+ END IF
+
+ CONTAINS
+
+ SUBROUTINE add_shares(p)
+ !! The element force f2 on its two nodes times their velocities, half to each node.
+ REAL(wp), INTENT(INOUT) :: p(:)
+ INTEGER :: a, b
+ REAL(wp) :: pe
+ a = (idx(1) + 2)/3
+ b = (idx(4) + 2)/3
+ pe = 0.5_wp*DOT_PRODUCT(f2, v2)
+ p(a) = p(a) + pe
+ p(b) = p(b) + pe
+ END SUBROUTINE add_shares
+ END SUBROUTINE CD_Get_Model_Load_Power
+
+ PURE LOGICAL FUNCTION CD_Model_Has_VIV_Inline(model) RESULT(has)
+ !! True if the model carries the in-line VIV phase state (as well as the cross-flow one).
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ has = model%has_viv_il
+ END FUNCTION CD_Model_Has_VIV_Inline
+
+ SUBROUTINE viv_node_load(model, q, v, nd, in_step, force, ok, jac_v, jac_prev, jac_next)
+ !! The VIV load on interior node nd at (q, v): the cross-flow lift (CD_VIV_Node_Lift) and,
+ !! with in-line VIV, the in-line force (CD_VIV_Node_Inline), at the step's evaluation phases
+ !! (in_step) or the committed ones, with the smoothed node velocity; the residual Jacobians
+ !! with respect to that velocity and the two neighbour positions (all three or none).
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ REAL(wp), INTENT(IN) :: q(:), v(:)
+ INTEGER, INTENT(IN) :: nd
+ LOGICAL, INTENT(IN) :: in_step
+ REAL(wp), INTENT(OUT) :: force(3)
+ LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), INTENT(OUT), OPTIONAL :: jac_v(3, 3), jac_prev(3, 3), jac_next(3, 3)
+ REAL(wp) :: coef, coefx, coefh, uu(3), phi, fx(3), jv(3, 3), jp(3, 3), jn(3, 3)
+ INTEGER :: ia
+ LOGICAL :: il
+ il = .FALSE.
+ IF (model%has_viv_il) il = model%vil_node(nd)
+ IF (il) THEN
+ CALL viv_node_coef(model, q, nd, coef, uu, coefx, coefh)
+ ELSE
+ CALL viv_node_coef(model, q, nd, coef, uu)
+ END IF
+ ia = 3*nd - 2
+ phi = model%viv_phi(nd)
+ IF (in_step) phi = model%viv_phi_eval(nd)
+ IF (model%viv_wake) THEN
+ ! the wake lift: the scale times the wake variable q (held in the phase slot)
+ coef = coef*phi
+ phi = CD_ZERO
+ END IF
+ IF (PRESENT(jac_v)) THEN
+ CALL CD_VIV_Node_Lift(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coef, phi, force, ok, &
+ jac_v, jac_prev, jac_next)
+ ELSE
+ CALL CD_VIV_Node_Lift(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coef, phi, force, ok)
+ END IF
+ IF (.NOT. (ok .AND. il)) RETURN
+ phi = model%vil_phi(nd)
+ IF (in_step) phi = model%vil_phi_eval(nd)
+ IF (PRESENT(jac_v)) THEN
+ CALL CD_VIV_Node_Inline(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coefx, phi, fx, ok, jv, jp, jn)
+ jac_v = jac_v + jv
+ jac_prev = jac_prev + jp
+ jac_next = jac_next + jn
+ ELSE
+ CALL CD_VIV_Node_Inline(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coefx, phi, fx, ok)
+ END IF
+ force = force + fx
+ IF (.NOT. (ok .AND. coefh > CD_ZERO)) RETURN
+ ! the higher-harmonic force: the lift's form at the phase sum (Ulveseter et al. 2019, Eq. 6)
+ IF (in_step) THEN
+ phi = model%viv_phi_eval(nd) + model%vil_phi_eval(nd)
+ ELSE
+ phi = model%viv_phi(nd) + model%vil_phi(nd)
+ END IF
+ IF (PRESENT(jac_v)) THEN
+ CALL CD_VIV_Node_Lift(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coefh, phi, fx, ok, jv, jp, jn)
+ jac_v = jac_v + jv
+ jac_prev = jac_prev + jp
+ jac_next = jac_next + jn
+ ELSE
+ CALL CD_VIV_Node_Lift(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coefh, phi, fx, ok)
+ END IF
+ force = force + fx
+ END SUBROUTINE viv_node_load
+
PURE LOGICAL FUNCTION CD_Model_Has_VIV(model) RESULT(has)
!! True if the model carries the cross-flow VIV phase state.
TYPE(CD_ModelType), INTENT(IN) :: model
has = model%has_viv
END FUNCTION CD_Model_Has_VIV
- SUBROUTINE viv_node_coef(model, q, nd, coef, uu)
+ PURE INTEGER FUNCTION CD_Model_VIV_NMS(model) RESULT(n)
+ !! Rows of the VIV motion statistics of a node in the VIV state (CD_Get_Model_VIV_State ms):
+ !! CD_VIV_NMS_AMP with amplitude tables (the amplitude estimate after the mean squares) or the
+ !! wake filter (the filtered velocity in rows 3:5), CD_VIV_NMS_FRAME with the flow frame,
+ !! CD_VIV_NMS otherwise; on a synchronisation-model line one more, the step predictor (two
+ !! with in-line VIV; viv_pred_row), and one more with a stochastic band centre (viv_theta).
+ 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
+ END FUNCTION CD_Model_VIV_NMS
+
+ SUBROUTINE CD_Get_Model_VIV_Amplitude(model, amp, ErrStat, ErrMsg)
+ !! The smoothed cross-flow amplitude estimate of every node at the committed state [m]
+ !! (n_nodes; Thorsen et al. 2016, Eq. 9); zero on nodes without VIV and on a model without
+ !! amplitude tables.
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ REAL(wp), INTENT(OUT) :: amp(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ amp = CD_ZERO
+ ErrStat = CD_MODEL_OK
+ ErrMsg = ''
+ IF (.NOT. model%initialized) THEN
+ ErrStat = CD_MODEL_NOT_INITIALIZED
+ ErrMsg = 'CableDyn_Model: model is not initialized'
+ RETURN
+ END IF
+ IF (SIZE(amp) /= model%n_dof/3) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV amplitude output must have shape (n_nodes)')
+ RETURN
+ END IF
+ IF (.NOT. model%has_viv_amp) RETURN
+ amp = MERGE(model%viv_ms(5, :), CD_ZERO, model%viv_node)
+ END SUBROUTINE CD_Get_Model_VIV_Amplitude
+
+ PURE REAL(wp) FUNCTION viv_elem_amplitude(model, e) RESULT(y0)
+ !! The smoothed cross-flow amplitude of element e [m]: the mean over its VIV end nodes (zero
+ !! without amplitude tables or VIV nodes).
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ INTEGER :: k, n
+ y0 = CD_ZERO
+ IF (.NOT. model%has_viv_amp) RETURN
+ n = 0
+ DO k = e, e + 1
+ IF (.NOT. model%viv_node(k)) CYCLE
+ y0 = y0 + model%viv_ms(5, k)
+ n = n + 1
+ END DO
+ IF (n > 1) y0 = y0/REAL(n, wp)
+ END FUNCTION viv_elem_amplitude
+
+ PURE REAL(wp) FUNCTION viv_elem_cl(model, e) RESULT(cl)
+ !! The cross-flow coefficient of element e: its LINE TYPES Cl, or with an amplitude table the
+ !! table's C_v at the element's smoothed amplitude over its diameter.
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ INTEGER :: n
+ cl = model%viv_cl(e)
+ IF (.NOT. model%has_viv_amp) RETURN
+ n = model%viv_amp_n(e)
+ IF (n == 0) RETURN
+ cl = CD_VIV_Table(viv_elem_amplitude(model, e)/model%viv_d(e), model%viv_amp(1, 1:n, e), model%viv_amp(2, 1:n, e))
+ END FUNCTION viv_elem_cl
+
+ PURE REAL(wp) FUNCTION elem_cdn(model, e) RESULT(cdn)
+ !! The normal drag coefficient of element e: drag_cdn_elem, times the drag factor of its VIV
+ !! amplitude table at the element's smoothed amplitude where it has one.
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: e
+ INTEGER :: n
+ cdn = model%drag_cdn_elem(e)
+ IF (.NOT. model%has_viv_amp) RETURN
+ n = model%viv_amp_n(e)
+ IF (n == 0) RETURN
+ cdn = cdn*CD_VIV_Table(viv_elem_amplitude(model, e)/model%viv_d(e), model%viv_amp(1, 1:n, e), &
+ model%viv_amp(3, 1:n, e))
+ END FUNCTION elem_cdn
+
+ SUBROUTINE viv_node_coef(model, q, nd, coef, uu, coefx, coefh)
!! Lift scale of interior node nd at positions q, sum over its two elements of
!! (1/2 l0_e w_e)(1/2 rho D_e Cl_e) with w_e the wetted fraction under the drag waterline
- !! (as MoorDyn's 1/4 rho d Cl (F_i l_i + F_i+1 l_i+1)), and the ambient fluid velocity there.
+ !! (as MoorDyn's 1/4 rho d Cl (F_i l_i + F_i+1 l_i+1)), and the ambient fluid velocity there;
+ !! coefx (optional, in-line VIV) the same sum with the in-line coefficient C_x, and coefh
+ !! (optional, with coefx) with the higher-harmonic coefficient C_hh.
TYPE(CD_ModelType), INTENT(IN) :: model
REAL(wp), INTENT(IN) :: q(:)
INTEGER, INTENT(IN) :: nd
REAL(wp), INTENT(OUT) :: coef, uu(3)
+ REAL(wp), INTENT(OUT), OPTIONAL :: coefx, coefh
INTEGER :: e
REAL(wp) :: wla, wlb, frac
coef = CD_ZERO
+ IF (PRESENT(coefx)) coefx = CD_ZERO
+ IF (PRESENT(coefh)) coefh = CD_ZERO
DO e = nd - 1, nd
IF (.NOT. (model%viv_cl(e) > CD_ZERO)) CYCLE
wla = CD_ZERO
@@ -4162,91 +4933,351 @@ SUBROUTINE viv_node_coef(model, q, nd, coef, uu)
wlb = model%drag_waterline_z(e + 1)
END IF
CALL CD_Submerged_Fraction(q(3*e) - wla, q(3*e + 3) - wlb, frac)
- coef = coef + 0.25_wp*model%viv_rho*model%viv_d(e)*model%viv_cl(e)*model%l0(e)*frac
+ coef = coef + 0.25_wp*model%viv_rho*model%viv_d(e)*viv_elem_cl(model, e)*model%l0(e)*frac
+ IF (PRESENT(coefx)) coefx = coefx + 0.25_wp*model%viv_rho*model%viv_d(e)*model%vil_cx(e)*model%l0(e)*frac
+ IF (PRESENT(coefh)) coefh = coefh + 0.25_wp*model%viv_rho*model%viv_d(e)*model%vhh_cx(e)*model%l0(e)*frac
END DO
uu = CD_ZERO
IF (ALLOCATED(model%fluid_velocity)) uu = model%fluid_velocity(:, nd)
END SUBROUTINE viv_node_coef
+ PURE REAL(wp) FUNCTION viv_theta(model, nd) RESULT(theta)
+ !! Node nd's travelled non-dimensional distance of the stochastic band centre (the last row of
+ !! viv_ms; 0 without it).
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: nd
+ theta = CD_ZERO
+ IF (model%viv_sto) theta = model%viv_ms(SIZE(model%viv_ms, 1), nd)
+ END FUNCTION viv_theta
+
+ PURE REAL(wp) FUNCTION viv_centre(model, nd, theta) RESULT(centre)
+ !! Node nd's band centre: viv_cf(nd), or with a stochastic band centre its process at the
+ !! travelled distance theta (CD_VIV_Sto_Centre).
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: nd
+ REAL(wp), INTENT(IN) :: theta
+ INTEGER :: n
+ centre = model%viv_cf(nd)
+ IF (.NOT. model%viv_sto) RETURN
+ n = model%viv_sto_n(nd)
+ IF (n < 1) RETURN
+ centre = CD_VIV_Sto_Centre(model%viv_cf(nd), model%viv_sto_a(nd), model%viv_sto_f(1:n, nd), &
+ model%viv_sto_p(1:n, nd), theta)
+ END FUNCTION viv_centre
+
+ PURE INTEGER FUNCTION viv_pred_row(model) RESULT(r)
+ !! The row of viv_ms holding the step predictor (CableDyn_VIV): after the motion statistics on a
+ !! synchronisation-model line (the in-line rate in the row after it), row 2 on a wake line.
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ r = 2
+ 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
+
+ SUBROUTINE viv_seed_predictor(model)
+ !! The step predictor of a newly installed VIV model (row viv_pred_row of viv_ms, and of its
+ !! recovery and next copies): the phase rates at the present state, from the node's velocity and
+ !! committed acceleration and the mean squares at zero (MoorDyn's unnormalised start), and on a
+ !! wake line the cross-flow acceleration there. Only the first step predicts from it; every
+ !! step then leaves the rate at its own mid-point (viv_step_end).
+ TYPE(CD_ModelType), INTENT(INOUT) :: model
+ INTEGER :: nd, ia, ir
+ REAL(wp) :: coef, uu(3), yd, ydd, un, xd, xdd, vrel(3), urel(3)
+ LOGICAL :: ok
+ ir = viv_pred_row(model)
+ DO nd = 2, model%n_dof/3 - 1
+ IF (.NOT. model%viv_node(nd)) CYCLE
+ CALL viv_node_coef(model, model%q, nd, coef, uu)
+ ia = 3*nd - 2
+ vrel = smoothed(model%v, ia)
+ urel = uu
+ IF (frame_node(model, nd)) THEN
+ vrel = vrel - model%viv_ms(7:9, nd)
+ urel = uu - model%viv_ms(7:9, nd)
+ END IF
+ CALL CD_VIV_Crossflow_Motion(model%q(ia - 3:ia - 1), model%q(ia + 3:ia + 5), vrel, smoothed(model%a, ia), &
+ urel, yd, ydd, un, ok, xd, xdd)
+ IF (.NOT. (ok .AND. CD_Is_Finite(yd) .AND. CD_Is_Finite(ydd))) THEN
+ yd = CD_ZERO
+ ydd = CD_ZERO
+ xd = CD_ZERO
+ xdd = CD_ZERO
+ END IF
+ IF (model%viv_wake) THEN
+ model%viv_ms(ir, nd) = ydd
+ CYCLE
+ END IF
+ model%viv_ms(ir, nd) = CD_VIV_Phase_Rate(yd, ydd, CD_ZERO, CD_ZERO, model%viv_phi(nd), un, model%viv_dn(nd), &
+ viv_centre(model, nd, viv_theta(model, nd)), model%viv_df(nd), &
+ phi_rest=model%viv_phi_rest)
+ IF (.NOT. model%has_viv_il) CYCLE
+ IF (.NOT. model%vil_node(nd)) CYCLE
+ model%viv_ms(ir + 1, nd) = CD_VIV_Inline_Phase_Rate(xd, xdd, CD_ZERO, CD_ZERO, model%vil_phi(nd), &
+ model%viv_ms(ir, nd), model%vil_alpha(nd))
+ END DO
+ model%viv_ms_rollback = model%viv_ms
+ model%recovery_viv_ms = model%viv_ms
+ model%viv_ms_next = model%viv_ms
+ END SUBROUTINE viv_seed_predictor
+
SUBROUTINE viv_step_begin(model, dt, ErrStat, ErrMsg)
- !! Step-start VIV quantities from the committed state (q_n, v_n, a_n, phi_n): the mean
- !! squares with the step-start cross-flow sample (viv_ms_next), the phase rate
- !! (viv_rate), and the explicit phase the in-step lift uses (viv_phi_eval): at t_{n+1},
- !! phi_n + dt rate_n, under the force blend, whose in-step force is r(q_{n+1}, v_{n+1})
- !! (the committed-state force F_n keeps phi_n); at the generalised-alpha level,
- !! phi_n + (1 - alpha_f) dt rate_n, under the configuration blend.
+ !! Step-start VIV quantities from the committed state (q_n, v_n, phi_n and the step predictor,
+ !! the phase rate at the mid-point of the last step in row viv_pred_row of viv_ms): that rate
+ !! (viv_rate) and the explicit phase the in-step lift uses (viv_phi_eval): at t_{n+1},
+ !! phi_n + dt rate, under the force blend, whose in-step force is r(q_{n+1}, v_{n+1}) (the
+ !! committed-state force F_n keeps phi_n); at the generalised-alpha level, phi_n + (1 - alpha_f)
+ !! dt rate, under the configuration blend. The rate of the last step's mid-point is O(dt) off
+ !! the step's, so the predicted phase is O(dt^2) off. The committed acceleration is not
+ !! sampled: the generalised-alpha acceleration is the line's to O(dt) only (it is that of
+ !! t_n + (alpha_m - alpha_f) dt) and at rho_inf = 1 it carries an undamped alternating mode of
+ !! its own. On a wake line the wake state is predicted at the evaluation point under the last
+ !! step's mid-point acceleration (row 2) and the step-start wake frequency (viv_rate).
TYPE(CD_ModelType), INTENT(INOUT) :: model
REAL(wp), INTENT(IN) :: dt
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: nd, ia
- REAL(wp) :: w, alpha_f, yd, ydd, un, coef, uu(3)
+ INTEGER :: nd, ia, ir
+ REAL(wp) :: alpha_f, yd, ydd, un, coef, uu(3), sw(2)
LOGICAL :: ok
ErrStat = CD_MODEL_OK
ErrMsg = ''
CALL CD_Latch_Model_VIV_Window(model, dt)
- w = MIN(CD_ONE, dt/model%viv_tw)
+ ir = viv_pred_row(model)
alpha_f = model%cfg%rho_inf/(model%cfg%rho_inf + CD_ONE)
IF (model%cfg%force_blend) alpha_f = CD_ZERO
model%viv_rate = CD_ZERO
model%viv_ms_next = model%viv_ms
model%viv_phi_eval = model%viv_phi
+ IF (model%has_viv_il) THEN
+ model%vil_rate = CD_ZERO
+ model%vil_ms_next = model%vil_ms
+ model%vil_phi_eval = model%vil_phi
+ END IF
DO nd = 2, model%n_dof/3 - 1
IF (.NOT. model%viv_node(nd)) CYCLE
CALL viv_node_coef(model, model%q, nd, coef, uu)
ia = 3*nd - 2
- CALL CD_VIV_Crossflow_Motion(model%q(ia - 3:ia - 1), model%q(ia + 3:ia + 5), smoothed(model%v, ia), &
- smoothed(model%a, ia), uu, yd, ydd, un, ok)
+ ! the node tangent must exist at the step start
+ CALL CD_VIV_Crossflow_Motion(model%q(ia - 3:ia - 1), model%q(ia + 3:ia + 5), [CD_ZERO, CD_ZERO, CD_ZERO], &
+ [CD_ZERO, CD_ZERO, CD_ZERO], uu, yd, ydd, un, ok)
IF (.NOT. ok) THEN
CALL fail(ErrStat, ErrMsg, 'VIV phase: the neighbours of a node coincide (no line tangent)')
RETURN
END IF
- model%viv_ms_next(1, nd) = CD_VIV_Mean_Square(model%viv_ms(1, nd), yd, w)
- model%viv_ms_next(2, nd) = CD_VIV_Mean_Square(model%viv_ms(2, nd), ydd, w)
- model%viv_rate(nd) = CD_VIV_Phase_Rate(yd, ydd, model%viv_ms_next(1, nd), model%viv_ms_next(2, nd), &
- model%viv_phi(nd), un, model%viv_dn(nd), model%viv_cf(nd), &
- model%viv_df(nd), phi_rest=model%viv_phi_rest)
+ IF (model%viv_wake) THEN
+ ! the wake frequency of the ambient flow normal to the line (the free stream of the
+ ! paper), not of the relative flow, which the line's own cross-flow motion modulates
+ IF (model%wo_filter) THEN
+ ! with the wake filter, of the flow relative to the node's slowly filtered motion
+ IF (model%wo_tf(nd) > CD_ZERO) uu = uu - model%viv_ms(3:5, nd)
+ END IF
+ model%viv_rate(nd) = CD_VIV_TWO_PI*model%wo_st(nd)*viv_node_ambient_speed(model%q, ia, uu)/model%viv_dn(nd)
+ sw = [model%viv_phi(nd), model%viv_ms(1, nd)]
+ CALL CD_VIV_Wake_Advance(sw, model%viv_rate(nd), model%wo_eps(nd), model%wo_a(nd)/model%viv_dn(nd), &
+ model%viv_ms(ir, nd), model%viv_ms(ir, nd), (CD_ONE - alpha_f)*dt)
+ model%viv_phi_eval(nd) = sw(1)
+ CYCLE
+ END IF
+ model%viv_rate(nd) = model%viv_ms(ir, nd)
model%viv_phi_eval(nd) = model%viv_phi(nd) + (CD_ONE - alpha_f)*dt*model%viv_rate(nd)
+ IF (.NOT. model%has_viv_il) CYCLE
+ IF (.NOT. model%vil_node(nd)) CYCLE
+ model%vil_rate(nd) = model%viv_ms(ir + 1, nd)
+ model%vil_phi_eval(nd) = model%vil_phi(nd) + (CD_ONE - alpha_f)*dt*model%vil_rate(nd)
END DO
END SUBROUTINE viv_step_begin
SUBROUTINE viv_step_end(model, dt, ErrStat, ErrMsg)
- !! End-of-step VIV phase by Heun's rule (the trapezoidal corrector of the explicit Euler
- !! predictor): phi_n+1 = phi_n + dt/2 (rate_n + rate(state_n+1, phi_n + dt rate_n)), with
- !! the end-state cross-flow sample added to the mean squares for that rate (not stored:
- !! the next step adds it itself). Writes viv_phi_next only.
+ !! End-of-step VIV state from the step-start state (q, v) and the converged end state (q_step,
+ !! v_step), into viv_phi_next and viv_ms_next. The phase advances by the implicit mid-point
+ !! rule, solved by one fixed-point pass from the step predictor rate_p,
+ !!
+ !! rate_1 = rate(y'_m, y''_m, ms_m, phi_n + dt/2 rate_p),
+ !! phi_n+1 = phi_n + dt rate(y'_m, y''_m, ms_m, phi_n + dt/2 rate_1),
+ !!
+ !! on the node's cross-flow motion at the step's mid-point: the mean position, the velocity
+ !! (q_n+1 - q_n)/dt and the acceleration (v_n+1 - v_n)/dt, the step means of the velocity and of
+ !! its derivative (that of the mid-point to O(dt^2) at any rho_inf, and free of the committed
+ !! acceleration's lag and alternating mode). The mean squares advance by the
+ !! mid-point rule as well (the exact average of the mid-point sample over dt, and over dt/2 for
+ !! the mid-point rate), and the filtered velocities of the flow frame and the wake filter
+ !! exactly for the velocity linear over the step. The mid-point rate becomes the next step's
+ !! predictor. On a wake line the wake state advances under the mid-point acceleration (held
+ !! over the step, its integral exact) at the mean of the start and end wake frequencies, and
+ !! that acceleration becomes the predictor.
TYPE(CD_ModelType), INTENT(INOUT) :: model
REAL(wp), INTENT(IN) :: dt
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: nd, ia
- REAL(wp) :: w, yd, ydd, un, coef, uu(3), ms1, ms2, rate_end
+ INTEGER :: nd, ia, ir, ip
+ REAL(wp) :: wf, wh, yd, ydd, un, coef, uu(3), ms1, ms2, rate_mid, xd, xdd, rate_mid_x, st(4), sw(2), ap
+ REAL(wp) :: vs0(3), vs1(3), vf(3), qm(9), om, th, dth, cfm
LOGICAL :: ok
ErrStat = CD_MODEL_OK
ErrMsg = ''
- w = MIN(CD_ONE, dt/model%viv_tw)
+ ir = viv_pred_row(model)
+ wf = CD_VIV_Mean_Square_Weight(dt/model%viv_tw)
+ wh = CD_VIV_Mean_Square_Weight(0.5_wp*dt/model%viv_tw)
model%viv_phi_next = model%viv_phi
+ IF (model%has_viv_il) model%vil_phi_next = model%vil_phi
DO nd = 2, model%n_dof/3 - 1
IF (.NOT. model%viv_node(nd)) CYCLE
CALL viv_node_coef(model, model%q_step, nd, coef, uu)
ia = 3*nd - 2
- CALL CD_VIV_Crossflow_Motion(model%q_step(ia - 3:ia - 1), model%q_step(ia + 3:ia + 5), &
- smoothed(model%v_step, ia), smoothed(model%a_step, ia), uu, yd, ydd, un, ok)
+ vs0 = smoothed(model%v, ia)
+ vs1 = smoothed(model%v_step, ia)
+ ! the flow frame's velocity at the mid-point: the filtered velocity at the step end (exact for
+ ! the first-order filter of the velocity linear over the step; a non-finite end velocity
+ ! keeps it) averaged with the step-start one
+ vf = CD_ZERO
+ IF (frame_node(model, nd)) THEN
+ 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,
+ ! (q_n+1 - q_n)/dt and (v_n+1 - v_n)/dt, the step means of the velocity and of its
+ ! derivative, so a harmonic motion keeps its phase between them exactly
+ qm = 0.5_wp*(model%q(ia - 3:ia + 5) + model%q_step(ia - 3:ia + 5))
+ CALL CD_VIV_Crossflow_Motion(qm(1:3), qm(7:9), (smoothed(model%q_step, ia) - smoothed(model%q, ia))/dt - vf, &
+ (vs1 - vs0)/dt, uu - vf, yd, ydd, un, ok, xd, xdd)
+ IF (model%viv_wake) THEN
+ ! the mid-point acceleration (the predictor's where the mid-point tangent is degenerate or
+ ! the acceleration not finite)
+ ap = model%viv_ms(ir, nd)
+ IF (.NOT. (ok .AND. CD_Is_Finite(ydd))) ydd = ap
+ ! the filtered velocity at the step end, exact for the velocity linear over the step (a
+ ! non-finite end velocity keeps it), and the wake frequency there
+ om = model%viv_rate(nd)
+ IF (model%wo_filter) THEN
+ IF (model%wo_tf(nd) > CD_ZERO .AND. CD_All_Finite(vs1)) &
+ model%viv_ms_next(3:5, nd) = CD_VIV_Filter_Linear(model%viv_ms(3:5, nd), vs0, vs1, dt/model%wo_tf(nd))
+ IF (model%wo_tf(nd) > CD_ZERO) uu = uu - model%viv_ms_next(3:5, nd)
+ END IF
+ om = 0.5_wp*(om + CD_VIV_TWO_PI*model%wo_st(nd)*viv_node_ambient_speed(model%q_step, ia, uu)/model%viv_dn(nd))
+ IF (.NOT. CD_Is_Finite(om)) om = model%viv_rate(nd)
+ sw = [model%viv_phi(nd), model%viv_ms(1, nd)]
+ CALL CD_VIV_Wake_Advance(sw, om, model%wo_eps(nd), model%wo_a(nd)/model%viv_dn(nd), ydd, ydd, dt)
+ IF (.NOT. (CD_Is_Finite(sw(1)) .AND. CD_Is_Finite(sw(2)))) THEN
+ ! a non-finite result keeps the step-start frequency and the predictor's forcing
+ ydd = ap
+ sw = [model%viv_phi(nd), model%viv_ms(1, nd)]
+ CALL CD_VIV_Wake_Advance(sw, model%viv_rate(nd), model%wo_eps(nd), model%wo_a(nd)/model%viv_dn(nd), &
+ ydd, ydd, dt)
+ END IF
+ model%viv_phi_next(nd) = sw(1)
+ model%viv_ms_next(1, nd) = sw(2)
+ model%viv_ms_next(ir, nd) = ydd
+ CYCLE
+ END IF
IF (.NOT. ok) THEN
CALL fail(ErrStat, ErrMsg, 'VIV phase: the neighbours of a node coincide (no line tangent)')
RETURN
END IF
- ms1 = CD_VIV_Mean_Square(model%viv_ms_next(1, nd), yd, w)
- ms2 = CD_VIV_Mean_Square(model%viv_ms_next(2, nd), ydd, w)
- rate_end = CD_VIV_Phase_Rate(yd, ydd, ms1, ms2, model%viv_phi(nd) + dt*model%viv_rate(nd), un, &
- model%viv_dn(nd), model%viv_cf(nd), model%viv_df(nd), phi_rest=model%viv_phi_rest)
- model%viv_phi_next(nd) = CD_VIV_Wrap_Phase(model%viv_phi(nd) + 0.5_wp*dt*(model%viv_rate(nd) + rate_end))
+ IF (model%has_viv_amp) THEN
+ ! the amplitude estimate over the step, from the committed one (repeatable), on the
+ ! cross-flow velocity across the ambient flow; with the flow frame, the velocity and the
+ ! flow both relative to the step-start filtered velocity
+ st = model%viv_ms(3:6, nd)
+ IF (frame_node(model, nd)) THEN
+ CALL CD_VIV_Amplitude_Update(st, CD_VIV_Ambient_Crossflow_Rate(model%q_step(ia + 3:ia + 5) - &
+ model%q_step(ia - 3:ia - 1), &
+ vs1 - model%viv_ms(7:9, nd), &
+ uu - model%viv_ms(7:9, nd)), dt)
+ ELSE
+ CALL CD_VIV_Amplitude_Update(st, CD_VIV_Ambient_Crossflow_Rate(model%q_step(ia + 3:ia + 5) - &
+ model%q_step(ia - 3:ia - 1), vs1, uu), dt)
+ END IF
+ model%viv_ms_next(3:6, nd) = st
+ END IF
+ ! the stochastic band centre at the mid-point of the travelled distance, which moves on with the
+ ! step's shedding speed
+ th = viv_theta(model, nd)
+ dth = CD_ZERO
+ IF (model%viv_sto) THEN
+ dth = dt*un/model%viv_dn(nd)
+ IF (.NOT. CD_Is_Finite(dth)) dth = CD_ZERO
+ model%viv_ms_next(SIZE(model%viv_ms, 1), nd) = th + dth
+ END IF
+ cfm = viv_centre(model, nd, th + 0.5_wp*dth)
+ ms1 = CD_VIV_Mean_Square(model%viv_ms(1, nd), yd, wh)
+ ms2 = CD_VIV_Mean_Square(model%viv_ms(2, nd), ydd, wh)
+ ! the implicit mid-point rule by one fixed-point pass: the mid-point phase from the predictor,
+ ! then from the rate it gives
+ rate_mid = model%viv_rate(nd)
+ DO ip = 1, 2
+ rate_mid = CD_VIV_Phase_Rate(yd, ydd, ms1, ms2, model%viv_phi(nd) + 0.5_wp*dt*rate_mid, un, &
+ model%viv_dn(nd), cfm, model%viv_df(nd), phi_rest=model%viv_phi_rest)
+ END DO
+ model%viv_ms_next(1, nd) = CD_VIV_Mean_Square(model%viv_ms(1, nd), yd, wf)
+ model%viv_ms_next(2, nd) = CD_VIV_Mean_Square(model%viv_ms(2, nd), ydd, wf)
+ model%viv_ms_next(ir, nd) = rate_mid
+ model%viv_phi_next(nd) = CD_VIV_Wrap_Phase(model%viv_phi(nd) + dt*rate_mid)
+ IF (.NOT. model%has_viv_il) CYCLE
+ IF (.NOT. model%vil_node(nd)) CYCLE
+ ! the in-line rate at the mid-point is slaved to the mid-point cross-flow rate (Eq. 6)
+ ms1 = CD_VIV_Mean_Square(model%vil_ms(1, nd), xd, wh)
+ ms2 = CD_VIV_Mean_Square(model%vil_ms(2, nd), xdd, wh)
+ rate_mid_x = model%vil_rate(nd)
+ DO ip = 1, 2
+ rate_mid_x = CD_VIV_Inline_Phase_Rate(xd, xdd, ms1, ms2, model%vil_phi(nd) + 0.5_wp*dt*rate_mid_x, rate_mid, &
+ model%vil_alpha(nd))
+ END DO
+ model%vil_ms_next(1, nd) = CD_VIV_Mean_Square(model%vil_ms(1, nd), xd, wf)
+ model%vil_ms_next(2, nd) = CD_VIV_Mean_Square(model%vil_ms(2, nd), xdd, wf)
+ model%viv_ms_next(ir + 1, nd) = rate_mid_x
+ model%vil_phi_next(nd) = CD_VIV_Wrap_Phase(model%vil_phi(nd) + dt*rate_mid_x)
END DO
- IF (.NOT. CD_All_Finite(model%viv_phi_next)) THEN
+ IF (model%viv_wake) THEN
+ IF (.NOT. (CD_All_Finite(model%viv_phi_next) .AND. CD_All_Finite(model%viv_ms_next))) THEN
+ CALL fail(ErrStat, ErrMsg, 'VIV wake oscillator update produced a non-finite state')
+ END IF
+ RETURN
+ END IF
+ IF (.NOT. (CD_All_Finite(model%viv_phi_next) .AND. CD_All_Finite(model%viv_ms_next))) THEN
CALL fail(ErrStat, ErrMsg, 'VIV phase update produced a non-finite phase')
END IF
+ IF (model%has_viv_il) THEN
+ IF (.NOT. (CD_All_Finite(model%vil_phi_next) .AND. CD_All_Finite(model%vil_ms_next))) THEN
+ CALL fail(ErrStat, ErrMsg, 'in-line VIV phase update produced a non-finite phase')
+ END IF
+ END IF
END SUBROUTINE viv_step_end
+ PURE LOGICAL FUNCTION frame_node(model, nd) RESULT(on)
+ !! Node nd takes the flow frame of the synchronisation model (viv_frame, viv_ftf(nd) > 0).
+ TYPE(CD_ModelType), INTENT(IN) :: model
+ INTEGER, INTENT(IN) :: nd
+ on = .FALSE.
+ IF (.NOT. model%viv_frame) RETURN
+ on = model%viv_ftf(nd) > CD_ZERO
+ END FUNCTION frame_node
+
+ PURE REAL(wp) FUNCTION viv_node_ambient_speed(q, ia, uu) RESULT(ua)
+ !! Speed of the ambient flow uu normal to the tangent of the node whose x component is ia (the
+ !! chord of its two neighbours at positions q); 0 for a degenerate tangent.
+ REAL(wp), INTENT(IN) :: q(:), uu(3)
+ INTEGER, INTENT(IN) :: ia
+ REAL(wp) :: yd, ydd
+ LOGICAL :: ok
+ CALL CD_VIV_Crossflow_Motion(q(ia - 3:ia - 1), q(ia + 3:ia + 5), [CD_ZERO, CD_ZERO, CD_ZERO], &
+ [CD_ZERO, CD_ZERO, CD_ZERO], uu, yd, ydd, ua, ok)
+ IF (.NOT. ok) ua = CD_ZERO
+ END FUNCTION viv_node_ambient_speed
+
PURE FUNCTION smoothed(x, ia) RESULT(xs)
!! Node kinematics for the VIV phase and lift: the node value averaged with its two
!! neighbours, (x_{i-1} + 2 x_i + x_{i+1})/4, at the node whose x component is ia. Thorsen's
@@ -4282,6 +5313,35 @@ SUBROUTINE clear_viv(model)
IF (ALLOCATED(model%viv_rate)) DEALLOCATE (model%viv_rate)
IF (ALLOCATED(model%viv_ms_next)) DEALLOCATE (model%viv_ms_next)
IF (ALLOCATED(model%viv_phi_next)) DEALLOCATE (model%viv_phi_next)
+ IF (ALLOCATED(model%vil_cx)) DEALLOCATE (model%vil_cx)
+ IF (ALLOCATED(model%vhh_cx)) DEALLOCATE (model%vhh_cx)
+ IF (ALLOCATED(model%vil_alpha)) DEALLOCATE (model%vil_alpha)
+ IF (ALLOCATED(model%vil_node)) DEALLOCATE (model%vil_node)
+ IF (ALLOCATED(model%vil_phi)) DEALLOCATE (model%vil_phi)
+ IF (ALLOCATED(model%vil_ms)) DEALLOCATE (model%vil_ms)
+ IF (ALLOCATED(model%vil_phi_rollback)) DEALLOCATE (model%vil_phi_rollback)
+ IF (ALLOCATED(model%vil_ms_rollback)) DEALLOCATE (model%vil_ms_rollback)
+ IF (ALLOCATED(model%recovery_vil_phi)) DEALLOCATE (model%recovery_vil_phi)
+ IF (ALLOCATED(model%recovery_vil_ms)) DEALLOCATE (model%recovery_vil_ms)
+ IF (ALLOCATED(model%vil_phi_eval)) DEALLOCATE (model%vil_phi_eval)
+ IF (ALLOCATED(model%vil_rate)) DEALLOCATE (model%vil_rate)
+ IF (ALLOCATED(model%vil_ms_next)) DEALLOCATE (model%vil_ms_next)
+ IF (ALLOCATED(model%vil_phi_next)) DEALLOCATE (model%vil_phi_next)
+ IF (ALLOCATED(model%viv_amp)) DEALLOCATE (model%viv_amp)
+ IF (ALLOCATED(model%viv_amp_n)) DEALLOCATE (model%viv_amp_n)
+ IF (ALLOCATED(model%wo_st)) DEALLOCATE (model%wo_st)
+ IF (ALLOCATED(model%wo_eps)) DEALLOCATE (model%wo_eps)
+ IF (ALLOCATED(model%wo_a)) DEALLOCATE (model%wo_a)
+ IF (ALLOCATED(model%wo_tf)) DEALLOCATE (model%wo_tf)
+ IF (ALLOCATED(model%viv_ftf)) DEALLOCATE (model%viv_ftf)
+ 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.
+ model%has_viv_il = .FALSE.
model%has_viv = .FALSE.
model%viv_rho = CD_ZERO
model%viv_tw = CD_ZERO
@@ -7040,6 +8100,63 @@ SUBROUTINE CD_Copy_Model(src, dst, ErrStat, ErrMsg)
IF (ErrStat /= CD_MODEL_OK) RETURN
CALL copy_real1(src%viv_phi_next, work%viv_phi_next, 'viv_phi_next', ErrStat, ErrMsg)
IF (ErrStat /= CD_MODEL_OK) RETURN
+ work%viv_wake = src%viv_wake
+ CALL copy_real1(src%wo_st, work%wo_st, 'wo_st', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%wo_eps, work%wo_eps, 'wo_eps', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%wo_a, work%wo_a, 'wo_a', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%wo_tf, work%wo_tf, 'wo_tf', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%viv_ftf, work%viv_ftf, 'viv_ftf', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%viv_sto_a, work%viv_sto_a, 'viv_sto_a', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real2(src%viv_sto_f, work%viv_sto_f, 'viv_sto_f', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real2(src%viv_sto_p, work%viv_sto_p, 'viv_sto_p', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_int1(src%viv_sto_n, work%viv_sto_n, 'viv_sto_n', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ 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
+ CALL copy_int1(src%viv_amp_n, work%viv_amp_n, 'viv_amp_n', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ work%has_viv_il = src%has_viv_il
+ CALL copy_real1(src%vil_cx, work%vil_cx, 'vil_cx', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%vhh_cx, work%vhh_cx, 'vhh_cx', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%vil_alpha, work%vil_alpha, 'vil_alpha', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_logical1(src%vil_node, work%vil_node, 'vil_node', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%vil_phi, work%vil_phi, 'vil_phi', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real2(src%vil_ms, work%vil_ms, 'vil_ms', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%vil_phi_rollback, work%vil_phi_rollback, 'vil_phi_rollback', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real2(src%vil_ms_rollback, work%vil_ms_rollback, 'vil_ms_rollback', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%recovery_vil_phi, work%recovery_vil_phi, 'recovery_vil_phi', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real2(src%recovery_vil_ms, work%recovery_vil_ms, 'recovery_vil_ms', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%vil_phi_eval, work%vil_phi_eval, 'vil_phi_eval', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%vil_rate, work%vil_rate, 'vil_rate', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real2(src%vil_ms_next, work%vil_ms_next, 'vil_ms_next', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
+ CALL copy_real1(src%vil_phi_next, work%vil_phi_next, 'vil_phi_next', ErrStat, ErrMsg)
+ IF (ErrStat /= CD_MODEL_OK) RETURN
work%initialized = src%initialized
! Commit: release the caller's previous model, then move the fully-built copy in component by
@@ -7196,6 +8313,38 @@ SUBROUTINE commit_model_copy(from, to)
CALL MOVE_ALLOC(from%viv_rate, to%viv_rate)
CALL MOVE_ALLOC(from%viv_ms_next, to%viv_ms_next)
CALL MOVE_ALLOC(from%viv_phi_next, to%viv_phi_next)
+ to%viv_wake = from%viv_wake
+ CALL MOVE_ALLOC(from%wo_st, to%wo_st)
+ CALL MOVE_ALLOC(from%wo_eps, to%wo_eps)
+ CALL MOVE_ALLOC(from%wo_a, to%wo_a)
+ 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)
+ CALL MOVE_ALLOC(from%viv_sto_n, to%viv_sto_n)
+ to%viv_sto = from%viv_sto
+ to%wo_filter = from%wo_filter
+ to%has_viv_amp = from%has_viv_amp
+ CALL MOVE_ALLOC(from%viv_amp, to%viv_amp)
+ CALL MOVE_ALLOC(from%viv_amp_n, to%viv_amp_n)
+ to%has_viv_il = from%has_viv_il
+ CALL MOVE_ALLOC(from%vil_cx, to%vil_cx)
+ CALL MOVE_ALLOC(from%vhh_cx, to%vhh_cx)
+ CALL MOVE_ALLOC(from%vil_alpha, to%vil_alpha)
+ CALL MOVE_ALLOC(from%vil_node, to%vil_node)
+ CALL MOVE_ALLOC(from%vil_phi, to%vil_phi)
+ CALL MOVE_ALLOC(from%vil_ms, to%vil_ms)
+ CALL MOVE_ALLOC(from%vil_phi_rollback, to%vil_phi_rollback)
+ CALL MOVE_ALLOC(from%vil_ms_rollback, to%vil_ms_rollback)
+ CALL MOVE_ALLOC(from%recovery_vil_phi, to%recovery_vil_phi)
+ CALL MOVE_ALLOC(from%recovery_vil_ms, to%recovery_vil_ms)
+ CALL MOVE_ALLOC(from%vil_phi_eval, to%vil_phi_eval)
+ CALL MOVE_ALLOC(from%vil_rate, to%vil_rate)
+ CALL MOVE_ALLOC(from%vil_ms_next, to%vil_ms_next)
+ CALL MOVE_ALLOC(from%vil_phi_next, to%vil_phi_next)
IF (from%has_bathymetry) THEN
to%bathymetry%nx = from%bathymetry%nx
@@ -7325,6 +8474,22 @@ SUBROUTINE copy_real2(src, dst, label, ErrStat, ErrMsg)
IF (istat /= 0) CALL copy_alloc_fail(label, ErrStat, ErrMsg)
END SUBROUTINE copy_real2
+ SUBROUTINE copy_real3(src, dst, label, ErrStat, ErrMsg)
+ REAL(wp), ALLOCATABLE, INTENT(IN) :: src(:, :, :)
+ REAL(wp), ALLOCATABLE, INTENT(INOUT) :: dst(:, :, :)
+ CHARACTER(*), INTENT(IN) :: label
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+
+ INTEGER :: istat
+
+ ErrStat = CD_MODEL_OK
+ ErrMsg = ''
+ IF (.NOT. ALLOCATED(src)) RETURN
+ ALLOCATE (dst(SIZE(src, 1), SIZE(src, 2), SIZE(src, 3)), SOURCE=src, STAT=istat)
+ IF (istat /= 0) CALL copy_alloc_fail(label, ErrStat, ErrMsg)
+ END SUBROUTINE copy_real3
+
SUBROUTINE copy_alloc_fail(label, ErrStat, ErrMsg)
CHARACTER(*), INTENT(IN) :: label
INTEGER, INTENT(OUT) :: ErrStat
@@ -7842,16 +9007,14 @@ SUBROUTINE model_contributor_load(model, q, v, force, jac_q, jac_v, ErrStat, Err
IF (model%has_viv) THEN
BLOCK
INTEGER :: nd, ia
- REAL(wp) :: fl(3), jv3(3, 3), jp3(3, 3), jn3(3, 3), coef, uu(3)
+ REAL(wp) :: fl(3), jv3(3, 3), jp3(3, 3), jn3(3, 3)
LOGICAL :: ok
DO nd = 2, SIZE(q)/3 - 1
IF (.NOT. model%viv_node(nd)) CYCLE
- CALL viv_node_coef(model, q, nd, coef, uu)
ia = 3*nd - 2
- CALL CD_VIV_Node_Lift(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coef, &
- model%viv_phi_eval(nd), fl, ok, jv3, jp3, jn3)
+ CALL viv_node_load(model, q, v, nd, .TRUE., fl, ok, jv3, jp3, jn3)
IF (.NOT. ok) THEN
- CALL fail(ErrStat, ErrMsg, 'VIV lift: the neighbours of a node coincide (no line tangent)')
+ CALL fail(ErrStat, ErrMsg, 'VIV load: the neighbours of a node coincide (no line tangent)')
RETURN
END IF
force(ia:ia + 2) = force(ia:ia + 2) + fl
@@ -8115,7 +9278,7 @@ SUBROUTINE model_contributor_load_banded(model, q, v, free, kl, ku, force, jac_q
CALL extract_nodal_scalar(model%drag_waterline_z, model, e, wl2)
CALL CD_Morison_Drag_Element_Load(q2(1:3), q2(4:6), v2(1:3), v2(4:6), model%l0(e), &
fluid2(:, 1), fluid2(:, 2), wl2(1), wl2(2), model%drag_rho, &
- model%drag_diameter_elem(e), model%drag_cdn_elem(e), &
+ model%drag_diameter_elem(e), elem_cdn(model, e), &
model%drag_cdt_elem(e), f2, jq2, jv2, ErrStat, ErrMsg(1:lk), &
inputs_validated=.TRUE.)
IF (ErrStat /= 0) RETURN
@@ -8161,16 +9324,14 @@ SUBROUTINE model_contributor_load_banded(model, q, v, free, kl, ku, force, jac_q
! and the position Jacobian through the node tangent (the two neighbours)
BLOCK
INTEGER :: nd, ia, ra, cb
- REAL(wp) :: fl(3), jv3(3, 3), jp3(3, 3), jn3(3, 3), coef, uu(3)
+ REAL(wp) :: fl(3), jv3(3, 3), jp3(3, 3), jn3(3, 3)
LOGICAL :: ok
DO nd = 2, n/3 - 1
IF (.NOT. model%viv_node(nd)) CYCLE
- CALL viv_node_coef(model, q, nd, coef, uu)
ia = 3*nd - 2
- CALL CD_VIV_Node_Lift(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coef, &
- model%viv_phi_eval(nd), fl, ok, jv3, jp3, jn3)
+ CALL viv_node_load(model, q, v, nd, .TRUE., fl, ok, jv3, jp3, jn3)
IF (.NOT. ok) THEN
- CALL fail(ErrStat, ErrMsg, 'VIV lift: the neighbours of a node coincide (no line tangent)')
+ CALL fail(ErrStat, ErrMsg, 'VIV load: the neighbours of a node coincide (no line tangent)')
RETURN
END IF
force(ia:ia + 2) = force(ia:ia + 2) + fl
@@ -8384,7 +9545,7 @@ SUBROUTINE model_contributor_force(model, q, v, force, ErrStat, ErrMsg, end_node
CALL extract_nodal_scalar(model%drag_waterline_z, model, e, wl2)
CALL CD_Morison_Drag_Element_Force(q2(1:3), q2(4:6), v2(1:3), v2(4:6), model%l0(e), &
fluid2(:, 1), fluid2(:, 2), wl2(1), wl2(2), model%drag_rho, &
- model%drag_diameter_elem(e), model%drag_cdn_elem(e), &
+ model%drag_diameter_elem(e), elem_cdn(model, e), &
model%drag_cdt_elem(e), f2, ErrStat, ErrMsg(1:lk), inputs_validated=.TRUE.)
IF (ErrStat /= 0) RETURN
CALL scatter_element_vector(force, idx, f2)
@@ -8413,16 +9574,14 @@ SUBROUTINE model_contributor_force(model, q, v, force, ErrStat, ErrMsg, end_node
IF (model%has_viv .AND. .NOT. ends) THEN
BLOCK
INTEGER :: nd, ia
- REAL(wp) :: fl(3), coef, uu(3)
+ REAL(wp) :: fl(3)
LOGICAL :: ok
DO nd = 2, nn - 1
IF (.NOT. model%viv_node(nd)) CYCLE
- CALL viv_node_coef(model, q, nd, coef, uu)
ia = 3*nd - 2
- CALL CD_VIV_Node_Lift(q(ia - 3:ia - 1), q(ia + 3:ia + 5), smoothed(v, ia), uu, coef, &
- model%viv_phi_eval(nd), fl, ok)
+ CALL viv_node_load(model, q, v, nd, .TRUE., fl, ok)
IF (.NOT. ok) THEN
- CALL fail(ErrStat, ErrMsg, 'VIV lift: the neighbours of a node coincide (no line tangent)')
+ CALL fail(ErrStat, ErrMsg, 'VIV load: the neighbours of a node coincide (no line tangent)')
RETURN
END IF
force(ia:ia + 2) = force(ia:ia + 2) + fl
@@ -8953,7 +10112,7 @@ SUBROUTINE model_morison_drag_load(model, q, v, force, jac_q, jac_v, ErrStat, Er
CALL extract_nodal_scalar(model%drag_waterline_z, model, e, wl2)
l02(1) = model%l0(e)
CALL CD_Cable_Morison_Drag_Load(q2, v2, conn1, l02, fluid2, wl2, model%drag_rho, &
- model%drag_diameter_elem(e), model%drag_cdn_elem(e), &
+ model%drag_diameter_elem(e), elem_cdn(model, e), &
model%drag_cdt_elem(e), f2, jq2, jv2, ErrStat, ErrMsg)
IF (ErrStat /= 0) RETURN
CALL scatter_element_vector(force, idx, f2)
diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90
index 0b965d12..d7384dc6 100644
--- a/src/CableDyn_OpenFAST_Aggregate.f90
+++ b/src/CableDyn_OpenFAST_Aggregate.f90
@@ -66,7 +66,7 @@ MODULE CableDyn_OpenFAST_Aggregate
USE CableDyn_Model, ONLY: CD_ModelControlSaveType, CD_Recompute_Model_Acceleration, CD_MODEL_OK
USE CableDyn_DeckDriver, ONLY: CD_DeckAggregateType, CD_Init_Deck_Aggregate, CD_End_Deck_Aggregate, &
CD_DECKDRV_OK, CD_DECKDRV_BADINPUT, CD_Eval_Aggregate_Channel, &
- CD_Cable_Deck_Node, &
+ CD_ChannelRow, CD_Channel_Row_Reset, CD_Cable_Deck_Node, &
CD_Channel_Unit, CD_DECK_NAMELEN, CD_LineInitSummary, &
DeckFailure, DeckLine, DeckPoint, CD_Fire_Deck_Failures, &
CD_Replay_Deck_Failures, CD_Check_System_Plausibility, &
@@ -138,7 +138,7 @@ MODULE CableDyn_OpenFAST_Aggregate
! channel count/header/unit for registration, and the per-channel evaluator for CalcOutput.
PUBLIC :: CD_AGG_NumChannels
PUBLIC :: CD_AGG_ChannelHeader
- PUBLIC :: CD_AGG_EvalChannel
+ PUBLIC :: CD_AGG_EvalChannel, CD_AGG_EvalChannels
PUBLIC :: CD_AGG_WriteStaticProfile
! Range graphs of the LINES flag r: the standalone mixed route and the single-turbine OpenFAST
! module sample and write them; the accumulated state rides a host's checkpoint
@@ -166,6 +166,9 @@ MODULE CableDyn_OpenFAST_Aggregate
! Deck OPTION predictLoads: the OpenFAST shell extrapolates the coupled loads between
! supercycled solves (TRUE) or holds the last solve's (FALSE)
LOGICAL :: predict_loads = .TRUE.
+ ! Deck OPTION CDOutDt [s]: the OpenFAST shell writes a .CD.out row at every whole multiple
+ ! of it (a whole multiple of the CableDyn step); 0 writes one after every committed step
+ REAL(wp) :: cd_out_dt = CD_ZERO
! Deck OPTION maxStrain: the per-step plausibility bound on the EI=0 system lines.
REAL(wp) :: max_strain = 0.5_wp
INTEGER :: ncp_sys = 0 ! moving points owned by sys
@@ -229,6 +232,9 @@ MODULE CableDyn_OpenFAST_Aggregate
CHARACTER(10), ALLOCATABLE :: chan_units(:)
LOGICAL, ALLOCATABLE :: line_is_cable(:)
INTEGER, ALLOCATABLE :: line_obj_index(:)
+ ! the line-wide values the channels of one CD_AGG_EvalChannels row share per cable (twists,
+ ! torques, load powers, section curvature, VIV amplitude); cleared at the start of every row
+ TYPE(CD_ChannelRow), ALLOCATABLE :: chan_rows(:)
! deck point ids of each cable's End A and End B (Point
F channels)
INTEGER, ALLOCATABLE :: cable_points(:, :)
! FAILURE runtime table (line failures on the coupled path): rows fire at the
@@ -412,6 +418,7 @@ SUBROUTINE CD_AGG_Init_From_Deck(self, deck_path, dt, ErrStat, ErrMsg, env_gravi
candidate%host_current_enabled = parts%host_current_enabled
candidate%cable_load_feedback = parts%cable_load_feedback
candidate%predict_loads = parts%predict_loads
+ candidate%cd_out_dt = parts%cd_out_dt
candidate%max_strain = parts%max_strain
IF (ALLOCATED(parts%host_current_profile_z)) THEN
candidate%host_current_profile_z = parts%host_current_profile_z
@@ -917,7 +924,7 @@ SUBROUTINE CD_AGG_GetMovingPointMesh(self, position, velocity, acceleration, loa
END SUBROUTINE CD_AGG_GetMovingPointMesh
SUBROUTINE CD_AGG_UpdateStates_Moving(self, position, velocity, acceleration, ErrStat, ErrMsg, output_probe, &
- orientation, angular_velocity, angular_acceleration)
+ orientation, angular_velocity, angular_acceleration, cables_from_mirror)
!! Transfer host kinematics for the moving points WITHOUT advancing. The EI=0 system columns
!! route to CD_FMF_UpdateStates_Moving; each cable column's coupled node is written through
!! CD_HFMF_SetCoupledKinematics (translation plus parent orientation/rates, interior and time frozen). The
@@ -927,6 +934,13 @@ SUBROUTINE CD_AGG_UpdateStates_Moving(self, position, velocity, acceleration, Er
!! CalcOutput taken after a fairlead move -- but before the next Step -- reflects that move:
!! the cable's reaction is the instantaneous direct-feedthrough load (current coupled
!! kinematics against the last committed interior shape), not the last committed step's load.
+ !!
+ !! An output probe skips the preflight and the pre-write trial pass of a cable with the nodal
+ !! twist (the write checks the same conditions): its caller reloads the complete state on
+ !! failure, so the update need not be atomic.
+ !! cables_from_mirror = .TRUE. (output probe only) leaves the cables untouched: it is the
+ !! restore of a probe whose caller then reloads every cable from its mirror
+ !! (CD_HFMF_UnpackMirror, which rewrites the coupled ends, their frames and the twist).
TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: self
REAL(wp), INTENT(IN) :: position(:, :), velocity(:, :), acceleration(:, :)
INTEGER, INTENT(OUT) :: ErrStat
@@ -934,16 +948,24 @@ SUBROUTINE CD_AGG_UpdateStates_Moving(self, position, velocity, acceleration, Er
LOGICAL, INTENT(IN), OPTIONAL :: output_probe
REAL(wp), INTENT(IN), OPTIONAL :: orientation(:, :, :)
REAL(wp), INTENT(IN), OPTIONAL :: angular_velocity(:, :), angular_acceleration(:, :)
+ LOGICAL, INTENT(IN), OPTIONAL :: cables_from_mirror
INTEGER :: c, col, es
REAL(wp) :: zero_angular(3)
- LOGICAL :: is_output_probe
+ LOGICAL :: is_output_probe, skip_cables
CHARACTER(1024) :: em
IF (.NOT. require_initialized(self, ErrStat, ErrMsg)) RETURN
zero_angular = CD_ZERO
is_output_probe = .FALSE.
IF (PRESENT(output_probe)) is_output_probe = output_probe
+ skip_cables = .FALSE.
+ IF (PRESENT(cables_from_mirror)) skip_cables = cables_from_mirror
+ IF (skip_cables .AND. .NOT. is_output_probe) THEN
+ ErrStat = CD_AGG_BADINPUT
+ ErrMsg = 'CableDyn_OpenFAST_Aggregate: cables_from_mirror is for an output-probe restore only'
+ RETURN
+ END IF
IF (.NOT. (moving_cols_ok(position, self) .AND. moving_cols_ok(velocity, self) .AND. &
moving_cols_ok(acceleration, self))) THEN
ErrStat = CD_AGG_BADINPUT
@@ -987,8 +1009,12 @@ SUBROUTINE CD_AGG_UpdateStates_Moving(self, position, velocity, acceleration, Er
END IF
! Preflight every cable before touching the EI=0 system or an earlier cable. This
! includes the exact-rigid shortest-rotation check, which is stricter than merely
- ! validating that each supplied orientation is a proper DCM.
+ ! validating that each supplied orientation is a proper DCM. An output probe's caller
+ ! restores the whole state on failure, so a probe writes a cable with the nodal twist
+ ! without it: the write checks every element itself (CD_HFMF_SetCoupledKinematics
+ ! caller_restores).
DO c = 1, self%ncable
+ IF (is_output_probe .AND. self%cables(c)%line%tw_active) CYCLE
col = self%ncp_sys + c
IF (self%cable_col_b(c) > 0) THEN
CALL cable_two_ends(self%cables(c), col, self%cable_col_b(c), CABLE_PREFLIGHT, position, velocity, &
@@ -1057,20 +1083,23 @@ SUBROUTINE CD_AGG_UpdateStates_Moving(self, position, velocity, acceleration, Er
IF (ErrStat /= CD_AGG_OK) RETURN
END IF
DO c = 1, self%ncable
+ IF (skip_cables) EXIT
col = self%ncp_sys + c
IF (self%cable_col_b(c) > 0) THEN
CALL cable_two_ends(self%cables(c), col, self%cable_col_b(c), CABLE_SET, position, velocity, &
acceleration, es, em, orientation, &
- self%mv_omega, self%mv_alpha)
+ self%mv_omega, self%mv_alpha, caller_restores=is_output_probe)
ELSE IF (PRESENT(orientation)) THEN
CALL CD_HFMF_SetCoupledKinematics(self%cables(c), position(:, col), velocity(:, col), &
acceleration(:, col), es, em, orientation(:, :, col), &
- self%mv_omega(:, col), self%mv_alpha(:, col))
+ self%mv_omega(:, col), self%mv_alpha(:, col), &
+ caller_restores=is_output_probe)
ELSE
CALL CD_HFMF_SetCoupledKinematics(self%cables(c), position(:, col), velocity(:, col), &
acceleration(:, col), es, em, &
u_angular_velocity=self%mv_omega(:, col), &
- u_angular_acceleration=self%mv_alpha(:, col))
+ u_angular_acceleration=self%mv_alpha(:, col), &
+ caller_restores=is_output_probe)
END IF
IF (es /= CD_HFMF_OK) THEN
CALL map_hfmf_status(es, em, ErrStat, ErrMsg)
@@ -2465,6 +2494,7 @@ SUBROUTINE CD_AGG_End(self, ErrStat, ErrMsg)
IF (ALLOCATED(self%chan_units)) DEALLOCATE (self%chan_units)
IF (ALLOCATED(self%line_is_cable)) DEALLOCATE (self%line_is_cable)
IF (ALLOCATED(self%line_obj_index)) DEALLOCATE (self%line_obj_index)
+ IF (ALLOCATED(self%chan_rows)) DEALLOCATE (self%chan_rows)
IF (ALLOCATED(self%cable_points)) DEALLOCATE (self%cable_points)
IF (ALLOCATED(self%fl_off)) DEALLOCATE (self%fl_off)
IF (ALLOCATED(self%fl_q)) DEALLOCATE (self%fl_q)
@@ -2542,7 +2572,7 @@ LOGICAL FUNCTION CD_AGG_IsInitialized(self) RESULT(is_initialized)
is_initialized = self%initialized
END FUNCTION CD_AGG_IsInitialized
- INTEGER FUNCTION CD_AGG_NumChannels(self) RESULT(n)
+ PURE INTEGER FUNCTION CD_AGG_NumChannels(self) RESULT(n)
!! Number of deck OUTPUTS channels this module emits to the OpenFAST WriteOutput surface
!! (0 when the deck declares no OUTPUTS -- the coupled run then writes no CableDyn columns).
TYPE(CD_AGG_ModuleType), INTENT(IN) :: self
@@ -2658,9 +2688,6 @@ SUBROUTINE CD_AGG_EvalChannel(self, i, value, ErrStat, ErrMsg)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: es
- CHARACTER(1024) :: em
-
value = CD_ZERO
IF (.NOT. require_initialized(self, ErrStat, ErrMsg)) RETURN
IF (.NOT. ALLOCATED(self%channels) .OR. i < 1 .OR. i > CD_AGG_NumChannels(self)) THEN
@@ -2668,7 +2695,87 @@ SUBROUTINE CD_AGG_EvalChannel(self, i, value, ErrStat, ErrMsg)
ErrMsg = 'CableDyn_OpenFAST_Aggregate: channel index out of range'
RETURN
END IF
- IF (self%has_rigid6) THEN
+ CALL eval_channel(self, i, value, .FALSE., ErrStat, ErrMsg)
+ END SUBROUTINE CD_AGG_EvalChannel
+
+ SUBROUTINE CD_AGG_EvalChannels(self, values, n_done, ErrStat, ErrMsg)
+ !! Evaluate every channel (1 .. CD_AGG_NumChannels) into values(1:NumChannels) at the
+ !! aggregate's present state, as one output row: each channel's value is the one
+ !! CD_AGG_EvalChannel returns for it, bit for bit, while the line-wide values several channels
+ !! of a cable read (its element twists and torsion state, node torques, load powers, section
+ !! curvature, VIV amplitude) are evaluated once for the row instead of once per channel
+ !! (CD_ChannelRow, cleared at the start of every call, so nothing is carried from one state
+ !! to the next). n_done: the channels evaluated; on a failure values(1:n_done) hold the
+ !! channels before the one that failed, whose status and message are returned, as a loop over
+ !! CD_AGG_EvalChannel would stop there.
+ TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: self
+ REAL(wp), INTENT(INOUT) :: values(:)
+ INTEGER, INTENT(OUT) :: n_done
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+
+ INTEGER :: i, n, nc
+
+ n_done = 0
+ ErrStat = CD_AGG_OK
+ ErrMsg = ''
+ n = CD_AGG_NumChannels(self)
+ ! no channels: nothing to evaluate (as a loop over CD_AGG_EvalChannel would do nothing)
+ IF (n == 0) RETURN
+ IF (.NOT. require_initialized(self, ErrStat, ErrMsg)) RETURN
+ IF (SIZE(values) < n) THEN
+ ErrStat = CD_AGG_BADINPUT
+ ErrMsg = 'CableDyn_OpenFAST_Aggregate: channel value array smaller than the channel count'
+ RETURN
+ END IF
+ nc = 0
+ IF (ALLOCATED(self%cables)) nc = SIZE(self%cables)
+ IF (ALLOCATED(self%chan_rows)) THEN
+ IF (SIZE(self%chan_rows) /= nc) DEALLOCATE (self%chan_rows)
+ END IF
+ IF (.NOT. ALLOCATED(self%chan_rows)) ALLOCATE (self%chan_rows(nc))
+ CALL CD_Channel_Row_Reset(self%chan_rows)
+ ErrStat = CD_AGG_OK
+ ErrMsg = ''
+ DO i = 1, n
+ CALL eval_channel(self, i, values(i), .TRUE., ErrStat, ErrMsg)
+ IF (ErrStat /= CD_AGG_OK) EXIT
+ n_done = i
+ END DO
+ ! the row's values belong to this state only
+ CALL CD_Channel_Row_Reset(self%chan_rows)
+ END SUBROUTINE CD_AGG_EvalChannels
+
+ SUBROUTINE eval_channel(self, i, value, use_row, ErrStat, ErrMsg)
+ !! Channel i (in range) at the present state through CD_Eval_Aggregate_Channel; use_row:
+ !! with the row values of CD_AGG_EvalChannels (self%chan_rows, sized and cleared there).
+ TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: self
+ INTEGER, INTENT(IN) :: i
+ REAL(wp), INTENT(OUT) :: value
+ LOGICAL, INTENT(IN) :: use_row
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+
+ INTEGER :: es
+ CHARACTER(1024) :: em
+
+ IF (use_row) THEN
+ IF (self%has_rigid6) THEN
+ CALL CD_Eval_Aggregate_Channel(self%channels(i), self%has_sys, self%sys%fast%system, self%cables, &
+ self%line_is_cable, self%line_obj_index, value, es, em, &
+ cable_points=self%cable_points, rigid_rt=self%rigid6, ranges=self%ranges, &
+ rows=self%chan_rows)
+ ELSE IF (self%has_rod) THEN
+ CALL CD_Eval_Aggregate_Channel(self%channels(i), self%has_sys, self%sys%fast%system, self%cables, &
+ self%line_is_cable, self%line_obj_index, value, es, em, &
+ cable_points=self%cable_points, rod_rt=self%rod, ranges=self%ranges, &
+ rows=self%chan_rows)
+ ELSE
+ CALL CD_Eval_Aggregate_Channel(self%channels(i), self%has_sys, self%sys%fast%system, self%cables, &
+ self%line_is_cable, self%line_obj_index, value, es, em, &
+ cable_points=self%cable_points, ranges=self%ranges, rows=self%chan_rows)
+ END IF
+ ELSE IF (self%has_rigid6) THEN
CALL CD_Eval_Aggregate_Channel(self%channels(i), self%has_sys, self%sys%fast%system, self%cables, &
self%line_is_cable, self%line_obj_index, value, es, em, &
cable_points=self%cable_points, rigid_rt=self%rigid6, ranges=self%ranges)
@@ -2682,7 +2789,7 @@ SUBROUTINE CD_AGG_EvalChannel(self, i, value, ErrStat, ErrMsg)
cable_points=self%cable_points, ranges=self%ranges)
END IF
CALL map_deck_status(es, em, ErrStat, ErrMsg)
- END SUBROUTINE CD_AGG_EvalChannel
+ END SUBROUTINE eval_channel
SUBROUTINE CD_AGG_Range_Sample(self, time, ErrStat, ErrMsg)
!! Accumulate the range graphs (LINES flag r) at a committed output time: once per written
@@ -2966,7 +3073,7 @@ PURE INTEGER FUNCTION ncp_all(self) RESULT(n)
END FUNCTION ncp_all
SUBROUTINE cable_two_ends(cable, ca, cb, mode, position, velocity, acceleration, es, em, orientation, &
- angular_velocity, angular_acceleration, twist)
+ angular_velocity, angular_acceleration, twist, caller_restores)
!! The HFMF boundary call of a cable with a moving End B (CD_HFMF_Set_Moving_End_B): End A takes
!! the moving column ca, End B column cb, each with its orientation and rates (the
!! committed parent orientation and zero rates where the host passes none). mode CABLE_PREFLIGHT
@@ -2981,6 +3088,7 @@ SUBROUTINE cable_two_ends(cable, ca, cb, mode, position, velocity, acceleration,
REAL(wp), INTENT(IN), OPTIONAL :: orientation(:, :, :)
REAL(wp), INTENT(IN), OPTIONAL :: angular_velocity(:, :), angular_acceleration(:, :)
REAL(wp), INTENT(IN), OPTIONAL :: twist
+ LOGICAL, INTENT(IN), OPTIONAL :: caller_restores ! CABLE_SET: see CD_HFMF_SetCoupledKinematics
REAL(wp) :: dcm_a(3, 3), dcm_b(3, 3), w_a(3), al_a(3), w_b(3), al_b(3)
dcm_a = cable%parent_dcm
dcm_b = cable%parent_dcm_b
@@ -3006,7 +3114,7 @@ SUBROUTINE cable_two_ends(cable, ca, cb, mode, position, velocity, acceleration,
CASE (CABLE_SET)
CALL CD_HFMF_SetCoupledKinematics(cable, position(:, ca), velocity(:, ca), acceleration(:, ca), &
es, em, dcm_a, w_a, al_a, position(:, cb), velocity(:, cb), &
- acceleration(:, cb), dcm_b, w_b, al_b)
+ acceleration(:, cb), dcm_b, w_b, al_b, caller_restores=caller_restores)
CASE DEFAULT
CALL CD_HFMF_UpdateStates(cable, position(:, ca), velocity(:, ca), acceleration(:, ca), es, em, &
dcm_a, w_a, al_a, ub_pos=position(:, cb), ub_vel=velocity(:, cb), &
diff --git a/src/CableDyn_OpenFAST_HermiteFMF.f90 b/src/CableDyn_OpenFAST_HermiteFMF.f90
index 1038c1c0..ab8a3f67 100644
--- a/src/CableDyn_OpenFAST_HermiteFMF.f90
+++ b/src/CableDyn_OpenFAST_HermiteFMF.f90
@@ -25,6 +25,8 @@ MODULE CableDyn_OpenFAST_HermiteFMF
USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
CD_HermiteCable_Dyn_Set_Drag, CD_HermiteCable_Dyn_Set_AddedMass, &
CD_HermiteCable_Dyn_Set_Axial_Damping, &
+ CD_HermiteCable_Dyn_Set_Bending_Damping, &
+ CD_HermiteCable_Dyn_Set_Mass_Damping, &
CD_HermiteCable_Dyn_Set_Waves, CD_HermiteCable_Dyn_Set_Held_Fluid, &
CD_HermiteCable_Dyn_Set_Contact, CD_HermiteCable_Dyn_Set_Attachments, &
CD_HermiteCable_Dyn_Set_EndConnection, &
@@ -49,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
@@ -59,6 +62,8 @@ MODULE CableDyn_OpenFAST_HermiteFMF
PUBLIC :: CD_HFMF_Init
PUBLIC :: CD_HFMF_Set_Drag
PUBLIC :: CD_HFMF_Set_Axial_Damping
+ PUBLIC :: CD_HFMF_Set_Bending_Damping
+ PUBLIC :: CD_HFMF_Set_Mass_Damping
PUBLIC :: CD_HFMF_Set_ModifiedNewton
PUBLIC :: CD_HFMF_Set_Tensile_Safety
PUBLIC :: CD_HFMF_Set_Tensile_Monitor
@@ -328,7 +333,8 @@ SUBROUTINE CD_HFMF_Set_Drag(self, rho_w, diam, cdn, cdt, waterline_z, current, E
END IF
END SUBROUTINE CD_HFMF_Set_Drag
- SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_w, gravity, ErrStat, ErrMsg)
+ SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_w, gravity, ErrStat, ErrMsg, &
+ isotropic, point_load)
!! Install discrete point attachments lumped at cable nodes (internal node order,
!! anchor = node 1); see CD_HermiteCable_Dyn_Set_Attachments.
TYPE(CD_HFMF_ModuleType), INTENT(INOUT) :: self
@@ -336,6 +342,7 @@ SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_
REAL(wp), INTENT(IN) :: mass(:), volume(:), cda(:), cdax(:), ca(:), rho_w, gravity
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ LOGICAL, INTENT(IN), OPTIONAL :: isotropic(:), point_load(:)
INTEGER :: es
CHARACTER(1024) :: em
ErrStat = CD_HFMF_OK; ErrMsg = ''
@@ -343,7 +350,7 @@ SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_
ErrStat = CD_HFMF_BADINPUT; ErrMsg = 'CD_HFMF_Set_Attachments: module not initialised'; RETURN
END IF
CALL CD_HermiteCable_Dyn_Set_Attachments(self%line, node, mass, volume, cda, cdax, ca, rho_w, gravity, &
- es, em)
+ es, em, isotropic=isotropic, point_load=point_load)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = CD_HFMF_BADINPUT; ErrMsg = TRIM(em)
END IF
@@ -371,6 +378,52 @@ SUBROUTINE CD_HFMF_Set_Axial_Damping(self, BA, ErrStat, ErrMsg)
END IF
END SUBROUTINE CD_HFMF_Set_Axial_Damping
+ SUBROUTINE CD_HFMF_Set_Bending_Damping(self, Bb, ErrStat, ErrMsg)
+ !! Install the per-element bending Kelvin-Voigt coefficients Bb [N m^2 s] on the cable
+ !! (CD_HermiteCable_Dyn_Set_Bending_Damping).
+ TYPE(CD_HFMF_ModuleType), INTENT(INOUT) :: self
+ REAL(wp), INTENT(IN) :: Bb(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER :: es
+ CHARACTER(1024) :: em
+ ErrStat = CD_HFMF_OK
+ ErrMsg = ''
+ IF (.NOT. self%initialized) THEN
+ ErrStat = CD_HFMF_BADINPUT
+ ErrMsg = 'CD_HFMF_Set_Bending_Damping: module not initialised'
+ RETURN
+ END IF
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(self%line, Bb, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ ErrStat = CD_HFMF_BADINPUT
+ ErrMsg = 'CD_HFMF_Set_Bending_Damping: '//TRIM(em)
+ END IF
+ END SUBROUTINE CD_HFMF_Set_Bending_Damping
+
+ SUBROUTINE CD_HFMF_Set_Mass_Damping(self, alpha, ErrStat, ErrMsg)
+ !! Install the per-element mass-proportional (Rayleigh alpha) coefficients alpha [1/s] on the
+ !! cable (CD_HermiteCable_Dyn_Set_Mass_Damping).
+ TYPE(CD_HFMF_ModuleType), INTENT(INOUT) :: self
+ REAL(wp), INTENT(IN) :: alpha(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER :: es
+ CHARACTER(1024) :: em
+ ErrStat = CD_HFMF_OK
+ ErrMsg = ''
+ IF (.NOT. self%initialized) THEN
+ ErrStat = CD_HFMF_BADINPUT
+ ErrMsg = 'CD_HFMF_Set_Mass_Damping: module not initialised'
+ RETURN
+ END IF
+ CALL CD_HermiteCable_Dyn_Set_Mass_Damping(self%line, alpha, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ ErrStat = CD_HFMF_BADINPUT
+ ErrMsg = 'CD_HFMF_Set_Mass_Damping: '//TRIM(em)
+ END IF
+ END SUBROUTINE CD_HFMF_Set_Mass_Damping
+
SUBROUTINE CD_HFMF_Set_EndConnection(self, k_rot, d0_global, ErrStat, ErrMsg, &
coupled_d0_parent, parent_orientation, connection_mode, &
end_b_d0_parent, end_b_parent_orientation)
@@ -1242,7 +1295,8 @@ END SUBROUTINE coupled_candidate_q
SUBROUTINE CD_HFMF_SetCoupledKinematics(self, u_pos, u_vel, u_acc, ErrStat, ErrMsg, u_orientation, &
u_angular_velocity, u_angular_acceleration, ub_pos, ub_vel, ub_acc, &
- ub_orientation, ub_angular_velocity, ub_angular_acceleration)
+ ub_orientation, ub_angular_velocity, ub_angular_acceleration, &
+ caller_restores)
!! Direct-feedthrough transfer: write ONLY the coupled node's three translational (r, v, a)
!! DOFs into the line state, WITHOUT stepping the interior or advancing simulation time. Used
!! between an UpdateStates_Moving (the host moves the fairlead) and the following CalcOutput so
@@ -1252,6 +1306,13 @@ SUBROUTINE CD_HFMF_SetCoupledKinematics(self, u_pos, u_vel, u_acc, ErrStat, ErrM
!! does not advance self%line%t; the next CD_HFMF_UpdateStates re-prescribes the boundary and
!! performs the actual implicit advance. A moving End B (ub_*, required on such a cable) is
!! written in the same way.
+ !!
+ !! The update is all or nothing: a parent-attached torsion frame is first checked at the state
+ !! about to be written. caller_restores = .TRUE. is for a caller that owns a complete state
+ !! mirror and reloads it on every failure (the OpenFAST output probe): on a cable with the
+ !! nodal twist that trial pass over every element is skipped, as the write itself checks the
+ !! same conditions (Set_Torsion_Frames, with the same message), so a failure can leave the
+ !! cable partly written for the caller to reload. The condensed torsion keeps its check.
TYPE(CD_HFMF_ModuleType), INTENT(INOUT) :: self
REAL(wp), INTENT(IN) :: u_pos(3), u_vel(3), u_acc(3)
INTEGER, INTENT(OUT) :: ErrStat
@@ -1260,11 +1321,13 @@ SUBROUTINE CD_HFMF_SetCoupledKinematics(self, u_pos, u_vel, u_acc, ErrStat, ErrM
REAL(wp), INTENT(IN), OPTIONAL :: u_angular_velocity(3), u_angular_acceleration(3)
REAL(wp), INTENT(IN), OPTIONAL :: ub_pos(3), ub_vel(3), ub_acc(3), ub_orientation(3, 3)
REAL(wp), INTENT(IN), OPTIONAL :: ub_angular_velocity(3), ub_angular_acceleration(3)
+ LOGICAL, INTENT(IN), OPTIONAL :: caller_restores
REAL(wp) :: target_dcm(3, 3), d0_target(3, 2)
REAL(wp) :: tangent_q(3), tangent_v(3), tangent_a(3)
REAL(wp) :: target_omega(3), target_alpha(3), tors_ends(3, 4)
REAL(wp) :: target_dcm_b(3, 3), target_omega_b(3), target_alpha_b(3), tangent_b(3, 3)
INTEGER :: base, es
+ LOGICAL :: atomic
CHARACTER(1024) :: em
CALL prepare_coupled_kinematics(self, u_pos, u_vel, u_acc, target_dcm, target_omega, target_alpha, &
@@ -1277,10 +1340,12 @@ SUBROUTINE CD_HFMF_SetCoupledKinematics(self, u_pos, u_vel, u_acc, ErrStat, ErrM
ErrMsg = 'CD_HFMF_SetCoupledKinematics: '//TRIM(em)
RETURN
END IF
+ atomic = .TRUE.
+ IF (PRESENT(caller_restores)) atomic = .NOT. (caller_restores .AND. self%line%tw_active)
+ IF (self%tors_parent .OR. self%tors_parent_b) tors_ends = coupled_torsion_ends(self, target_dcm, target_dcm_b)
! A parent-attached torsion frame is checked at the state about to be written before
! anything is written (the update is all or nothing)
- IF (self%tors_parent .OR. self%tors_parent_b) THEN
- tors_ends = coupled_torsion_ends(self, target_dcm, target_dcm_b)
+ IF ((self%tors_parent .OR. self%tors_parent_b) .AND. atomic) THEN
! the candidate configuration in the line's trial scratch (as coupled_candidate_q builds it)
DO base = 1, SIZE(self%line%q)
self%line%ws_qtrial(base) = self%line%q(base)
@@ -2224,13 +2289,20 @@ INTEGER FUNCTION CD_HFMF_ForceMirrorSize(self) RESULT(n)
END FUNCTION CD_HFMF_ForceMirrorSize
INTEGER FUNCTION CD_HFMF_VIVMirrorSize(self) RESULT(n)
- !! Mirror slots of the cross-flow VIV state, before the torsion block: the shedding phase
- !! per node, the running mean squares of the cross-flow velocity and acceleration per node
- !! (interleaved) and the averaging time (3 nn + 1 values); zero without VIV.
+ !! Mirror slots of the VIV state, before the torsion block: the cross-flow shedding phase
+ !! per node, the motion statistics per node (interleaved: the running mean squares of the
+ !! cross-flow velocity and acceleration, the four values of the amplitude estimate with
+ !! amplitude tables, the filtered velocity with the flow frame, and on a synchronisation cable
+ !! the step predictor, one rate or two with in-line VIV; on a wake cable row 2 holds the
+ !! predictor), and the averaging time ((1 + rows) nn + 1 values); with in-line VIV then the
+ !! in-line phase and mean squares (3 nn more); with the wake oscillator its state (q, dq/dt)
+ !! per node (2 nn more); zero without VIV.
TYPE(CD_HFMF_ModuleType), INTENT(IN) :: self
n = 0
IF (.NOT. self%initialized) RETURN
- IF (self%line%has_viv) n = 3*self%line%nn + 1
+ IF (self%line%has_viv) n = (1 + SIZE(self%line%viv_ms, 1))*self%line%nn + 1
+ IF (self%line%has_viv_il) n = n + 3*self%line%nn
+ IF (self%line%viv_wake) n = n + SIZE(self%line%wo_s)
END FUNCTION CD_HFMF_VIVMirrorSize
INTEGER FUNCTION CD_HFMF_FrictionMirrorSize(self) RESULT(n)
@@ -2251,7 +2323,7 @@ SUBROUTINE CD_HFMF_PackMirror(self, buf, ErrStat, ErrMsg)
REAL(wp), INTENT(OUT) :: buf(:)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: i, nf, nh, k
+ INTEGER :: i, nf, nh, k, nv
ErrStat = CD_HFMF_OK; ErrMsg = ''
buf = CD_ZERO
IF (.NOT. self%initialized) THEN
@@ -2308,10 +2380,20 @@ SUBROUTINE CD_HFMF_PackMirror(self, buf, ErrStat, ErrMsg)
k = k + 1 + self%line%ndof
END IF
IF (self%line%has_viv) THEN
+ nv = SIZE(self%line%viv_ms, 1)
buf(k + 1:k + self%line%nn) = self%line%viv_phi
- buf(k + self%line%nn + 1:k + 3*self%line%nn) = RESHAPE(self%line%viv_ms, [2*self%line%nn])
- buf(k + 3*self%line%nn + 1) = self%line%viv_tw
- k = k + 3*self%line%nn + 1
+ buf(k + self%line%nn + 1:k + (1 + nv)*self%line%nn) = RESHAPE(self%line%viv_ms, [nv*self%line%nn])
+ buf(k + (1 + nv)*self%line%nn + 1) = self%line%viv_tw
+ k = k + (1 + nv)*self%line%nn + 1
+ END IF
+ IF (self%line%has_viv_il) THEN
+ buf(k + 1:k + self%line%nn) = self%line%vil_phi
+ buf(k + self%line%nn + 1:k + 3*self%line%nn) = RESHAPE(self%line%vil_ms, [2*self%line%nn])
+ k = k + 3*self%line%nn
+ END IF
+ IF (self%line%viv_wake) THEN
+ buf(k + 1:k + SIZE(self%line%wo_s)) = RESHAPE(self%line%wo_s, [SIZE(self%line%wo_s)])
+ k = k + SIZE(self%line%wo_s)
END IF
IF (self%line%torsion%active) THEN
buf(k + 1) = self%line%torsion%theta
@@ -2336,7 +2418,8 @@ SUBROUTINE CD_HFMF_UnpackMirror(self, buf, t, ErrStat, ErrMsg)
REAL(wp), INTENT(IN) :: t
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: i, nf, nh, k, kb, es
+ INTEGER :: i, nf, nh, k, kb, es, nv
+ LOGICAL :: bad_viv
CHARACTER(1024) :: em
ErrStat = CD_HFMF_OK; ErrMsg = ''
IF (.NOT. self%initialized) THEN
@@ -2393,12 +2476,40 @@ SUBROUTINE CD_HFMF_UnpackMirror(self, buf, t, ErrStat, ErrMsg)
RETURN
END IF
END IF
- ! and the VIV block's mean squares and averaging time, which cannot be negative
+ ! and the VIV block's mean squares, amplitudes and averaging time, which cannot be negative
+ ! (per node the rows of the motion statistics: the mean squares, rows 1:2, and the amplitudes
+ ! y0, y0s of the amplitude estimate, rows 4:5; its travel and last cross-flow velocity, rows
+ ! 3 and 6, and the step predictor's rates after the statistics are signed, as is a wake
+ ! cable's predictor, the mid-point cross-flow acceleration, in row 2)
IF (self%line%has_viv) THEN
+ nv = SIZE(self%line%viv_ms, 1)
kb = SIZE(buf) - CD_HFMF_TorsionMirrorSize(self) - CD_HFMF_VIVMirrorSize(self) + self%line%nn
- IF (ANY(buf(kb + 1:kb + 2*self%line%nn + 1) < CD_ZERO)) THEN
+ bad_viv = buf(kb + nv*self%line%nn + 1) < CD_ZERO
+ DO i = 1, self%line%nn
+ IF (self%line%viv_wake) THEN
+ IF (buf(kb + (i - 1)*nv + 1) < CD_ZERO) bad_viv = .TRUE.
+ ELSE
+ IF (ANY(buf(kb + (i - 1)*nv + 1:kb + (i - 1)*nv + 2) < CD_ZERO)) bad_viv = .TRUE.
+ END IF
+ 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
+ ErrMsg = 'CD_HFMF_UnpackMirror: the VIV mean squares, amplitudes and averaging time must be non-negative'
+ RETURN
+ END IF
+ END IF
+ IF (self%line%has_viv_il) THEN
+ kb = SIZE(buf) - CD_HFMF_TorsionMirrorSize(self) - 2*self%line%nn
+ IF (ANY(buf(kb + 1:kb + 2*self%line%nn) < CD_ZERO)) THEN
ErrStat = CD_HFMF_BADINPUT
- ErrMsg = 'CD_HFMF_UnpackMirror: the VIV mean squares and averaging time must be non-negative'
+ ErrMsg = 'CD_HFMF_UnpackMirror: the in-line VIV mean squares must be non-negative'
RETURN
END IF
END IF
@@ -2464,13 +2575,29 @@ SUBROUTINE CD_HFMF_UnpackMirror(self, buf, t, ErrStat, ErrMsg)
! the VIV state, with the step-start copy of a recovering step and the in-step phase
IF (self%line%has_viv) THEN
self%line%viv_phi = buf(k + 1:k + self%line%nn)
- self%line%viv_ms = RESHAPE(buf(k + self%line%nn + 1:k + 3*self%line%nn), [2, self%line%nn])
- self%line%viv_tw = buf(k + 3*self%line%nn + 1)
+ nv = SIZE(self%line%viv_ms, 1)
+ self%line%viv_ms = RESHAPE(buf(k + self%line%nn + 1:k + (1 + nv)*self%line%nn), [nv, self%line%nn])
+ self%line%viv_tw = buf(k + (1 + nv)*self%line%nn + 1)
self%line%viv_phi_eval = self%line%viv_phi
self%line%viv_ms_next = self%line%viv_ms
self%line%ws_recovery_viv_phi = self%line%viv_phi
self%line%ws_recovery_viv_ms = self%line%viv_ms
- k = k + 3*self%line%nn + 1
+ k = k + (1 + nv)*self%line%nn + 1
+ END IF
+ IF (self%line%has_viv_il) THEN
+ self%line%vil_phi = buf(k + 1:k + self%line%nn)
+ self%line%vil_ms = RESHAPE(buf(k + self%line%nn + 1:k + 3*self%line%nn), [2, self%line%nn])
+ self%line%vil_phi_eval = self%line%vil_phi
+ self%line%vil_ms_next = self%line%vil_ms
+ self%line%ws_recovery_vil_phi = self%line%vil_phi
+ self%line%ws_recovery_vil_ms = self%line%vil_ms
+ k = k + 3*self%line%nn
+ END IF
+ IF (self%line%viv_wake) THEN
+ self%line%wo_s = RESHAPE(buf(k + 1:k + SIZE(self%line%wo_s)), SHAPE(self%line%wo_s))
+ self%line%wo_q_eval = self%line%wo_s(1, :)
+ self%line%ws_recovery_wo_s = self%line%wo_s
+ k = k + SIZE(self%line%wo_s)
END IF
IF (self%line%torsion%active) THEN
self%line%torsion%theta = buf(k + 1)
diff --git a/src/CableDyn_System.f90 b/src/CableDyn_System.f90
index 272563b8..c4c11342 100644
--- a/src/CableDyn_System.f90
+++ b/src/CableDyn_System.f90
@@ -18,6 +18,7 @@ MODULE CableDyn_System
CD_Model_Has_Viscoelastic, CD_Get_Model_VE_Dl1, CD_Set_Model_VE_Dl1, &
CD_Model_Has_Syrope, CD_Get_Model_Syrope_State, CD_Set_Model_Syrope_State, &
CD_Model_Has_VIV, CD_Get_Model_VIV_State, CD_Set_Model_VIV_State, CD_Get_Model_VIV_Lift, &
+ CD_Model_Has_VIV_Inline, CD_Get_Model_Load_Power, CD_Model_VIV_NMS, &
CD_Model_Has_Friction, CD_Get_Model_Friction_Anchors, CD_Set_Model_Friction_Anchors, &
CD_Latch_Model_VIV_Window, &
CD_Get_Model_EndNodeMassDiag, CD_Get_Model_EndNodeAddedMass, &
@@ -35,6 +36,7 @@ MODULE CableDyn_System
CD_MODEL_OK, CD_MODEL_BADINPUT, &
CD_MODEL_SOLVEFAIL, CD_MODEL_NOT_INITIALIZED, CD_MODEL_ALLOCFAIL, CD_Copy_Model
USE CableDyn_Line, ONLY: CD_Nodal_Seabed_Stiffness
+ USE CableDyn_VIV, ONLY: CD_VIV_NMS
!$ USE OMP_LIB, ONLY: omp_get_max_threads
IMPLICIT NONE
PRIVATE
@@ -79,7 +81,7 @@ MODULE CableDyn_System
PUBLIC :: CD_Set_System_Line_Friction_Anchors
PUBLIC :: CD_Get_System_Line_Syrope_State
PUBLIC :: CD_System_Line_VIV_MirrorSize, CD_Get_System_Line_VIV_State, CD_Set_System_Line_VIV_State, &
- CD_Get_System_Line_VIV_Lift
+ CD_Get_System_Line_VIV_Lift, CD_Get_System_Line_Load_Power
PUBLIC :: CD_Set_System_Line_Syrope_State
PUBLIC :: CD_Get_System_PointBlocks
PUBLIC :: CD_Get_System_Point_State
@@ -236,6 +238,8 @@ MODULE CableDyn_System
! VIV shedding phase and cross-flow mean squares join the snapshot (phi then the two
! mean squares per node, 3 per node: sized like snap_q, line by line).
REAL(wp), ALLOCATABLE :: snap_viv(:)
+ ! and the in-line phase and mean squares of a line with in-line VIV, laid out the same way
+ REAL(wp), ALLOCATABLE :: snap_vil(:)
LOGICAL :: snap_valid = .FALSE.
! Adaptive-substep fallback tripwire: how many times CD_Step_System entered the
! subdivision retry of this system since its initialisation or the last
@@ -478,6 +482,7 @@ SUBROUTINE CD_End_System(system, ErrStat, ErrMsg)
IF (ALLOCATED(system%snap_fbase)) DEALLOCATE (system%snap_fbase)
IF (ALLOCATED(system%snap_ve_dl_1)) DEALLOCATE (system%snap_ve_dl_1)
IF (ALLOCATED(system%snap_viv)) DEALLOCATE (system%snap_viv)
+ IF (ALLOCATED(system%snap_vil)) DEALLOCATE (system%snap_vil)
IF (ALLOCATED(system%snap_syrope_slow)) DEALLOCATE (system%snap_syrope_slow, system%snap_syrope_tmax)
IF (ALLOCATED(system%snap_fr_anchor)) DEALLOCATE (system%snap_fr_anchor)
IF (ALLOCATED(system%snap_sub)) DEALLOCATE (system%snap_sub)
@@ -954,27 +959,37 @@ END SUBROUTINE CD_Get_System_Line_Syrope_State
PURE INTEGER FUNCTION CD_System_Line_VIV_MirrorSize(system, line_index) RESULT(n)
!! Reals of one contained line's VIV checkpoint block (CD_Get_System_Line_VIV_State):
- !! 3 per node plus the averaging time, or 0 for a line without VIV.
+ !! 3 per node plus the averaging time, 3 per node more with in-line VIV, and per node the rows
+ !! of the motion statistics after the two mean squares (CD_Model_VIV_NMS - CD_VIV_NMS: the
+ !! amplitude estimate, the flow frame and the step predictor where the line has them), or 0
+ !! for a line without VIV.
TYPE(CD_SystemType), INTENT(IN) :: system
INTEGER, INTENT(IN) :: line_index
+ INTEGER :: nn
n = 0
IF (line_index < 1 .OR. line_index > system%n_lines) RETURN
IF (.NOT. CD_Model_Has_VIV(system%lines(line_index))) RETURN
- n = 3*SIZE(system%lines(line_index)%viv_phi) + 1
+ nn = SIZE(system%lines(line_index)%viv_phi)
+ n = 3*nn + 1
+ IF (CD_Model_Has_VIV_Inline(system%lines(line_index))) n = n + 3*nn
+ n = n + (CD_Model_VIV_NMS(system%lines(line_index)) - CD_VIV_NMS)*nn
END FUNCTION CD_System_Line_VIV_MirrorSize
SUBROUTINE CD_Get_System_Line_VIV_State(system, line_index, buf, ErrStat, ErrMsg)
!! One contained line's committed VIV state as a flat checkpoint block: the shedding
!! phases (n_nodes), the cross-flow velocity and acceleration mean squares interleaved
- !! per node (2 n_nodes), then the averaging time.
+ !! per node (2 n_nodes), then the averaging time; with in-line VIV then the in-line phases
+ !! and mean squares the same way (3 n_nodes); then the further rows of the motion statistics
+ !! interleaved per node (the amplitude estimate, the flow frame and the step predictor where
+ !! the line has them; (CD_Model_VIV_NMS - CD_VIV_NMS) n_nodes).
TYPE(CD_SystemType), INTENT(IN) :: system
INTEGER, INTENT(IN) :: line_index
REAL(wp), INTENT(OUT) :: buf(:)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: nn, es
+ INTEGER :: nn, es, nms, k
CHARACTER(160) :: em
- REAL(wp), ALLOCATABLE :: phi(:), ms(:, :)
+ REAL(wp), ALLOCATABLE :: phi(:), ms(:, :), phx(:), msx(:, :)
buf = CD_ZERO
CALL validate_line_index(system, line_index, ErrStat, ErrMsg)
@@ -983,16 +998,25 @@ SUBROUTINE CD_Get_System_Line_VIV_State(system, line_index, buf, ErrStat, ErrMsg
CALL fail(ErrStat, ErrMsg, 'line VIV state block has the wrong size')
RETURN
END IF
- nn = (SIZE(buf) - 1)/3
- ALLOCATE (phi(nn), ms(2, nn))
- CALL CD_Get_Model_VIV_State(system%lines(line_index), phi, ms, buf(3*nn + 1), es, em)
+ nn = SIZE(system%lines(line_index)%viv_phi)
+ nms = CD_Model_VIV_NMS(system%lines(line_index))
+ ALLOCATE (phi(nn), ms(nms, nn), phx(nn), msx(2, nn))
+ CALL CD_Get_Model_VIV_State(system%lines(line_index), phi, ms, buf(3*nn + 1), es, em, phi_x=phx, ms_x=msx)
IF (es /= CD_MODEL_OK) THEN
ErrStat = CD_SYSTEM_SOLVEFAIL
ErrMsg = 'CableDyn_System: line VIV state query failed: '//TRIM(em)
RETURN
END IF
buf(1:nn) = phi
- buf(nn + 1:3*nn) = RESHAPE(ms, [2*nn])
+ buf(nn + 1:3*nn) = RESHAPE(ms(1:2, :), [2*nn])
+ k = 3*nn + 1
+ IF (CD_Model_Has_VIV_Inline(system%lines(line_index))) THEN
+ buf(k + 1:k + nn) = phx
+ buf(k + nn + 1:k + 3*nn) = RESHAPE(msx, [2*nn])
+ k = k + 3*nn
+ END IF
+ IF (nms > CD_VIV_NMS) buf(k + 1:k + (nms - CD_VIV_NMS)*nn) = RESHAPE(ms(CD_VIV_NMS + 1:nms, :), &
+ [(nms - CD_VIV_NMS)*nn])
ErrStat = CD_SYSTEM_OK
ErrMsg = ''
END SUBROUTINE CD_Get_System_Line_VIV_State
@@ -1005,8 +1029,9 @@ SUBROUTINE CD_Set_System_Line_VIV_State(system, line_index, buf, ErrStat, ErrMsg
REAL(wp), INTENT(IN) :: buf(:)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
- INTEGER :: nn, es
+ INTEGER :: nn, es, nms, k
CHARACTER(160) :: em
+ REAL(wp), ALLOCATABLE :: ms(:, :)
CALL validate_line_index(system, line_index, ErrStat, ErrMsg)
IF (ErrStat /= CD_SYSTEM_OK) RETURN
@@ -1014,9 +1039,21 @@ SUBROUTINE CD_Set_System_Line_VIV_State(system, line_index, buf, ErrStat, ErrMsg
CALL fail(ErrStat, ErrMsg, 'line VIV state block has the wrong size')
RETURN
END IF
- nn = (SIZE(buf) - 1)/3
- CALL CD_Set_Model_VIV_State(system%lines(line_index), buf(1:nn), RESHAPE(buf(nn + 1:3*nn), [2, nn]), &
- buf(3*nn + 1), es, em)
+ nn = SIZE(system%lines(line_index)%viv_phi)
+ nms = CD_Model_VIV_NMS(system%lines(line_index))
+ ALLOCATE (ms(nms, nn))
+ ms(1:2, :) = RESHAPE(buf(nn + 1:3*nn), [2, nn])
+ k = 3*nn + 1
+ IF (CD_Model_Has_VIV_Inline(system%lines(line_index))) k = k + 3*nn
+ IF (nms > CD_VIV_NMS) ms(CD_VIV_NMS + 1:nms, :) = RESHAPE(buf(k + 1:k + (nms - CD_VIV_NMS)*nn), &
+ [nms - CD_VIV_NMS, nn])
+ IF (CD_Model_Has_VIV_Inline(system%lines(line_index))) THEN
+ CALL CD_Set_Model_VIV_State(system%lines(line_index), buf(1:nn), ms, &
+ buf(3*nn + 1), es, em, phi_x=buf(3*nn + 2:4*nn + 1), &
+ ms_x=RESHAPE(buf(4*nn + 2:6*nn + 1), [2, nn]))
+ ELSE
+ CALL CD_Set_Model_VIV_State(system%lines(line_index), buf(1:nn), ms, buf(3*nn + 1), es, em)
+ END IF
IF (es /= CD_MODEL_OK) THEN
ErrStat = CD_SYSTEM_SOLVEFAIL
ErrMsg = 'CableDyn_System: line VIV state reload failed: '//TRIM(em)
@@ -1026,6 +1063,32 @@ SUBROUTINE CD_Set_System_Line_VIV_State(system, line_index, buf, ErrStat, ErrMsg
ErrMsg = ''
END SUBROUTINE CD_Set_System_Line_VIV_State
+ SUBROUTINE CD_Get_System_Line_Load_Power(system, line_index, p_viv, p_drag, p_damp, ErrStat, ErrMsg)
+ !! The VIV, drag and structural damping power [W] on every node of one contained line at the
+ !! committed state (n_nodes each; CD_Get_Model_Load_Power).
+ TYPE(CD_SystemType), INTENT(IN) :: system
+ INTEGER, INTENT(IN) :: line_index
+ REAL(wp), INTENT(OUT) :: p_viv(:), p_drag(:), p_damp(:)
+ INTEGER, INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ INTEGER :: es
+ CHARACTER(160) :: em
+
+ p_viv = CD_ZERO
+ p_drag = CD_ZERO
+ p_damp = CD_ZERO
+ CALL validate_line_index(system, line_index, ErrStat, ErrMsg)
+ IF (ErrStat /= CD_SYSTEM_OK) RETURN
+ CALL CD_Get_Model_Load_Power(system%lines(line_index), p_viv, p_drag, p_damp, es, em)
+ IF (es /= CD_MODEL_OK) THEN
+ ErrStat = CD_SYSTEM_SOLVEFAIL
+ ErrMsg = 'CableDyn_System: line load power query failed: '//TRIM(em)
+ RETURN
+ END IF
+ ErrStat = CD_SYSTEM_OK
+ ErrMsg = ''
+ END SUBROUTINE CD_Get_System_Line_Load_Power
+
SUBROUTINE CD_Get_System_Line_VIV_Lift(system, line_index, lift, ErrStat, ErrMsg)
!! VIV lift force on every node of one contained line at the committed state (3, n_nodes).
TYPE(CD_SystemType), INTENT(IN) :: system
@@ -1425,11 +1488,11 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled,
INTEGER, PARAMETER :: MAX_SUBDIV = 6 ! floor dt/64: resolves any benign line-search stall
INTEGER :: i, j, lo, hi, nc, es, line_dof, sys_dof, depth, iter2, ntot, nve, nsy, lo_ve, lo_sy, ne, nfr, lo_fr
- INTEGER :: n_team, nel, lo_el
+ INTEGER :: n_team, nel, lo_el, nvv, lo_vv
LOGICAL :: conv2, stall2
CHARACTER(1024) :: em
REAL(wp), ALLOCATABLE :: q0(:), v0(:), a0(:), qm(:), vm(:), am(:), qs(:), vs(:), as(:)
- REAL(wp), ALLOCATABLE :: dl1s(:), slows(:), tmaxs(:), frs(:, :), hmaxs(:), l0cs(:), l0dcs(:), vivs(:)
+ REAL(wp), ALLOCATABLE :: dl1s(:), slows(:), tmaxs(:), frs(:, :), hmaxs(:), l0cs(:), l0dcs(:), vivs(:), vils(:)
TYPE(CD_SubstepStats), ALLOCATABLE :: subs(:)
converged = .FALSE.
@@ -1563,21 +1626,25 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled,
nsy = 0
nfr = 0
nel = 0
+ nvv = 0
DO i = 1, system%n_lines
ntot = ntot + SIZE(system%lines(i)%q)
nel = nel + SIZE(system%lines(i)%l0_c)
+ nvv = nvv + viv_pack_size(system%lines(i))
IF (system%lines(i)%has_viscoelastic) nve = nve + SIZE(system%lines(i)%ve_dl_1)
IF (system%lines(i)%has_syrope) nsy = nsy + SIZE(system%lines(i)%syrope_slow)
IF (CD_Model_Has_Friction(system%lines(i))) nfr = nfr + SIZE(system%lines(i)%fr_anchor, 2)
END DO
ALLOCATE (qs(ntot), vs(ntot), as(ntot), dl1s(nve), slows(nsy), tmaxs(nsy), frs(2, nfr), &
- hmaxs(system%n_lines), subs(system%n_lines), l0cs(nel), l0dcs(nel), vivs(ntot))
+ hmaxs(system%n_lines), subs(system%n_lines), l0cs(nel), l0dcs(nel), vivs(nvv), vils(ntot))
vivs = CD_ZERO
+ vils = CD_ZERO
lo = 1
lo_ve = 1
lo_sy = 1
lo_fr = 1
lo_el = 1
+ lo_vv = 1
DO i = 1, system%n_lines
hi = lo + SIZE(system%lines(i)%q) - 1
qs(lo:hi) = system%lines(i)%q
@@ -1587,7 +1654,12 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled,
! states, so the halves of a fallback that does not complete leave no trace
hmaxs(i) = system%lines(i)%audit_hmax
subs(i) = system%lines(i)%sub_stats
- IF (system%lines(i)%has_viv) CALL pack_viv(system%lines(i), vivs(lo:hi))
+ IF (system%lines(i)%has_viv) THEN
+ ne = viv_pack_size(system%lines(i))
+ CALL pack_viv(system%lines(i), vivs(lo_vv:lo_vv + ne - 1))
+ lo_vv = lo_vv + ne
+ END IF
+ IF (system%lines(i)%has_viv_il) CALL pack_vil(system%lines(i), vils(lo:hi))
lo = hi + 1
ne = SIZE(system%lines(i)%l0_c)
l0cs(lo_el:lo_el + ne - 1) = system%lines(i)%l0_c
@@ -1630,6 +1702,7 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled,
lo_sy = 1
lo_fr = 1
lo_el = 1
+ lo_vv = 1
DO i = 1, system%n_lines
hi = lo + SIZE(system%lines(i)%q) - 1
system%lines(i)%q = qs(lo:hi)
@@ -1637,7 +1710,12 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled,
system%lines(i)%a = as(lo:hi)
system%lines(i)%audit_hmax = hmaxs(i)
system%lines(i)%sub_stats = subs(i)
- IF (system%lines(i)%has_viv) CALL unpack_viv(system%lines(i), vivs(lo:hi))
+ IF (system%lines(i)%has_viv) THEN
+ ne = viv_pack_size(system%lines(i))
+ CALL unpack_viv(system%lines(i), vivs(lo_vv:lo_vv + ne - 1))
+ lo_vv = lo_vv + ne
+ END IF
+ IF (system%lines(i)%has_viv_il) CALL unpack_vil(system%lines(i), vils(lo:hi))
lo = hi + 1
ne = SIZE(system%lines(i)%l0_c)
system%lines(i)%l0_c = l0cs(lo_el:lo_el + ne - 1)
@@ -3353,6 +3431,10 @@ SUBROUTINE save_line_states(system, ErrStat, ErrMsg)
system%lines(i)%viv_phi_rollback = system%lines(i)%viv_phi
system%lines(i)%viv_ms_rollback = system%lines(i)%viv_ms
END IF
+ IF (system%lines(i)%has_viv_il) THEN
+ system%lines(i)%vil_phi_rollback = system%lines(i)%vil_phi
+ system%lines(i)%vil_ms_rollback = system%lines(i)%vil_ms
+ END IF
END DO
END SUBROUTINE save_line_states
@@ -3383,31 +3465,81 @@ SUBROUTINE restore_line_states(system)
system%lines(i)%viv_ms = system%lines(i)%viv_ms_rollback
system%lines(i)%viv_phi_eval = system%lines(i)%viv_phi
END IF
+ IF (system%lines(i)%has_viv_il) THEN
+ system%lines(i)%vil_phi = system%lines(i)%vil_phi_rollback
+ system%lines(i)%vil_ms = system%lines(i)%vil_ms_rollback
+ system%lines(i)%vil_phi_eval = system%lines(i)%vil_phi
+ END IF
END DO
END SUBROUTINE restore_line_states
+ PURE INTEGER FUNCTION viv_pack_offset(system, i) RESULT(lo)
+ !! First index of line i's packed VIV state in a system-wide VIV snapshot, the lines packed
+ !! in order (viv_pack_size each); i = n_lines + 1 gives the total plus one.
+ TYPE(CD_SystemType), INTENT(IN) :: system
+ INTEGER, INTENT(IN) :: i
+ INTEGER :: j
+ lo = 1
+ DO j = 1, MIN(i - 1, system%n_lines)
+ lo = lo + viv_pack_size(system%lines(j))
+ END DO
+ END FUNCTION viv_pack_offset
+
+ PURE INTEGER FUNCTION viv_pack_size(line) RESULT(n)
+ !! Reals of a line's packed VIV state (pack_viv): per node the phase and the rows of the
+ !! motion statistics (CD_Model_VIV_NMS), 0 without VIV.
+ TYPE(CD_ModelType), INTENT(IN) :: line
+ n = 0
+ IF (.NOT. line%has_viv) RETURN
+ n = (1 + SIZE(line%viv_ms, 1))*SIZE(line%viv_phi)
+ END FUNCTION viv_pack_size
+
PURE SUBROUTINE pack_viv(line, buf)
- !! A line's committed VIV state as 3 reals per node: the phases, then the two mean
- !! squares per node (the size of the line's q).
+ !! A line's committed VIV state (viv_pack_size reals): the phases, then the motion
+ !! statistics per node (the two mean squares, the amplitude estimate with amplitude tables,
+ !! the flow frame and the step predictor).
TYPE(CD_ModelType), INTENT(IN) :: line
REAL(wp), INTENT(OUT) :: buf(:)
- INTEGER :: nn
+ INTEGER :: nn, nms
nn = SIZE(line%viv_phi)
+ nms = SIZE(line%viv_ms, 1)
buf(1:nn) = line%viv_phi
- buf(nn + 1:3*nn) = RESHAPE(line%viv_ms, [2*nn])
+ buf(nn + 1:(1 + nms)*nn) = RESHAPE(line%viv_ms, [nms*nn])
END SUBROUTINE pack_viv
PURE SUBROUTINE unpack_viv(line, buf)
!! Inverse of pack_viv; the in-step phase returns to the committed one.
TYPE(CD_ModelType), INTENT(INOUT) :: line
REAL(wp), INTENT(IN) :: buf(:)
- INTEGER :: nn
+ INTEGER :: nn, nms
nn = SIZE(line%viv_phi)
+ nms = SIZE(line%viv_ms, 1)
line%viv_phi = buf(1:nn)
- line%viv_ms = RESHAPE(buf(nn + 1:3*nn), [2, nn])
+ line%viv_ms = RESHAPE(buf(nn + 1:(1 + nms)*nn), [nms, nn])
line%viv_phi_eval = line%viv_phi
END SUBROUTINE unpack_viv
+ PURE SUBROUTINE pack_vil(line, buf)
+ !! A line's committed in-line VIV state as 3 reals per node (pack_viv's layout).
+ TYPE(CD_ModelType), INTENT(IN) :: line
+ REAL(wp), INTENT(OUT) :: buf(:)
+ INTEGER :: nn
+ nn = SIZE(line%vil_phi)
+ buf(1:nn) = line%vil_phi
+ buf(nn + 1:3*nn) = RESHAPE(line%vil_ms, [2*nn])
+ END SUBROUTINE pack_vil
+
+ PURE SUBROUTINE unpack_vil(line, buf)
+ !! Inverse of pack_vil; the in-step phase returns to the committed one.
+ TYPE(CD_ModelType), INTENT(INOUT) :: line
+ REAL(wp), INTENT(IN) :: buf(:)
+ INTEGER :: nn
+ nn = SIZE(line%vil_phi)
+ line%vil_phi = buf(1:nn)
+ line%vil_ms = RESHAPE(buf(nn + 1:3*nn), [2, nn])
+ line%vil_phi_eval = line%vil_phi
+ END SUBROUTINE unpack_vil
+
SUBROUTINE restore_failed_step(system, failed_stat, msg, converged, stalled, n_iter, ErrStat, ErrMsg)
TYPE(CD_SystemType), INTENT(INOUT) :: system
INTEGER, INTENT(IN) :: failed_stat
@@ -3507,9 +3639,17 @@ SUBROUTINE CD_System_Snapshot(system, ErrStat, ErrMsg)
ALLOCATE (system%snap_l0(netot), system%snap_l0_dot(netot), system%snap_fbase(ntot), &
system%snap_l0_c(netot), system%snap_l0_dot_c(netot), &
system%snap_ve_dl_1(netot), system%snap_syrope_slow(netot), &
- system%snap_syrope_tmax(netot), system%snap_fr_anchor(ntot), system%snap_viv(ntot))
+ system%snap_syrope_tmax(netot), system%snap_fr_anchor(ntot), &
+ system%snap_viv(viv_pack_offset(system, system%n_lines + 1) - 1), &
+ system%snap_vil(ntot))
END BLOCK
END IF
+ ! The packed VIV state is sized by the lines' VIV configuration (viv_pack_size), which a line
+ ! may change after the first snapshot (amplitude tables add rows): follow it.
+ IF (SIZE(system%snap_viv) /= viv_pack_offset(system, system%n_lines + 1) - 1) THEN
+ DEALLOCATE (system%snap_viv)
+ ALLOCATE (system%snap_viv(viv_pack_offset(system, system%n_lines + 1) - 1))
+ END IF
lo = 1
DO i = 1, system%n_lines
hi = lo + SIZE(system%lines(i)%q) - 1
@@ -3521,7 +3661,9 @@ SUBROUTINE CD_System_Snapshot(system, ErrStat, ErrMsg)
IF (CD_Model_Has_Friction(system%lines(i))) &
system%snap_fr_anchor(lo:lo + 2*SIZE(system%lines(i)%fr_anchor, 2) - 1) = &
RESHAPE(system%lines(i)%fr_anchor, [2*SIZE(system%lines(i)%fr_anchor, 2)])
- IF (system%lines(i)%has_viv) CALL pack_viv(system%lines(i), system%snap_viv(lo:hi))
+ IF (system%lines(i)%has_viv) CALL pack_viv(system%lines(i), system%snap_viv(viv_pack_offset(system, i): &
+ viv_pack_offset(system, i + 1) - 1))
+ IF (system%lines(i)%has_viv_il) CALL pack_vil(system%lines(i), system%snap_vil(lo:hi))
lo = hi + 1
END DO
IF (.NOT. ALLOCATED(system%snap_sub)) ALLOCATE (system%snap_sub(system%n_lines))
@@ -3581,6 +3723,11 @@ SUBROUTINE CD_System_Restore(system, ErrStat, ErrMsg)
ErrMsg = 'CableDyn_System: restore has no valid snapshot'
RETURN
END IF
+ IF (SIZE(system%snap_viv) /= viv_pack_offset(system, system%n_lines + 1) - 1) THEN
+ ErrStat = CD_SYSTEM_BADINPUT
+ ErrMsg = 'CableDyn_System: restore: the VIV configuration of a line changed since the snapshot'
+ RETURN
+ END IF
lo = 1
DO i = 1, system%n_lines
hi = lo + SIZE(system%lines(i)%q) - 1
@@ -3591,7 +3738,9 @@ SUBROUTINE CD_System_Restore(system, ErrStat, ErrMsg)
IF (CD_Model_Has_Friction(system%lines(i))) &
system%lines(i)%fr_anchor = RESHAPE(system%snap_fr_anchor(lo:lo + 2*SIZE(system%lines(i)%fr_anchor, 2) - 1), &
[2, SIZE(system%lines(i)%fr_anchor, 2)])
- IF (system%lines(i)%has_viv) CALL unpack_viv(system%lines(i), system%snap_viv(lo:hi))
+ IF (system%lines(i)%has_viv) CALL unpack_viv(system%lines(i), system%snap_viv(viv_pack_offset(system, i): &
+ viv_pack_offset(system, i + 1) - 1))
+ IF (system%lines(i)%has_viv_il) CALL unpack_vil(system%lines(i), system%snap_vil(lo:hi))
lo = hi + 1
END DO
IF (ALLOCATED(system%snap_sub)) THEN
diff --git a/src/CableDyn_VIV.f90 b/src/CableDyn_VIV.f90
index 94a60ae0..b69b8577 100644
--- a/src/CableDyn_VIV.f90
+++ b/src/CableDyn_VIV.f90
@@ -30,11 +30,34 @@ MODULE CableDyn_VIV
!! (w_e the submerged fraction of element e): per unit length 1/2 rho D Cl U^2 cos(phi)
!! along e, exactly MoorDyn's Lf = 1/2 rho_w d |Vp| Cl cos(phi) (q x Vp) l_node.
!!
+ !! In-line VIV (Ulveseter, Thorsen, Saevik and Larsen, Mar. Struct. 60, 2018, 241-260,
+ !! Eq. 1, 2, 6 and 7): a second shedding force along the relative normal flow,
+ !!
+ !! F_x = C_x cos(phi_x) U v_n , per unit length 1/2 rho D C_vx U v_n cos(phi_x)
+ !!
+ !! whose phase is slaved to twice the cross-flow shedding rate with a free band alpha,
+ !!
+ !! d phi_x/dt = 2 (d phi/dt) [1 + alpha sin(phi_xd - phi_x)]
+ !!
+ !! phi_xd the phase of the in-line velocity x' = r'.v_n/U from x', x'' normalised by their
+ !! running RMS values, as phi_y.
+ !!
+ !! Stochastic synchronisation (Ulveseter, Thorsen, Saevik and Larsen, Mar. Struct. 56, 2017,
+ !! 260-280, Eq. 6 and Fig. 4): the band centre cF of a node becomes the slowly varying process
+ !!
+ !! F0(t) = cF + sum_i a sin(p_i + 2 pi f_i theta(t)), d theta/dt = U/D
+ !!
+ !! of N_f components with a flat spectrum up to c cF (f_i = (i - 1/2) c cF/N_f, a = sigma
+ !! sqrt(2/N_f), so F0 has the standard deviation sigma), each advancing at its non-dimensional
+ !! frequency times U/D as the shedding phase does, with random start phases p_i of the node
+ !! (CD_VIV_Sto_Node); the nodes are independent.
+ !!
!! Load convention (CableDyn_Hydro, CD_Cable_Dynamic_Load_Proc): `force` is the external
!! load; the Jacobians are residual contributions, -dF/d(node velocity) and
!! -dF/d(neighbour positions) through the node tangent. The wetted-fraction factor in C is
!! held at its current value in the Jacobians (it moves only for an element that crosses
!! the waterline); the residual itself is exact.
+ USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: INT64
USE CableDyn_Precision, ONLY: wp, CD_ZERO, CD_ONE
IMPLICIT NONE
PRIVATE
@@ -45,7 +68,22 @@ MODULE CableDyn_VIV
PUBLIC :: CD_VIV_Crossflow_Along
PUBLIC :: CD_VIV_Phase_Rate
PUBLIC :: CD_VIV_Mean_Square
+ PUBLIC :: CD_VIV_Mean_Square_Weight
+ PUBLIC :: CD_VIV_Filter_Linear
PUBLIC :: CD_VIV_Wrap_Phase
+ PUBLIC :: CD_VIV_Node_Inline
+ PUBLIC :: CD_VIV_Inline_Per_Length
+ PUBLIC :: CD_VIV_Inline_Phase_Rate
+ PUBLIC :: CD_VIV_Wake_Advance
+ PUBLIC :: CD_VIV_Amplitude_Update
+ PUBLIC :: CD_VIV_Table
+ PUBLIC :: CD_VIV_Check_Amp_Table
+ 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.
@@ -55,6 +93,41 @@ MODULE CableDyn_VIV
REAL(wp), PARAMETER, PUBLIC :: CD_VIV_DEFAULT_DF = 0.08_wp
REAL(wp), PARAMETER, PUBLIC :: CD_VIV_DEFAULT_CF = 0.18_wp
REAL(wp), PARAMETER, PUBLIC :: CD_VIV_TWO_PI = 6.283185307179586476925286766559005768394_wp
+ !> The in-line frequency band alpha of Ulveseter et al. (2018, Table 3) and Thorsen et al.
+ REAL(wp), PARAMETER, PUBLIC :: CD_VIV_DEFAULT_IL_ALPHA = 0.15_wp
+ !> The wake oscillator of Facchinetti, de Langre and Biolley (J. Fluids Struct. 19, 2004,
+ !> 123-140, Sec. 3): Strouhal number, reference lift coefficient C_L0, van der Pol parameter
+ !> epsilon and acceleration coupling A, fixed there from forced-wake data.
+ REAL(wp), PARAMETER, PUBLIC :: CD_VIV_WAKE_DEFAULT_ST = 0.2_wp
+ REAL(wp), PARAMETER, PUBLIC :: CD_VIV_WAKE_DEFAULT_CL0 = 0.3_wp
+ REAL(wp), PARAMETER, PUBLIC :: CD_VIV_WAKE_DEFAULT_EPS = 0.3_wp
+ REAL(wp), PARAMETER, PUBLIC :: CD_VIV_WAKE_DEFAULT_A = 12.0_wp
+ !> Rows of the per-node VIV motion statistics: the running mean squares of the cross-flow
+ !> velocity and acceleration (CD_VIV_NMS), and with an amplitude table (VIV AMPLITUDE section)
+ !> the four values of the amplitude estimate after them (CD_VIV_NMS_AMP; CD_VIV_Amplitude_Update).
+ !> With a flow frame as well (VIV FRAME section, filter time Tf > 0) the node's velocity low-pass
+ !> filtered over Tf follows them in rows 7:9 (CD_VIV_NMS_FRAME). The model layers append the step
+ !> predictor of the synchronisation model after these rows: the cross-flow phase rate at the
+ !> mid-point of the last step (and the in-line one after it with in-line VIV), from which the next
+ !> step predicts the phase its lift takes. On a wake-oscillator line row 2 holds the predictor
+ !> instead, the cross-flow acceleration at the mid-point of the last step.
+ INTEGER, PARAMETER, PUBLIC :: CD_VIV_NMS = 2
+ INTEGER, PARAMETER, PUBLIC :: CD_VIV_NMS_AMP = 6
+ INTEGER, PARAMETER, PUBLIC :: CD_VIV_NMS_FRAME = 9
+ !> The smoothing of the amplitude estimate per time step, k_a dt of Thorsen et al. (2016, Eq. 9).
+ REAL(wp), PARAMETER, PUBLIC :: CD_VIV_AMP_KDT = 0.1_wp
+ !> The most rows of one line type's amplitude table.
+ INTEGER, PARAMETER, PUBLIC :: CD_VIV_AMP_MAXP = 32
+ !> The most frequency components of the stochastic band centre of a node (CD_VIV_Sto_Node), and
+ !> 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
@@ -155,23 +228,33 @@ PURE SUBROUTINE CD_VIV_Node_Lift(r_prev, r_next, rd, u, coef, phi, force, ok, ja
jac_prev = -jac_next
END SUBROUTINE CD_VIV_Node_Lift
- PURE SUBROUTINE CD_VIV_Crossflow_Motion(r_prev, r_next, rd, rdd, u, yd, ydd, un, ok)
+ PURE SUBROUTINE CD_VIV_Crossflow_Motion(r_prev, r_next, rd, rdd, u, yd, ydd, un, ok, xd, xdd)
!! Cross-flow velocity y' and acceleration y'' of a node along e = q x v_n / U, and the
!! normal relative flow speed U. Both are zero when there is no normal flow (MoorDyn's
- !! normalisation of a zero vector).
+ !! normalisation of a zero vector). Optionally (both or neither) the in-line velocity x' and
+ !! acceleration x'' along v_n/U, zero in the same cases.
REAL(wp), INTENT(IN) :: r_prev(3), r_next(3), rd(3), rdd(3), u(3)
REAL(wp), INTENT(OUT) :: yd, ydd, un
LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), INTENT(OUT), OPTIONAL :: xd, xdd
REAL(wp) :: q(3), chord, vr(3), vn(3), e(3)
yd = CD_ZERO
ydd = CD_ZERO
+ IF (PRESENT(xd)) THEN
+ xd = CD_ZERO
+ xdd = CD_ZERO
+ END IF
CALL node_frame(r_prev, r_next, rd, u, q, chord, vr, vn, un, ok)
IF (.NOT. ok) RETURN
IF (.NOT. (un > CD_ZERO)) RETURN
e = cross3(q, vn)/un
yd = rd(1)*e(1) + rd(2)*e(2) + rd(3)*e(3)
ydd = rdd(1)*e(1) + rdd(2)*e(2) + rdd(3)*e(3)
+ IF (PRESENT(xd)) THEN
+ xd = (rd(1)*vn(1) + rd(2)*vn(2) + rd(3)*vn(3))/un
+ xdd = (rdd(1)*vn(1) + rdd(2)*vn(2) + rdd(3)*vn(3))/un
+ END IF
END SUBROUTINE CD_VIV_Crossflow_Motion
PURE SUBROUTINE CD_VIV_Lift_Per_Length(urel, rp, k, f, ok, jrel, jtan)
@@ -237,17 +320,23 @@ PURE SUBROUTINE CD_VIV_Lift_Per_Length(urel, rp, k, f, ok, jrel, jtan)
jtan = MATMUL(dfdt, proj)
END SUBROUTINE CD_VIV_Lift_Per_Length
- PURE SUBROUTINE CD_VIV_Crossflow_Along(tdir, rd, rdd, u, yd, ydd, un, ok)
+ PURE SUBROUTINE CD_VIV_Crossflow_Along(tdir, rd, rdd, u, yd, ydd, un, ok, xd, xdd)
!! CD_VIV_Crossflow_Motion with the line tangent given directly (tdir, any length: the
- !! slope DOFs of a finite-EI node) instead of the chord of two neighbours.
+ !! slope DOFs of a finite-EI node) instead of the chord of two neighbours, with the same
+ !! optional in-line velocity and acceleration (both or neither).
REAL(wp), INTENT(IN) :: tdir(3), rd(3), rdd(3), u(3)
REAL(wp), INTENT(OUT) :: yd, ydd, un
LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), INTENT(OUT), OPTIONAL :: xd, xdd
REAL(wp) :: speed, t(3), vr(3), vn(3), e(3)
yd = CD_ZERO
ydd = CD_ZERO
un = CD_ZERO
+ IF (PRESENT(xd)) THEN
+ xd = CD_ZERO
+ xdd = CD_ZERO
+ END IF
speed = SQRT(tdir(1)*tdir(1) + tdir(2)*tdir(2) + tdir(3)*tdir(3))
ok = speed > TINY_CHORD
IF (.NOT. ok) RETURN
@@ -259,15 +348,44 @@ PURE SUBROUTINE CD_VIV_Crossflow_Along(tdir, rd, rdd, u, yd, ydd, un, ok)
e = cross3(t, vn)/un
yd = rd(1)*e(1) + rd(2)*e(2) + rd(3)*e(3)
ydd = rdd(1)*e(1) + rdd(2)*e(2) + rdd(3)*e(3)
+ IF (PRESENT(xd)) THEN
+ xd = (rd(1)*vn(1) + rd(2)*vn(2) + rd(3)*vn(3))/un
+ xdd = (rdd(1)*vn(1) + rdd(2)*vn(2) + rdd(3)*vn(3))/un
+ END IF
END SUBROUTINE CD_VIV_Crossflow_Along
ELEMENTAL REAL(wp) FUNCTION CD_VIV_Mean_Square(ms_old, sample, weight) RESULT(ms)
!! One step of the running mean square, ms_old + weight (sample^2 - ms_old); weight =
- !! 1/n_m is MoorDyn's ((n_m - 1) old^2 + new^2)/n_m.
+ !! 1/n_m is MoorDyn's ((n_m - 1) old^2 + new^2)/n_m, and 1 - exp(-h) over a time h T_w
+ !! (CD_VIV_Mean_Square_Weight) the exact average over that time of a sample held there.
REAL(wp), INTENT(IN) :: ms_old, sample, weight
ms = ms_old + weight*(sample*sample - ms_old)
END FUNCTION CD_VIV_Mean_Square
+ ELEMENTAL REAL(wp) FUNCTION CD_VIV_Mean_Square_Weight(h) RESULT(w)
+ !! The weight 1 - exp(-h) of CD_VIV_Mean_Square over a time h T_w: the running mean square is
+ !! the first-order filter d ms/dt = (s^2 - ms)/T_w of the squared sample s^2, and with the
+ !! sample at the interval's mid-point it advances by the mid-point rule (second order).
+ REAL(wp), INTENT(IN) :: h
+ w = CD_ONE - EXP(-h)
+ END FUNCTION CD_VIV_Mean_Square_Weight
+
+ ELEMENTAL REAL(wp) FUNCTION CD_VIV_Filter_Linear(xbar, x0, x1, h) RESULT(xn)
+ !! The first-order low-pass filter d xbar/dt = (x - xbar)/T_f over a time h T_f, exact for the
+ !! input linear from x0 to x1 over it (the converged velocities of a step): exp(-h) xbar +
+ !! (1 - exp(-h)) x0 + c (x1 - x0), c = 1 - (1 - exp(-h))/h (h/2 - h^2/6 below h = 1e-4, where the
+ !! difference loses its digits). The limits: x1 as h grows, xbar as h vanishes.
+ REAL(wp), INTENT(IN) :: xbar, x0, x1, h
+ REAL(wp) :: e, c
+ e = EXP(-h)
+ IF (h < 1.0e-4_wp) THEN
+ c = h*(0.5_wp - h/6.0_wp)
+ ELSE
+ c = CD_ONE - (CD_ONE - e)/h
+ END IF
+ xn = e*xbar + (CD_ONE - e)*x0 + c*(x1 - x0)
+ END FUNCTION CD_VIV_Filter_Linear
+
PURE REAL(wp) FUNCTION CD_VIV_Phase_Rate(yd, ydd, ms_yd, ms_ydd, phi, un, diameter, cf, df, phi_rest) RESULT(rate)
!! Rate of the vortex-shedding phase, d phi/dt = 2 pi (cF + dF sin(phi_y - phi)) U/D, with
!! the cross-flow velocity phase phi_y from y', y'' normalised by their running RMS values
@@ -276,20 +394,445 @@ PURE REAL(wp) FUNCTION CD_VIV_Phase_Rate(yd, ydd, ms_yd, ms_ydd, phi, un, diamet
!! tangent runs against MoorDyn's, which turns the cross-flow axis and so phi_y half a turn.
REAL(wp), INTENT(IN) :: yd, ydd, ms_yd, ms_ydd, phi, un, diameter, cf, df
REAL(wp), INTENT(IN), OPTIONAL :: phi_rest
- REAL(wp) :: phi_y
+ REAL(wp) :: phi_y, rest
- IF (.NOT. (ABS(yd) > CD_ZERO .OR. ABS(ydd) > CD_ZERO)) THEN
- phi_y = CD_ZERO
- IF (PRESENT(phi_rest)) phi_y = phi_rest
- ELSE IF (ms_yd > CD_ZERO .AND. ms_ydd > CD_ZERO) THEN
- phi_y = ATAN2(-ydd/SQRT(ms_ydd), yd/SQRT(ms_yd))
- ELSE
- phi_y = ATAN2(-ydd, yd)
- END IF
- IF (phi_y < CD_ZERO) phi_y = phi_y + CD_VIV_TWO_PI
+ rest = CD_ZERO
+ IF (PRESENT(phi_rest)) rest = phi_rest
+ phi_y = motion_phase(yd, ydd, ms_yd, ms_ydd, rest)
rate = CD_VIV_TWO_PI*(cf + df*SIN(phi_y - phi))*un/diameter
END FUNCTION CD_VIV_Phase_Rate
+ PURE REAL(wp) FUNCTION CD_VIV_Inline_Phase_Rate(xd, xdd, ms_xd, ms_xdd, phi_x, rate_y, alpha) RESULT(rate)
+ !! Rate of the in-line shedding phase, d phi_x/dt = 2 rate_y [1 + alpha sin(phi_xd - phi_x)]
+ !! (Ulveseter et al. 2018, Eq. 6), rate_y the cross-flow shedding rate (CD_VIV_Phase_Rate) and
+ !! phi_xd the phase of the in-line velocity from x', x'' as the cross-flow one; a node with no
+ !! in-line motion takes phi_xd = 0.
+ REAL(wp), INTENT(IN) :: xd, xdd, ms_xd, ms_xdd, phi_x, rate_y, alpha
+ rate = 2.0_wp*rate_y*(CD_ONE + alpha*SIN(motion_phase(xd, xdd, ms_xd, ms_xdd, CD_ZERO) - phi_x))
+ END FUNCTION CD_VIV_Inline_Phase_Rate
+
+ PURE REAL(wp) FUNCTION motion_phase(sd, sdd, ms_sd, ms_sdd, rest) RESULT(ph)
+ !! The phase of a velocity in [0, 2 pi), atan2(-s''/rms(s''), s'/rms(s')), unnormalised while
+ !! either mean square is still zero (MoorDyn), and rest for a node with no motion.
+ REAL(wp), INTENT(IN) :: sd, sdd, ms_sd, ms_sdd, rest
+ IF (.NOT. (ABS(sd) > CD_ZERO .OR. ABS(sdd) > CD_ZERO)) THEN
+ ph = rest
+ ELSE IF (ms_sd > CD_ZERO .AND. ms_sdd > CD_ZERO) THEN
+ ph = ATAN2(-sdd/SQRT(ms_sdd), sd/SQRT(ms_sd))
+ ELSE
+ ph = ATAN2(-sdd, sd)
+ END IF
+ IF (ph < CD_ZERO) ph = ph + CD_VIV_TWO_PI
+ END FUNCTION motion_phase
+
+ PURE SUBROUTINE CD_VIV_Node_Inline(r_prev, r_next, rd, u, coef, phi_x, force, ok, jac_v, jac_prev, jac_next)
+ !! In-line shedding force on one node, F = coef cos(phi_x) U v_n, and optionally its residual
+ !! Jacobians (all three present or none) in CD_VIV_Node_Lift's convention: jac_v = -dF/dr',
+ !! jac_prev = -dF/dr_prev, jac_next = -dF/dr_next. ok = .FALSE. (and F = 0) when the two
+ !! neighbours coincide.
+ REAL(wp), INTENT(IN) :: r_prev(3), r_next(3), rd(3), u(3), coef, phi_x
+ REAL(wp), INTENT(OUT) :: force(3)
+ LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), INTENT(OUT), OPTIONAL :: jac_v(3, 3), jac_prev(3, 3), jac_next(3, 3)
+ REAL(wp) :: q(3), chord, vr(3), vn(3), un, s, dfdv(3, 3), dfdq(3, 3), proj(3, 3)
+ INTEGER :: i, j
+
+ force = CD_ZERO
+ IF (PRESENT(jac_v)) THEN
+ jac_v = CD_ZERO
+ jac_prev = CD_ZERO
+ jac_next = CD_ZERO
+ END IF
+ CALL node_frame(r_prev, r_next, rd, u, q, chord, vr, vn, un, ok)
+ IF (.NOT. ok) RETURN
+ s = coef*COS(phi_x)
+ force = (s*un)*vn
+ IF (.NOT. PRESENT(jac_v)) RETURN
+ IF (.NOT. (un > CD_ZERO)) RETURN
+ ! dF/dv_r and dF/dq of F = s U v_n (inline_jacobians); dr' enters v_r with a minus sign
+ CALL inline_jacobians(s, q, vr, vn, un, dfdv, dfdq)
+ jac_v = dfdv
+ DO j = 1, 3
+ DO i = 1, 3
+ proj(i, j) = -q(i)*q(j)/chord
+ END DO
+ proj(j, j) = proj(j, j) + CD_ONE/chord
+ END DO
+ jac_next = -MATMUL(dfdq, proj)
+ jac_prev = -jac_next
+ END SUBROUTINE CD_VIV_Node_Inline
+
+ PURE SUBROUTINE CD_VIV_Inline_Per_Length(urel, rp, k, f, ok, jrel, jtan)
+ !! In-line shedding force per unit length of a cable centreline point, f = k U v_n with
+ !! k = 1/2 rho D C_vx cos(phi_x), the unit tangent t = rp/|rp|, the relative flow v_r = urel,
+ !! its normal part v_n and speed U; optionally (both or neither) jrel = df/dv_r and
+ !! jtan = df/drp, as CD_VIV_Lift_Per_Length. ok = .FALSE. (and f = 0) for a degenerate
+ !! centreline; f and its derivatives vanish with the normal flow.
+ REAL(wp), INTENT(IN) :: urel(3), rp(3), k
+ REAL(wp), INTENT(OUT) :: f(3)
+ LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), INTENT(OUT), OPTIONAL :: jrel(3, 3), jtan(3, 3)
+ REAL(wp) :: speed, t(3), vn(3), un, dfdt(3, 3), proj(3, 3)
+ INTEGER :: i, j
+
+ f = CD_ZERO
+ IF (PRESENT(jrel)) THEN
+ jrel = CD_ZERO
+ jtan = CD_ZERO
+ END IF
+ speed = SQRT(rp(1)*rp(1) + rp(2)*rp(2) + rp(3)*rp(3))
+ ok = speed > TINY_CHORD
+ IF (.NOT. ok) RETURN
+ t = rp/speed
+ vn = urel - (t(1)*urel(1) + t(2)*urel(2) + t(3)*urel(3))*t
+ un = SQRT(vn(1)*vn(1) + vn(2)*vn(2) + vn(3)*vn(3))
+ f = (k*un)*vn
+ IF (.NOT. PRESENT(jrel)) RETURN
+ IF (.NOT. (un > CD_ZERO)) RETURN
+ CALL inline_jacobians(k, t, urel, vn, un, jrel, dfdt)
+ DO j = 1, 3
+ DO i = 1, 3
+ proj(i, j) = -t(i)*t(j)/speed
+ END DO
+ proj(j, j) = proj(j, j) + CD_ONE/speed
+ END DO
+ jtan = MATMUL(dfdt, proj)
+ END SUBROUTINE CD_VIV_Inline_Per_Length
+
+ PURE SUBROUTINE inline_jacobians(s, t, vr, vn, un, dfdv, dfdt)
+ !! Derivatives of F = s U v_n, v_n = (I - t t^T) v_r, U = |v_n| > 0, with respect to the
+ !! relative flow and the unit tangent: dF/dv_r = s [v_n (x) v_n/U + U (I - t t^T)] and, with
+ !! alpha = t.v_r (dv_n/dt = -(alpha I + t (x) v_r), dU/dt = -alpha v_n/U as v_n.t = 0),
+ !! dF/dt = -s [alpha v_n (x) v_n/U + U (alpha I + t (x) v_r)].
+ REAL(wp), INTENT(IN) :: s, t(3), vr(3), vn(3), un
+ REAL(wp), INTENT(OUT) :: dfdv(3, 3), dfdt(3, 3)
+ REAL(wp) :: alpha
+ INTEGER :: i, j
+ alpha = t(1)*vr(1) + t(2)*vr(2) + t(3)*vr(3)
+ DO j = 1, 3
+ DO i = 1, 3
+ dfdv(i, j) = s*(vn(i)*vn(j)/un - un*t(i)*t(j))
+ dfdt(i, j) = -s*(alpha*vn(i)*vn(j)/un + un*t(i)*vr(j))
+ END DO
+ dfdv(j, j) = dfdv(j, j) + s*un
+ dfdt(j, j) = dfdt(j, j) - s*un*alpha
+ END DO
+ END SUBROUTINE inline_jacobians
+
+ PURE SUBROUTINE CD_VIV_Wake_Advance(s, om, eps, ad, f0, f1, h)
+ !! Advance the wake oscillator of Facchinetti et al. (2004, Eq. 5 with the acceleration
+ !! coupling F = A Y''/D; Violette et al., J. Fluids Struct. 26, 2010, Eq. 3) over a time h:
+ !!
+ !! q'' + eps om (q^2 - 1) q' + om^2 q = ad y''(t)
+ !!
+ !! s = (q, q'), om the wake frequency 2 pi St U/D, ad = A/D and the cross-flow acceleration
+ !! y'' of the line, taken linear from f0 at the start of the interval to f1 at its end.
+ !! Classical Runge-Kutta in equal sub-steps of r dt <= 0.1 (at least one), r = om max(1,
+ !! eps q^2) the faster of the oscillation and the van der Pol damping rate eps om (q^2 - 1) at
+ !! the start of the interval, so the error is that of a resolved oscillation however long h is
+ !! against the wake period and however large eps is. Should the rate at a sub-step exceed
+ !! 0.2/dt (q grown on the way) or the result not be finite, the interval is redone from its
+ !! start with twice the sub-steps. q = 2 C_L/C_L0: the free oscillator settles on its limit
+ !! cycle q = 2 cos(om t), the lift of a fixed cylinder.
+ REAL(wp), INTENT(INOUT) :: s(2)
+ REAL(wp), INTENT(IN) :: om, eps, ad, f0, f1, h
+ INTEGER :: n, i, attempt
+ REAL(wp) :: dt, t, k1(2), k2(2), k3(2), k4(2), s0(2)
+ LOGICAL :: ok
+ IF (.NOT. (h > CD_ZERO)) RETURN
+ s0 = s
+ n = MAX(1, CEILING(MIN(rate(s0)*h/0.1_wp, 1.0e6_wp)))
+ DO attempt = 1, 24
+ s = s0
+ dt = h/REAL(n, wp)
+ ok = .TRUE.
+ DO i = 0, n - 1
+ IF (rate(s)*dt > 0.2_wp .AND. n < 1000000) THEN
+ ok = .FALSE.
+ EXIT
+ END IF
+ t = REAL(i, wp)*dt
+ k1 = rhs(s, t)
+ k2 = rhs(s + 0.5_wp*dt*k1, t + 0.5_wp*dt)
+ k3 = rhs(s + 0.5_wp*dt*k2, t + 0.5_wp*dt)
+ k4 = rhs(s + dt*k3, t + dt)
+ s = s + (dt/6.0_wp)*(k1 + 2.0_wp*k2 + 2.0_wp*k3 + k4)
+ END DO
+ IF (ok) ok = ABS(s(1)) <= HUGE(s(1)) .AND. ABS(s(2)) <= HUGE(s(2))
+ IF (ok .OR. n >= 1000000) EXIT
+ n = MIN(2*n, 1000000)
+ END DO
+ CONTAINS
+ PURE REAL(wp) FUNCTION rate(x) RESULT(r)
+ !! The faster of the oscillation and the damping rate of state x (finite or not).
+ REAL(wp), INTENT(IN) :: x(2)
+ r = ABS(om)*MAX(CD_ONE, eps*x(1)*x(1))
+ IF (.NOT. (r <= HUGE(r))) r = HUGE(r)
+ END FUNCTION rate
+ PURE FUNCTION rhs(x, tau) RESULT(d)
+ REAL(wp), INTENT(IN) :: x(2), tau
+ REAL(wp) :: d(2)
+ d(1) = x(2)
+ d(2) = ad*(f0 + (f1 - f0)*tau/h) - eps*om*(x(1)*x(1) - CD_ONE)*x(2) - om*om*x(1)
+ END FUNCTION rhs
+ END SUBROUTINE CD_VIV_Wake_Advance
+
+ PURE SUBROUTINE CD_VIV_Amplitude_Update(st, yd, dt)
+ !! One time step dt of the cross-flow amplitude estimate of Thorsen, Saevik and Larsen
+ !! (J. Fluids Struct. 61, 2016, Eq. 8 and 9) at a node, with the cross-flow velocity yd at the
+ !! end of the step. st = (s, y0, y0s, yd_last):
+ !!
+ !! s the travel since the last zero crossing of y', signed: int y' dt (trapezoidal),
+ !! which is +-int |y'| dt as y' keeps its sign between crossings, and whose sign
+ !! is that of the half cycle
+ !! y0 the amplitude |s|/2 of the last half cycle, set at each zero crossing of y' (the
+ !! node travels 2 y0 between two crossings of a narrow-band response, Eq. 8)
+ !! y0s the smoothed amplitude, y0s + k_a dt (y0 - y0s) per step (Eq. 9, k_a = 0.1/dt)
+ !! yd_last y' at the start of the step
+ !!
+ !! A crossing is a change of sign of y' from that of the running half cycle: of yd_last, or
+ !! after samples at y' = 0 the sign of s, so a reversal through a sample at zero (+1, 0, -1)
+ !! ends the half cycle there and a touch (+1, 0, +1) does not. A crossing inside the step is
+ !! placed by linear interpolation of y', and the travel splits there between the half cycle
+ !! it ends and the next.
+ REAL(wp), INTENT(INOUT) :: st(4)
+ REAL(wp), INTENT(IN) :: yd, dt
+ REAL(wp) :: y_old, theta, p
+ IF (.NOT. (dt > CD_ZERO)) RETURN
+ y_old = st(4)
+ p = y_old
+ IF (ABS(p) <= CD_ZERO) p = st(1)
+ IF ((p > CD_ZERO .AND. yd < CD_ZERO) .OR. (p < CD_ZERO .AND. yd > CD_ZERO)) THEN
+ ! theta = 0 when the step starts on the sample at zero that ends the half cycle
+ theta = y_old/(y_old - yd)
+ st(1) = st(1) + 0.5_wp*y_old*theta*dt
+ st(2) = 0.5_wp*ABS(st(1))
+ st(1) = 0.5_wp*yd*(CD_ONE - theta)*dt
+ ELSE
+ st(1) = st(1) + 0.5_wp*(y_old + yd)*dt
+ END IF
+ st(3) = st(3) + CD_VIV_AMP_KDT*(st(2) - st(3))
+ st(4) = yd
+ END SUBROUTINE CD_VIV_Amplitude_Update
+
+ PURE REAL(wp) FUNCTION CD_VIV_Ambient_Crossflow_Rate(tdir, rd, u) RESULT(yd)
+ !! The cross-flow velocity of a node across the AMBIENT flow, the y' of the amplitude estimate
+ !! (Thorsen et al. 2016, Fig. 1: y across the incoming flow): rd . (t x u_n)/|u_n|, with t the
+ !! unit line tangent along tdir and u_n the ambient velocity u normal to it; 0 without ambient
+ !! normal flow or with a degenerate tangent. Unlike the cross-flow axis of the phase (across the
+ !! relative flow), this axis does not turn with the node's own velocity, which at a response
+ !! velocity comparable to the flow would shorten the projected velocity by U/|v_n|.
+ REAL(wp), INTENT(IN) :: tdir(3), rd(3), u(3)
+ REAL(wp) :: t(3), un(3), s, e(3)
+ yd = CD_ZERO
+ s = SQRT(tdir(1)*tdir(1) + tdir(2)*tdir(2) + tdir(3)*tdir(3))
+ IF (.NOT. (s > TINY_CHORD)) RETURN
+ t = tdir/s
+ un = u - (t(1)*u(1) + t(2)*u(2) + t(3)*u(3))*t
+ s = SQRT(un(1)*un(1) + un(2)*un(2) + un(3)*un(3))
+ IF (.NOT. (s > CD_ZERO)) RETURN
+ e = cross3(t, un)/s
+ yd = rd(1)*e(1) + rd(2)*e(2) + rd(3)*e(3)
+ END FUNCTION CD_VIV_Ambient_Crossflow_Rate
+
+ PURE SUBROUTINE CD_VIV_Check_Amp_Table(amp, amp_n, cl, msg)
+ !! Check the per-element amplitude tables of a line (CD_VIV_Amplitude_Update): amp (3,
+ !! CD_VIV_AMP_MAXP, n_elem) holds amp_n(e) rows (A/D, C_v, drag factor) of element e, cl the
+ !! element lift coefficients. msg is blank when the tables are valid: amp_n in [0,
+ !! CD_VIV_AMP_MAXP], > 0 only where cl > 0, the used rows finite with A/D >= 0 strictly
+ !! increasing, C_v >= 0 and the drag factor > 0, each at most 1e15.
+ REAL(wp), INTENT(IN) :: amp(:, :, :), cl(:)
+ INTEGER, INTENT(IN) :: amp_n(:)
+ CHARACTER(*), INTENT(OUT) :: msg
+ INTEGER :: e, n, i
+ REAL(wp) :: prev
+ REAL(wp), PARAMETER :: big = 1.0e15_wp
+ msg = ''
+ IF (SIZE(amp, 1) /= 3 .OR. SIZE(amp, 2) /= CD_VIV_AMP_MAXP .OR. SIZE(amp, 3) /= SIZE(cl) .OR. &
+ SIZE(amp_n) /= SIZE(cl)) THEN
+ msg = 'VIV amplitude tables must have shapes (3, 32, n_elem) and (n_elem)'
+ RETURN
+ END IF
+ DO e = 1, SIZE(cl)
+ n = amp_n(e)
+ IF (n < 0 .OR. n > CD_VIV_AMP_MAXP) THEN
+ msg = 'a VIV amplitude table holds 0 to 32 rows'
+ RETURN
+ END IF
+ IF (n == 0) CYCLE
+ IF (.NOT. (cl(e) > CD_ZERO)) THEN
+ msg = 'a VIV amplitude table needs the cross-flow lift (cl > 0) on its element'
+ RETURN
+ END IF
+ ! the previous row's A/D; below every valid first row, which the range check holds at >= 0
+ prev = -CD_ONE
+ DO i = 1, n
+ IF (.NOT. (amp(1, i, e) >= CD_ZERO .AND. amp(1, i, e) <= big .AND. amp(2, i, e) >= CD_ZERO .AND. &
+ amp(2, i, e) <= big .AND. amp(3, i, e) > CD_ZERO .AND. amp(3, i, e) <= big)) THEN
+ msg = 'VIV amplitude table rows need finite A/D >= 0, C_v >= 0 and drag factor > 0, each at most 1e15'
+ RETURN
+ END IF
+ IF (.NOT. (amp(1, i, e) > prev)) THEN
+ msg = 'the A/D of a VIV amplitude table must increase strictly'
+ RETURN
+ END IF
+ prev = amp(1, i, e)
+ END DO
+ END DO
+ END SUBROUTINE CD_VIV_Check_Amp_Table
+
+ PURE REAL(wp) FUNCTION CD_VIV_Table(x, xs, ys) RESULT(y)
+ !! Piecewise-linear interpolation of the table (xs, ys) at x, xs strictly increasing, held
+ !! at the end values outside [xs(1), xs(n)]; a one-row table is constant.
+ REAL(wp), INTENT(IN) :: x, xs(:), ys(:)
+ INTEGER :: n, i
+ n = SIZE(xs)
+ IF (n < 1) THEN
+ y = CD_ZERO
+ RETURN
+ END IF
+ IF (n == 1 .OR. x <= xs(1)) THEN
+ y = ys(1)
+ RETURN
+ END IF
+ IF (x >= xs(n)) THEN
+ y = ys(n)
+ RETURN
+ END IF
+ ! The search stops at the last segment (i = n) also for an x that compares false with
+ ! every row (NaN), which then propagates instead of indexing past the table.
+ DO i = 2, n - 1
+ IF (x <= xs(i)) EXIT
+ END DO
+ y = ys(i - 1) + (ys(i) - ys(i - 1))*(x - xs(i - 1))/(xs(i) - xs(i - 1))
+ END FUNCTION CD_VIV_Table
+
+ PURE SUBROUTINE CD_VIV_Sto_Node(sigma, c, cf, nf, seed, node, a, fhat, p0)
+ !! The stochastic band centre of a node (Ulveseter et al. 2017, Eq. 6, Fig. 4): nf components of
+ !! a flat spectrum of variance sigma^2 over (0, c cf], at the mid-points f_i = (i - 1/2) c cf/nf
+ !! of its nf intervals, each of amplitude a = sigma sqrt(2/nf), with start phases p0 uniform in
+ !! [0, 2 pi) drawn from a minimal-standard (Park-Miller) stream that the integer seed (0 to
+ !! 2^31 - 2) and the node number select, so a run repeats its realisation and two nodes
+ !! differ. fhat and p0 are filled in 1:nf.
+ REAL(wp), INTENT(IN) :: sigma, c, cf
+ INTEGER, INTENT(IN) :: nf, seed, node
+ REAL(wp), INTENT(OUT) :: a, fhat(:), p0(:)
+ INTEGER(INT64), PARAMETER :: M = 2147483647_INT64, MUL = 48271_INT64
+ INTEGER(INT64) :: state
+ INTEGER :: i
+ a = sigma*SQRT(2.0_wp/REAL(nf, wp))
+ state = MOD(INT(seed, INT64)*69621_INT64 + INT(node, INT64)*16807_INT64 + 1_INT64, M - 1_INT64) + 1_INT64
+ DO i = 1, 3
+ state = MOD(MUL*state, M)
+ END DO
+ DO i = 1, nf
+ fhat(i) = (REAL(i, wp) - 0.5_wp)*c*cf/REAL(nf, wp)
+ state = MOD(MUL*state, M)
+ p0(i) = CD_VIV_TWO_PI*REAL(state - 1_INT64, wp)/REAL(M - 1_INT64, wp)
+ END DO
+ END SUBROUTINE CD_VIV_Sto_Node
+
+ PURE REAL(wp) FUNCTION CD_VIV_Sto_Centre(cf, a, fhat, p0, theta) RESULT(centre)
+ !! The band centre cF + sum_i a sin(p0_i + 2 pi fhat_i theta) at the node's travelled
+ !! non-dimensional distance theta = integral U/D dt (CD_VIV_Sto_Node).
+ REAL(wp), INTENT(IN) :: cf, a, fhat(:), p0(:), theta
+ 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
+ ! 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
+ ! 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/src/openfast/CableDyn_OF.f90 b/src/openfast/CableDyn_OF.f90
index 5cda9ff2..51d158d7 100644
--- a/src/openfast/CableDyn_OF.f90
+++ b/src/openfast/CableDyn_OF.f90
@@ -99,6 +99,7 @@ MODULE CableDyn
CD_AGG_NTurbines, CD_AGG_TurbineOfMoving, &
CD_AGG_NFluidNodes, CD_AGG_GetFluidNodePositions, CD_AGG_SetFluidFields, &
CD_AGG_NumChannels, CD_AGG_ChannelHeader, CD_AGG_EvalChannel, &
+ CD_AGG_EvalChannels, &
CD_AGG_GetInitMetadata, CD_AGG_GetInitLine, &
CD_AGG_WriteStaticProfile, CD_AGG_Range_Graphs, CD_AGG_Range_Sample, &
CD_AGG_Range_Write, CD_AGG_Range_MirrorSize, CD_AGG_Reopen_Start, &
@@ -149,7 +150,7 @@ MODULE CableDyn
! the kinds of first-order linearization state (lin_state_map)
INTEGER(IntKi), PARAMETER :: LIN1_VE = 1, LIN1_SYROPE = 2
- TYPE(ProgDesc), PARAMETER :: CableDyn_ProgDesc = ProgDesc( 'CableDyn', 'v0.4.2', '2026-11-09' )
+ TYPE(ProgDesc), PARAMETER :: CableDyn_ProgDesc = ProgDesc( 'CableDyn', 'v0.4.3', '2026-11-20' )
INTERFACE
! 1 when the CableDyn core targets x86-64-v3 (CABLEDYN_TARGET_AVX2) and carries the
! start-up processor check of src/cabledyn_cpu_guard.c; the reference also keeps that
@@ -201,6 +202,8 @@ END FUNCTION cd_cpu_guard_armed
LOGICAL :: loads_cached = .FALSE.
INTEGER(IntKi) :: loads_at_n = -1
REAL(wp), ALLOCATABLE :: ws_chan(:)
+ ! the committed-step row of the .CD.out when it evaluates its own channels (CD_CalcOutput)
+ REAL(wp), ALLOCATABLE :: ws_rowchan(:)
! Load predictor (nsuper > 1 with predictLoads; CableDyn_LoadPredictor): the coupled
! loads and moments of the committed solve before the last and its time (pred_t < 0:
! none), shifted in by CD_UpdateStates when a mooring step starts and mirrored into the
@@ -245,6 +248,8 @@ END FUNCTION cd_cpu_guard_armed
INTEGER(IntKi) :: native_wrote_n = -123456789
REAL(DbKi) :: native_wrote_t = 0.0_DbKi
LOGICAL :: native_pending = .FALSE.
+ ! glue steps per .CD.out row: nsuper times the CableDyn steps of OPTION CDOutDt (1 without it)
+ INTEGER(IntKi) :: native_every = 1
CHARACTER(1024) :: native_root = ''
! Range graphs (LINES flag r): sampled by the aggregate once per committed mooring step
! (sample_range); ws_range is the double-precision transfer buffer to the OtherState
@@ -513,6 +518,30 @@ SUBROUTINE restore_native_outputs( id, old_id, root, t_start, restart_serial, Er
Inst(old_id)%native_pending = .FALSE.
END SUBROUTINE restore_native_outputs
+ SUBROUTINE set_native_every( inst_e, ErrStat, ErrMsg )
+ !! Glue steps per .CD.out row from OPTION CDOutDt: nsuper (a row after every committed
+ !! CableDyn step) without it, nsuper times its whole number of CableDyn steps with it.
+ TYPE(CD_OF_Instance), INTENT(INOUT) :: inst_e
+ INTEGER(IntKi), INTENT(OUT) :: ErrStat
+ CHARACTER(*), INTENT(OUT) :: ErrMsg
+ REAL(wp) :: ratio
+ INTEGER(IntKi) :: k
+ ErrStat = ErrID_None
+ ErrMsg = ''
+ inst_e%native_every = MAX(1_IntKi, inst_e%nsuper)
+ IF (.NOT. (inst_e%agg%cd_out_dt > 0.0_wp)) RETURN
+ ratio = inst_e%agg%cd_out_dt/inst_e%dt_moor
+ k = NINT(ratio, IntKi)
+ IF (k < 1_IntKi .OR. ABS(ratio - REAL(k, wp)) > 1.0E-6_wp*MAX(1.0_wp, ratio)) THEN
+ CALL SetErrStat( ErrID_Fatal, 'CableDyn mooring module: OPTIONS CDOutDt = '// &
+ TRIM(Num2LStr(REAL(inst_e%agg%cd_out_dt, DbKi)))//' s is not a whole multiple of '// &
+ 'the CableDyn step '//TRIM(Num2LStr(REAL(inst_e%dt_moor, DbKi)))//' s (dtM, or DT '// &
+ 'when the deck omits dtM).', ErrStat, ErrMsg, 'set_native_every' )
+ RETURN
+ END IF
+ inst_e%native_every = k*MAX(1_IntKi, inst_e%nsuper)
+ END SUBROUTINE set_native_every
+
SUBROUTINE resume_after_rewind( inst_e, other, ErrStat, ErrMsg )
!! The run takes a step from a restored state that lies before its last commit: the rows
!! and the range samples past the restored commit now belong to an abandoned branch.
@@ -542,6 +571,17 @@ SUBROUTINE resume_after_rewind( inst_e, other, ErrStat, ErrMsg )
ErrStat, ErrMsg, RoutineName )
RETURN
END IF
+ ! the rows past the restored commit: one per CableDyn step, or one per CDOutDt (at the whole
+ ! multiples of native_every/nsuper CableDyn steps)
+ IF (inst_e%native_every > inst_e%nsuper) THEN
+ BLOCK
+ INTEGER(IntKi) :: n_wrote, n_commit, k_row
+ k_row = inst_e%native_every/inst_e%nsuper
+ n_wrote = NINT(inst_e%native_wrote_t/REAL(inst_e%dt_moor, DbKi), IntKi)
+ n_commit = n_wrote - ntrim
+ ntrim = n_wrote/k_row - MAX(n_commit, 0_IntKi)/k_row
+ END BLOCK
+ END IF
DO k = 1, ntrim
BACKSPACE (inst_e%native_un, IOSTAT=ios)
IF (ios /= 0) THEN
@@ -954,6 +994,13 @@ SUBROUTINE CD_Init(InitInp, u, p, x, xd, z, other, y, m, DTcoupling, InitOut, Er
Inst(id)%nsuper = nsuper
Inst(id)%dt_moor = dt_moor
Inst(id)%use_extfluid = use_extf
+ CALL set_native_every( Inst(id), ErrStat2, ErrMsg2 )
+ CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
+ IF (ErrStat >= AbortErrLev) RETURN
+ IF (Inst(id)%native_every > Inst(id)%nsuper) &
+ CALL WrScr( ' CableDyn: the .CD.out record takes a row every '// &
+ TRIM(Num2LStr(REAL(Inst(id)%agg%cd_out_dt, DbKi)))//' s (OPTIONS CDOutDt), every '// &
+ TRIM(Num2LStr(Inst(id)%native_every/Inst(id)%nsuper))//' CableDyn steps.' )
IF (nsuper > 1_IntKi) THEN
IF (Inst(id)%agg%predict_loads) THEN
CALL WrScr( ' CableDyn: between dtM solves the coupled loads are extrapolated from the last two '// &
@@ -1654,6 +1701,9 @@ SUBROUTINE rebuild_from_checkpoint( t, u1, p, x, other, m, ErrStat, ErrMsg )
Inst(id)%nlines = nlines
Inst(id)%nsuper = MAX(1_IntKi, NINT(p%dtM0/p%dtCoupling, IntKi))
Inst(id)%dt_moor = REAL(p%dtM0, wp)
+ CALL set_native_every( Inst(id), ErrStat2, ErrMsg2 )
+ CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
+ IF (ErrStat >= AbortErrLev) RETURN
ALLOCATE (Inst(id)%ws_pos(3, ncp), Inst(id)%ws_vel(3, ncp), Inst(id)%ws_acc(3, ncp), &
Inst(id)%ws_fld(3, ncp), Inst(id)%ws_moment(3, ncp), Inst(id)%ws_orient(3, 3, ncp), &
Inst(id)%ws_omega(3, ncp), Inst(id)%ws_alpha(3, ncp), &
@@ -2048,7 +2098,9 @@ SUBROUTINE CD_UpdateStates( t, n, u, t_array, p, x, xd, z, other, m, ErrStat, Er
! cache is invalidated on every successful advance (bit-identical for the
! normal path -- last_solve_n moved anyway -- and correct for corrections).
Inst(id)%loads_cached = .FALSE.
- Inst(id)%native_pending = Inst(id)%native_un > 0_IntKi
+ ! (a row at every native_every-th glue step: OPTIONS CDOutDt)
+ Inst(id)%native_pending = Inst(id)%native_un > 0_IntKi .AND. &
+ MOD(n + 1_IntKi, Inst(id)%native_every) == 0_IntKi
! commit the restart clock: the state now committed corresponds to the END
! of this mooring interval. The advance runs on the LAST glue substep, so
! the interval end is t + dtCoupling (t + dt_moor from here overshoots by
@@ -2553,13 +2605,14 @@ SUBROUTINE CD_CalcOutput( t, u, p, x, xd, z, other, y, m, ErrStat, ErrMsg )
CHARACTER(*) , INTENT(INOUT) :: ErrMsg
character(*), parameter :: RoutineName = 'CD_CalcOutput'
- INTEGER(IntKi) :: ErrStat2, es, id, i
+ INTEGER(IntKi) :: ErrStat2, es, id, i, n_chan
INTEGER(IntKi) :: prof_c0, prof_c1, prof_rate, prof_phase0
CHARACTER(ErrMsgLen) :: ErrMsg2
CHARACTER(ErrMsgLen) :: em
- REAL(wp) :: cval
REAL(wp) :: tau_pred ! load predictor: fraction of the mooring step elapsed
LOGICAL :: fresh, state_overlaid
+ ! the channels this call evaluated are those of the committed state as it stands
+ LOGICAL :: chan_committed
! Report this call's OWN status: clear at entry (ErrStat is INTENT(INOUT) and
! every SetErrStat below only ACCUMULATES, so on the all-success path an
@@ -2586,6 +2639,7 @@ SUBROUTINE CD_CalcOutput( t, u, p, x, xd, z, other, y, m, ErrStat, ErrMsg )
Inst(id)%prof_n_calcout = Inst(id)%prof_n_calcout + 1_IntKi
END IF
state_overlaid = .FALSE.
+ chan_committed = .FALSE.
! Evaluate the loads the mooring exerts on the coupling points. At nsuper = 1 (the
! mooring stepping at the glue rate) the CURRENT coupled kinematics are transferred
@@ -2699,10 +2753,12 @@ SUBROUTINE CD_CalcOutput( t, u, p, x, xd, z, other, y, m, ErrStat, ErrMsg )
END IF
! Deck OUTPUTS channels are evaluated at the same aggregate state as the returned
! loads: with supercycling the last committed zero-order-hold mooring state, at
- ! nsuper = 1 the state including the current coupled kinematics.
+ ! nsuper = 1 the state including the current coupled kinematics. The channels are
+ ! one row: the line-wide values several of a cable's channels read (its element twists,
+ ! node torques, ...) are evaluated once for the row (CD_AGG_EvalChannels).
IF (Inst(id)%prof_enabled) CALL SYSTEM_CLOCK(prof_phase0)
- DO i = 1, p%NumOuts
- CALL CD_AGG_EvalChannel( Inst(id)%agg, i, cval, es, em )
+ IF (p%NumOuts > 0) THEN
+ CALL CD_AGG_EvalChannels( Inst(id)%agg, Inst(id)%ws_chan, n_chan, es, em )
IF (es /= CD_AGG_OK) THEN
CALL SetErrStat( ErrID_Fatal, 'CableDyn mooring module: output channel evaluation failed: '// &
TRIM(em), ErrStat, ErrMsg, RoutineName )
@@ -2712,8 +2768,9 @@ SUBROUTINE CD_CalcOutput( t, u, p, x, xd, z, other, y, m, ErrStat, ErrMsg )
END IF
RETURN
END IF
- Inst(id)%ws_chan(i) = cval
- END DO
+ END IF
+ ! supercycled, the state evaluated is the committed one itself (no overlay)
+ chan_committed = .NOT. state_overlaid
IF (Inst(id)%prof_enabled) THEN
CALL SYSTEM_CLOCK(prof_c1)
Inst(id)%prof_t_channels = Inst(id)%prof_t_channels + &
@@ -2747,7 +2804,8 @@ SUBROUTINE CD_CalcOutput( t, u, p, x, xd, z, other, y, m, ErrStat, ErrMsg )
! probe/extra CalcOutput may drive with transient kinematics). The row must carry
! the committed state the stamp names, so its channels re-evaluate against the
! restored aggregate (at nsuper > 1 the committed state is live anyway and the
- ! re-evaluation is identical). Keyed on last_solve_n: exactly one row per advance,
+ ! re-evaluation is identical, so a row whose channels this call has just evaluated on that
+ ! state takes them). Keyed on last_solve_n: exactly one row per advance,
! whichever call after it comes first; the t = 0 static row was written at Init.
! If a glue correction re-advances the same n, BACKSPACE replaces the provisional
! last record with the corrected committed result rather than duplicating the time.
@@ -2755,14 +2813,24 @@ SUBROUTINE CD_CalcOutput( t, u, p, x, xd, z, other, y, m, ErrStat, ErrMsg )
IF (Inst(id)%prof_enabled) CALL SYSTEM_CLOCK(prof_phase0)
IF (Inst(id)%last_solve_n == Inst(id)%native_wrote_n) BACKSPACE (Inst(id)%native_un)
WRITE (Inst(id)%native_un, '(ES25.16E3)', ADVANCE='NO') MAX(Inst(id)%t_commit, 0.0_DbKi)
- DO i = 1, p%NumOuts
- CALL CD_AGG_EvalChannel( Inst(id)%agg, i, cval, es, em )
+ IF (chan_committed) THEN
+ DO i = 1, p%NumOuts
+ WRITE (Inst(id)%native_un, CD_NATIVE_CHANNEL_FMT, ADVANCE='NO') CHAR(9), Inst(id)%ws_chan(i)
+ END DO
+ ELSE
+ IF (.NOT. ALLOCATED(Inst(id)%ws_rowchan)) ALLOCATE (Inst(id)%ws_rowchan(p%NumOuts))
+ n_chan = 0
+ es = CD_AGG_OK
+ IF (p%NumOuts > 0) CALL CD_AGG_EvalChannels( Inst(id)%agg, Inst(id)%ws_rowchan, n_chan, es, em )
+ ! the channels before a failed one, as a channel-by-channel row writes them
+ DO i = 1, n_chan
+ WRITE (Inst(id)%native_un, CD_NATIVE_CHANNEL_FMT, ADVANCE='NO') CHAR(9), Inst(id)%ws_rowchan(i)
+ END DO
IF (es /= CD_AGG_OK) THEN
CALL SetErrStat( ErrID_Fatal, 'CableDyn mooring module: committed-step channel record: '//TRIM(em), &
ErrStat, ErrMsg, RoutineName ); RETURN
END IF
- WRITE (Inst(id)%native_un, CD_NATIVE_CHANNEL_FMT, ADVANCE='NO') CHAR(9), cval
- END DO
+ END IF
WRITE (Inst(id)%native_un, '(A)') ''
! keep the record readable during the run (and intact after a crash)
FLUSH (Inst(id)%native_un)
@@ -3068,9 +3136,12 @@ SUBROUTINE restore_calcoutput_probe( inst_e, m, ErrStat, ErrMsg )
ErrStat = ErrID_None
ErrMsg = ''
+ ! the cables are left to the mirror reload below, which rewrites their coupled ends,
+ ! frames and twist (a transfer here would be overwritten)
CALL CD_AGG_UpdateStates_Moving( inst_e%agg, inst_e%sv_pos, inst_e%sv_vel, inst_e%sv_acc, es, em, &
output_probe=.TRUE., orientation=inst_e%sv_orient, &
- angular_velocity=inst_e%sv_omega, angular_acceleration=inst_e%sv_alpha )
+ angular_velocity=inst_e%sv_omega, angular_acceleration=inst_e%sv_alpha, &
+ cables_from_mirror=.TRUE. )
IF (es /= CD_AGG_OK) THEN
CALL SetErrStat( ErrID_Fatal, 'CableDyn CalcOutput endpoint restore failed: '//TRIM(em), &
ErrStat, ErrMsg, 'restore_calcoutput_probe' )
@@ -3304,10 +3375,10 @@ SUBROUTINE lin_eval( id, p, m, u, x_in, ErrStat, ErrMsg, dxdt, y_out )
TYPE(CD_OutputType), INTENT(INOUT), OPTIONAL :: y_out
character(*), parameter :: RoutineName = 'CableDyn:lin_eval'
- INTEGER(IntKi) :: ErrStat2, es, i, ic, il, ne, k
+ INTEGER(IntKi) :: ErrStat2, es, i, ic, il, ne, k, n_chan
REAL(wp), ALLOCATABLE :: ve_rate(:), syr_rate(:)
CHARACTER(ErrMsgLen) :: ErrMsg2, em
- REAL(wp) :: cval, t_clock
+ REAL(wp) :: t_clock
ErrStat = ErrID_None
ErrMsg = ''
@@ -3426,16 +3497,18 @@ SUBROUTINE lin_eval( id, p, m, u, x_in, ErrStat, ErrMsg, dxdt, y_out )
Inst(id)%lin_fld(:, i) = Inst(id)%ws_fld(:, i)
Inst(id)%lin_moment(:, i) = Inst(id)%ws_moment(:, i)
END DO
- DO i = 1, p%NumOuts
- CALL CD_AGG_EvalChannel( Inst(id)%agg, i, cval, es, em )
- IF (es /= CD_AGG_OK) THEN
- CALL SetErrStat( ErrID_Fatal, 'CableDyn mooring module: output channel evaluation failed: '// &
- TRIM(em), ErrStat, ErrMsg, RoutineName )
- CALL restore; RETURN
- END IF
- y_out%WriteOutput(i) = REAL(cval, ReKi)
- Inst(id)%lin_chan(i) = cval
+ ! the channels as one row (their shared line-wide values once)
+ n_chan = 0
+ es = CD_AGG_OK
+ IF (p%NumOuts > 0) CALL CD_AGG_EvalChannels( Inst(id)%agg, Inst(id)%lin_chan, n_chan, es, em )
+ DO i = 1, n_chan
+ y_out%WriteOutput(i) = REAL(Inst(id)%lin_chan(i), ReKi)
END DO
+ IF (es /= CD_AGG_OK) THEN
+ CALL SetErrStat( ErrID_Fatal, 'CableDyn mooring module: output channel evaluation failed: '// &
+ TRIM(em), ErrStat, ErrMsg, RoutineName )
+ CALL restore; RETURN
+ END IF
END IF
CALL restore
@@ -3445,7 +3518,8 @@ SUBROUTINE restore()
!! The committed coupled kinematics and mirror back; the held loads are re-evaluated.
CALL CD_AGG_UpdateStates_Moving( Inst(id)%agg, Inst(id)%sv_pos, Inst(id)%sv_vel, Inst(id)%sv_acc, es, em, &
output_probe=.TRUE., orientation=Inst(id)%sv_orient, &
- angular_velocity=Inst(id)%sv_omega, angular_acceleration=Inst(id)%sv_alpha )
+ angular_velocity=Inst(id)%sv_omega, angular_acceleration=Inst(id)%sv_alpha, &
+ cables_from_mirror=.TRUE. )
IF (es /= CD_AGG_OK) CALL SetErrStat( ErrID_Fatal, 'CableDyn linearization restore failed: '//TRIM(em), &
ErrStat, ErrMsg, RoutineName )
CALL reload_interiors_ary( Inst(id), m, Inst(id)%ws_lsave, t_clock, ErrStat2, ErrMsg2 )
diff --git a/tests/data/cable_statics_matrix.json b/tests/data/cable_statics_matrix.json
index c1b3541c..029b444c 100644
--- a/tests/data/cable_statics_matrix.json
+++ b/tests/data/cable_statics_matrix.json
@@ -1486,7 +1486,49 @@
"lambda_over_length": 0.0
}
},
- "note": "past its anchor, where it folds back"
+ "note": "past its anchor, where it folds back",
+ "side": "+y"
+ },
+ {
+ "id": "CUR_1013__rot180",
+ "expect": "admissible",
+ "why": "The parent rotated by 180 degrees about z. Past the pitchfork of the in-plane current the symmetry-breaking pass adds a cross-flow to the left of the horizontal chord from the anchor (End B) to the fairlead (End A), so the rotated deck reaches the rotated equilibrium and leaves its plane to -y. Before, a chord without a y component always took the cross-flow at +y, so the parent (its chord from the anchor along -x) and this deck left to the same global side.",
+ "deck": "--------------------- CableDyn Input File ---------------------------\nCUR_1013__rot180\n--------------------- LINE TYPES ------------------------------------\nTypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t\n(-) (m) (kg/m) (N) (-) (N-m2) (-) (-) (-) (-)\nbare 0.1784650716 82.63060908 255233842 0 25945.91551 1.2 0.1 1 0\nbuoy 0.4710966462 88.94142595 255233842 0 40205.41756 1.2 0.1 1 0\n--------------------- POINTS ----------------------------------------\nID Type X Y Z\n(-) (-) (m) (m) (m)\n1 Coupled 0 0 -13.08348484\n2 Fixed -41.77649681 0 -42.543\n--------------------- LINES -----------------------------------------\nID NodeA NodeB Outputs\n(-) (-) (-) (-)\n1 1 2 -\n--------------------- SECTIONS --------------------------------------\nLineID LineType Length NumSegs\n(-) (-) (m) (-)\n1 bare 20.5504 2\n1 buoy 7.3589 1\n1 bare 35.1167 4\n--------------------- OPTIONS ---------------------------------------\n9.80665 g\n1025.0 rhoW\n42.543 WtrDpth\n3e+06 kBot\n1.0e4 cBot\n0.05 dtM\n0.0 TMax\nFalse adaptive_mesh\nTrue tensile_safety\nuniform -1.906 0.0 0.0 current\n--------------------- OUTPUTS ---------------------------------------\n\"FairTen1\"\n\"AnchTen1\"\n--------------------- need this line --------------------------------\n",
+ "lines": {
+ "1": {
+ "oracle_tfair": [],
+ "lambda_over_length": 0.0
+ }
+ },
+ "side": "-y",
+ "twin_of": "CUR_1013"
+ },
+ {
+ "id": "CUR_1013__xp",
+ "expect": "admissible",
+ "why": "A cross current toward +y of 2 % of the in-plane current picks the side: the grounded run, folded back past its anchor, lies at -y.",
+ "deck": "--------------------- CableDyn Input File ---------------------------\nCUR_1013__xp\n--------------------- LINE TYPES ------------------------------------\nTypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t\n(-) (m) (kg/m) (N) (-) (N-m2) (-) (-) (-) (-)\nbare 0.1784650716 82.63060908 255233842 0 25945.91551 1.2 0.1 1 0\nbuoy 0.4710966462 88.94142595 255233842 0 40205.41756 1.2 0.1 1 0\n--------------------- POINTS ----------------------------------------\nID Type X Y Z\n(-) (-) (m) (m) (m)\n1 Coupled 0 0 -13.08348484\n2 Fixed 41.77649681 0 -42.543\n--------------------- LINES -----------------------------------------\nID NodeA NodeB Outputs\n(-) (-) (-) (-)\n1 1 2 -\n--------------------- SECTIONS --------------------------------------\nLineID LineType Length NumSegs\n(-) (-) (m) (-)\n1 bare 20.5504 2\n1 buoy 7.3589 1\n1 bare 35.1167 4\n--------------------- OPTIONS ---------------------------------------\n9.80665 g\n1025.0 rhoW\n42.543 WtrDpth\n3e+06 kBot\n1.0e4 cBot\n0.05 dtM\n0.0 TMax\nFalse adaptive_mesh\nTrue tensile_safety\nuniform 1.906 0.03812 0.0 current\n--------------------- OUTPUTS ---------------------------------------\n\"FairTen1\"\n\"AnchTen1\"\n--------------------- need this line --------------------------------\n",
+ "lines": {
+ "1": {
+ "oracle_tfair": [],
+ "lambda_over_length": 0.0
+ }
+ },
+ "side": "-y"
+ },
+ {
+ "id": "CUR_1013__xm",
+ "expect": "admissible",
+ "why": "CUR_1013__xp with the cross current toward -y: the mirror image of its equilibrium.",
+ "deck": "--------------------- CableDyn Input File ---------------------------\nCUR_1013__xm\n--------------------- LINE TYPES ------------------------------------\nTypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t\n(-) (m) (kg/m) (N) (-) (N-m2) (-) (-) (-) (-)\nbare 0.1784650716 82.63060908 255233842 0 25945.91551 1.2 0.1 1 0\nbuoy 0.4710966462 88.94142595 255233842 0 40205.41756 1.2 0.1 1 0\n--------------------- POINTS ----------------------------------------\nID Type X Y Z\n(-) (-) (m) (m) (m)\n1 Coupled 0 0 -13.08348484\n2 Fixed 41.77649681 0 -42.543\n--------------------- LINES -----------------------------------------\nID NodeA NodeB Outputs\n(-) (-) (-) (-)\n1 1 2 -\n--------------------- SECTIONS --------------------------------------\nLineID LineType Length NumSegs\n(-) (-) (m) (-)\n1 bare 20.5504 2\n1 buoy 7.3589 1\n1 bare 35.1167 4\n--------------------- OPTIONS ---------------------------------------\n9.80665 g\n1025.0 rhoW\n42.543 WtrDpth\n3e+06 kBot\n1.0e4 cBot\n0.05 dtM\n0.0 TMax\nFalse adaptive_mesh\nTrue tensile_safety\nuniform 1.906 -0.03812 0.0 current\n--------------------- OUTPUTS ---------------------------------------\n\"FairTen1\"\n\"AnchTen1\"\n--------------------- need this line --------------------------------\n",
+ "lines": {
+ "1": {
+ "oracle_tfair": [],
+ "lambda_over_length": 0.0
+ }
+ },
+ "side": "+y",
+ "mirror_of": "CUR_1013__xp"
},
{
"id": "LWM_1002",
diff --git a/tests/test_attachment_surface.f90 b/tests/test_attachment_surface.f90
new file mode 100644
index 00000000..b70d5213
--- /dev/null
+++ b/tests/test_attachment_surface.f90
@@ -0,0 +1,167 @@
+! File: tests/test_attachment_surface.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_attachment_surface
+ !! The immersed fraction of a point attachment at the free surface (the sphere of its volume,
+ !! CD_HermiteCable_Point_Immersion) and the buoyancy it loses there in the finite-EI static solve.
+ !! Gates:
+ !! K1 the fraction: 1 from r below the surface, 0 from r above, 1/2 at it; its height
+ !! derivative matches central FD in the band; the potential psi has the derivative wf; wf
+ !! and dwf are continuous at the band edges; r = 0 is the wet/dry switch; the sphere radius
+ !! of a volume and of a drag area.
+ !! K2 the static solve (CD_HermiteCable_Static_Solve, att_node/att_buoyancy/att_radius): with
+ !! the attachment node in the band the residual changes by rho g V (1 - wf) at its height
+ !! and the tangent's column matches central FD; deeper than r the residual and tangent are
+ !! those without the attachment term, bit for bit; above the band the residual carries
+ !! rho g V in full.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCable_Point_Immersion, CD_HermiteCable_Point_Radius
+ USE CableDyn_HermiteCableStatic, ONLY: CD_HermiteCable_Static_Solve, CD_HCSTAT_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
+ INTEGER, PARAMETER :: NE = 10, NN = NE + 1, NDOF = 6*NN, LDAB = 2*11 + 11 + 1
+ INTEGER :: nfail = 0
+
+ CALL gate_k1()
+ CALL gate_k2()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAILED: ', nfail, ' check(s)'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: attachment immersion at the free surface'
+
+CONTAINS
+
+ SUBROUTINE gate_k1()
+ REAL(wp), PARAMETER :: R = 0.4_wp, H = 1.0e-6_wp
+ REAL(wp) :: wf, dwf, psi, wp_, wm, dum, pp, pm, err_d, err_p, d
+ INTEGER :: k
+ CALL CD_HermiteCable_Point_Immersion(1.0_wp, R, wf, dwf, psi)
+ CALL check(wf == 1.0_wp .AND. dwf == 0.0_wp .AND. psi == -1.0_wp, 'K1: fully submerged below r')
+ CALL CD_HermiteCable_Point_Immersion(-1.0_wp, R, wf, dwf, psi)
+ CALL check(wf == 0.0_wp .AND. dwf == 0.0_wp .AND. psi == 0.0_wp, 'K1: dry above r')
+ CALL CD_HermiteCable_Point_Immersion(0.0_wp, R, wf, dwf, psi)
+ CALL check(ABS(wf - 0.5_wp) < 1.0e-15_wp .AND. ABS(dwf + 3.0_wp/(4.0_wp*R)) < 1.0e-14_wp, &
+ 'K1: half immersed at the surface, slope -3/(4 r)')
+ err_d = 0.0_wp
+ err_p = 0.0_wp
+ DO k = -19, 19
+ d = R*REAL(k, wp)/20.0_wp
+ CALL CD_HermiteCable_Point_Immersion(d, R, wf, dwf, psi)
+ ! z = -depth: d wf/d z = -(d wf/d depth)
+ CALL CD_HermiteCable_Point_Immersion(d - H, R, wp_, dum, pp)
+ CALL CD_HermiteCable_Point_Immersion(d + H, R, wm, dum, pm)
+ err_d = MAX(err_d, ABS((wp_ - wm)/(2.0_wp*H) - dwf))
+ err_p = MAX(err_p, ABS((pp - pm)/(2.0_wp*H) - wf))
+ END DO
+ WRITE (*, '(A,2ES10.2)') ' K1 FD error of dwf/dz and dpsi/dz in the band: ', err_d, err_p
+ CALL check(err_d < 1.0e-8_wp, 'K1: dwf/dz matches central FD')
+ CALL check(err_p < 1.0e-8_wp, 'K1: dpsi/dz = wf')
+ CALL CD_HermiteCable_Point_Immersion(R*(1.0_wp - 1.0e-9_wp), R, wf, dwf, psi)
+ CALL check(ABS(wf - 1.0_wp) < 1.0e-12_wp .AND. ABS(dwf) < 1.0e-8_wp .AND. ABS(psi + R) < 1.0e-9_wp, &
+ 'K1: continuous with its slope and potential at the lower band edge')
+ CALL CD_HermiteCable_Point_Immersion(-R*(1.0_wp - 1.0e-9_wp), R, wf, dwf, psi)
+ CALL check(ABS(wf) < 1.0e-12_wp .AND. ABS(dwf) < 1.0e-8_wp .AND. ABS(psi) < 1.0e-12_wp, &
+ 'K1: continuous with its slope and potential at the upper band edge')
+ CALL CD_HermiteCable_Point_Immersion(0.0_wp, 0.0_wp, wf, dwf, psi)
+ CALL check(wf == 1.0_wp .AND. dwf == 0.0_wp, 'K1: a point (r = 0) is wet at the surface')
+ CALL CD_HermiteCable_Point_Immersion(-1.0e-12_wp, 0.0_wp, wf, dwf, psi)
+ CALL check(wf == 0.0_wp, 'K1: a point (r = 0) is dry above the surface')
+ CALL check(ABS(CD_HermiteCable_Point_Radius(4.0_wp*PI/3.0_wp, 0.5_wp) - 1.0_wp) < 1.0e-14_wp, &
+ 'K1: the sphere of the volume')
+ CALL check(ABS(CD_HermiteCable_Point_Radius(0.0_wp, PI) - 1.0_wp) < 1.0e-14_wp, &
+ 'K1: without a volume, the sphere of the drag area')
+ CALL check(CD_HermiteCable_Point_Radius(0.0_wp, 0.0_wp) == 0.0_wp, 'K1: neither: a point')
+ END SUBROUTINE gate_k1
+
+ SUBROUTINE gate_k2()
+ !! A 10 m line of ten elements along x at z0, attachment at node 6 (rho g V 2000 N, r 0.3 m).
+ REAL(wp), PARAMETER :: B = 2000.0_wp, R = 0.3_wp, HH = 1.0e-6_wp
+ REAL(wp) :: q(NDOF), r0(NDOF), r1(NDOF), ab0(LDAB, NDOF), ab1(LDAB, NDOF), rp(NDOF), rm(NDOF), dum(LDAB, NDOF)
+ REAL(wp) :: wf, dwf, col_fd(NDOF), col_an(NDOF), err, z0
+ INTEGER :: jz, i
+ jz = 6*5 + 3
+ ! in the band
+ z0 = 0.1_wp
+ CALL line_state(z0, q)
+ CALL evaluate(q, .FALSE., r0, ab0)
+ CALL evaluate(q, .TRUE., r1, ab1)
+ CALL CD_HermiteCable_Point_Immersion(-z0, R, wf, dwf)
+ CALL check(ABS(r1(jz) - r0(jz) - B*(1.0_wp - wf)) < 1.0e-9_wp*B, &
+ 'K2: the residual carries the lost buoyancy rho g V (1 - wf) at the node height')
+ CALL check(MAXVAL(ABS(r1(1:jz - 1) - r0(1:jz - 1))) == 0.0_wp .AND. &
+ MAXVAL(ABS(r1(jz + 1:NDOF) - r0(jz + 1:NDOF))) == 0.0_wp, 'K2: only the node''s vertical DOF changes')
+ q(jz) = z0 + HH
+ CALL evaluate(q, .TRUE., rp, dum)
+ q(jz) = z0 - HH
+ CALL evaluate(q, .TRUE., rm, dum)
+ col_fd = (rp - rm)/(2.0_wp*HH)
+ col_an = 0.0_wp
+ DO i = MAX(1, jz - 11), MIN(NDOF, jz + 11)
+ col_an(i) = ab1(2*11 + 1 + i - jz, jz)
+ END DO
+ err = MAXVAL(ABS(col_fd - col_an))/MAX(1.0_wp, MAXVAL(ABS(col_an)))
+ WRITE (*, '(A,ES10.2)') ' K2 static tangent column vs central FD (node in the band): ', err
+ CALL check(err < 1.0e-6_wp, 'K2: the static tangent column of the node matches central FD')
+ CALL check(ABS((ab1(2*11 + 1, jz) - ab0(2*11 + 1, jz)) + B*dwf) < 1.0e-9_wp*B, &
+ 'K2: the tangent adds the buoyancy stiffness -rho g V dwf/dz')
+ ! deeper than r: unchanged, bit for bit
+ CALL line_state(-0.31_wp, q)
+ CALL evaluate(q, .FALSE., r0, ab0)
+ CALL evaluate(q, .TRUE., r1, ab1)
+ CALL check(ALL(r1 == r0) .AND. ALL(ab1 == ab0), 'K2: an attachment deeper than r leaves the solve bit-identical')
+ ! above the band: the whole buoyancy is lost
+ CALL line_state(0.31_wp, q)
+ CALL evaluate(q, .FALSE., r0, ab0)
+ CALL evaluate(q, .TRUE., r1, ab1)
+ CALL check(ABS(r1(jz) - r0(jz) - B) < 1.0e-12_wp*B .AND. ALL(ab1 == ab0), &
+ 'K2: above the band the attachment loses its whole buoyancy, with no stiffness')
+ END SUBROUTINE gate_k2
+
+ SUBROUTINE line_state(z0, q)
+ !! A straight line along x at height z0, stretched 1e-4 (a non-trivial elastic residual).
+ REAL(wp), INTENT(IN) :: z0
+ REAL(wp), INTENT(OUT) :: q(NDOF)
+ INTEGER :: i
+ q = 0.0_wp
+ DO i = 1, NN
+ q(6*(i - 1) + 1) = 1.0001_wp*REAL(i - 1, wp)
+ q(6*(i - 1) + 3) = z0 + 0.002_wp*SIN(REAL(i, wp))
+ q(6*(i - 1) + 4) = 1.0001_wp
+ END DO
+ q(6*5 + 3) = z0
+ END SUBROUTINE line_state
+
+ SUBROUTINE evaluate(qx, with_att, r, ab)
+ !! The solver's residual and banded tangent at qx (no Newton update: tol = HUGE).
+ REAL(wp), INTENT(IN) :: qx(NDOF)
+ LOGICAL, INTENT(IN) :: with_att
+ REAL(wp), INTENT(OUT) :: r(NDOF), ab(LDAB, NDOF)
+ REAL(wp) :: l0(NE), ea(NE), ei(NE), w(NE), qd(NDOF), cd(NN), rr
+ INTEGER :: itx, esx
+ CHARACTER(512) :: emx
+ l0 = 1.0_wp; ea = 1.0e6_wp; ei = 50.0_wp; w = 40.0_wp
+ IF (with_att) THEN
+ CALL CD_HermiteCable_Static_Solve(l0, ea, ei, w, qx, [1, 2, 3, NDOF - 5, NDOF - 4, NDOF - 3], -1.0e4_wp, &
+ 0.0_wp, 1, 1, HUGE(1.0_wp), 1.0_wp, qd, cd, rr, itx, esx, emx, &
+ residual_out=r, tangent_out=ab, att_node=[6], att_buoyancy=[2000.0_wp], &
+ att_radius=[0.3_wp])
+ ELSE
+ CALL CD_HermiteCable_Static_Solve(l0, ea, ei, w, qx, [1, 2, 3, NDOF - 5, NDOF - 4, NDOF - 3], -1.0e4_wp, &
+ 0.0_wp, 1, 1, HUGE(1.0_wp), 1.0_wp, qd, cd, rr, itx, esx, emx, &
+ residual_out=r, tangent_out=ab)
+ END IF
+ CALL check(esx == CD_HCSTAT_OK, 'residual and tangent evaluation: '//TRIM(emx))
+ END SUBROUTINE evaluate
+
+ SUBROUTINE check(ok, msg)
+ LOGICAL, INTENT(IN) :: ok
+ CHARACTER(*), INTENT(IN) :: msg
+ IF (ok) THEN
+ WRITE (*, '(2A)') 'ok ', msg
+ ELSE
+ WRITE (*, '(2A)') 'FAIL ', msg
+ nfail = nfail + 1
+ END IF
+ END SUBROUTINE check
+END PROGRAM test_attachment_surface
diff --git a/tests/test_bending_damping_deck.f90 b/tests/test_bending_damping_deck.f90
new file mode 100644
index 00000000..c1cff53f
--- /dev/null
+++ b/tests/test_bending_damping_deck.f90
@@ -0,0 +1,238 @@
+! File: tests/test_bending_damping_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_bending_damping_deck
+ !! Bending damping on a deck (LINE TYPES EI|Bb, EI|-zeta|f and EI|-zeta|f1|f2): an 80 m power cable hanging from
+ !! a clamped hang-off to a seabed anchor, in a regular sea.
+ !! E1 EI|-zeta|f and the EI|Bb it resolves to (Bb = zeta EI/(pi f)) give the same run, to the
+ !! printed digits;
+ !! E2 the damping lowers the hang-off curvature range against the undamped deck, and EI|0 is
+ !! the undamped deck exactly;
+ !! E3 bending damping on an EI = 0 type (as Bb or as a ratio) and malformed EI columns are
+ !! refused by name;
+ !! E4 EI|-zeta|f1|f2 runs; its mass-proportional half acts (the run differs from the EI|Bb deck
+ !! of the same Bb = zeta EI/(pi (f1 + f2))) and lowers the hang-off curvature range further;
+ !! E5 the two-frequency form with a positive ratio, a zero frequency or on an EI = 0 type is
+ !! refused by name.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, EI = 2.0e4_wp, ZETA = 0.05_wp, FREQ = 0.5_wp
+ INTEGER :: nfail = 0
+
+ CALL check_runs()
+ CALL check_pair()
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: bending-damping deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_deck(path, ei_col, tmax, rope)
+ CHARACTER(*), INTENT(IN) :: path, ei_col
+ REAL(wp), INTENT(IN) :: tmax
+ LOGICAL, INTENT(IN), OPTIONAL :: rope
+ INTEGER :: u
+ LOGICAL :: on_rope
+ on_rope = .FALSE.
+ IF (PRESENT(rope)) on_rope = rope
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ------------------------------------'
+ WRITE (u, '(A)') 'hang-off cable with bending damping'
+ WRITE (u, '(A)') '--------------------- LINE TYPES ---------------------------------------------'
+ WRITE (u, '(A)') 'TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t'
+ WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (N-m2) (-) (-) (-) (-)'
+ IF (on_rope) THEN
+ WRITE (u, '(A)') 'pc 0.15 40.0 5.0e8 0.0 2.0e4 1.2 0.1 1.0 0.0'
+ WRITE (u, '(A)') 'rope 0.10 20.0 5.0e7 0.0 '//TRIM(ei_col)//' 1.2 0.1 1.0 0.0'
+ ELSE
+ WRITE (u, '(A)') 'pc 0.15 40.0 5.0e8 0.0 '//TRIM(ei_col)//' 1.2 0.1 1.0 0.0'
+ END IF
+ WRITE (u, '(A)') '--------------------- POINTS -------------------------------------------------'
+ WRITE (u, '(A)') 'ID Type X Y Z'
+ WRITE (u, '(A)') '(-) (-) (m) (m) (m)'
+ WRITE (u, '(A)') '1 Coupled 0.0 0.0 -5.0'
+ WRITE (u, '(A)') '2 Fixed 60.0 0.0 -50.0'
+ WRITE (u, '(A)') '--------------------- LINES --------------------------------------------------'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ WRITE (u, '(A)') '(-) (-) (-) (-)'
+ WRITE (u, '(A)') '1 1 2 -'
+ WRITE (u, '(A)') '--------------------- SECTIONS -----------------------------------------------'
+ WRITE (u, '(A)') 'LineID LineType Length NumSegs'
+ WRITE (u, '(A)') '(-) (-) (m) (-)'
+ WRITE (u, '(A)') '1 pc 80.0 320'
+ WRITE (u, '(A)') '--------------------- END CONNECTIONS ----------------------------------------'
+ WRITE (u, '(A)') 'LineID End Stiffness EzX EzY EzZ'
+ WRITE (u, '(A)') '(-) (-) (N-m/rad) (-) (-) (-)'
+ WRITE (u, '(A)') '1 A Rigid 0.3746 0.0 -0.9272'
+ WRITE (u, '(A)') '--------------------- OPTIONS ------------------------------------------------'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '50.0 WtrDpth'
+ WRITE (u, '(A)') '0.02 dtM'
+ WRITE (u, '(A,F8.3,A)') ' ', tmax, ' TMax'
+ WRITE (u, '(A)') 'airy 3.0 8.0 0.0 waves'
+ WRITE (u, '(A)') '5.0 rampTime'
+ WRITE (u, '(A)') '--------------------- OUTPUTS ------------------------------------------------'
+ WRITE (u, '(A)') '"FairTen1"'
+ WRITE (u, '(A)') '"BendMom1N1"'
+ WRITE (u, '(A)') '"Curv1N1"'
+ WRITE (u, '(A)') 'END'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, tab, n)
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(1024) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(4, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ SUBROUTINE check_runs()
+ REAL(wp), ALLOCATABLE :: tz(:, :), tb(:, :), tp(:, :), t0(:, :)
+ INTEGER :: nz, nb, np, n0
+ REAL(wp) :: bb, rz, rp, r0
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CHARACTER(64) :: col
+ bb = ZETA*EI/(PI*FREQ)
+ WRITE (col, '(ES22.15)') bb
+ CALL write_deck('bdd_zeta.dat', '2.0e4|-0.05|0.5', 20.0_wp)
+ CALL run('bdd_zeta.dat', 'bdd_zeta', ok, msg)
+ CALL require(ok, 'E1: the EI|-zeta|f deck runs: '//TRIM(msg))
+ CALL write_deck('bdd_bb.dat', '2.0e4|'//TRIM(ADJUSTL(col)), 20.0_wp)
+ CALL run('bdd_bb.dat', 'bdd_bb', ok, msg)
+ CALL require(ok, 'E1: the EI|Bb deck runs: '//TRIM(msg))
+ CALL write_deck('bdd_plain.dat', '2.0e4', 20.0_wp)
+ CALL run('bdd_plain.dat', 'bdd_plain', ok, msg)
+ CALL require(ok, 'E2: the undamped deck runs: '//TRIM(msg))
+ CALL write_deck('bdd_zero.dat', '2.0e4|0', 20.0_wp)
+ CALL run('bdd_zero.dat', 'bdd_zero', ok, msg)
+ CALL require(ok, 'E2: the EI|0 deck runs: '//TRIM(msg))
+ CALL read_out('bdd_zeta.out', tz, nz)
+ CALL read_out('bdd_bb.out', tb, nb)
+ CALL read_out('bdd_plain.out', tp, np)
+ CALL read_out('bdd_zero.out', t0, n0)
+ CALL require(nz > 10 .AND. nz == nb .AND. nz == np .AND. nz == n0, 'E1/E2: the runs wrote matching rows')
+ IF (.NOT. (nz > 10 .AND. nz == nb .AND. nz == np .AND. nz == n0)) RETURN
+ WRITE (*, '(A,ES11.4)') 'E1: max |EI|-zeta|f - EI|Bb| over the channels ', MAXVAL(ABS(tz(:, :nz) - tb(:, :nb)))
+ CALL require(MAXVAL(ABS(tz(:, :nz) - tb(:, :nb))) <= 1.0e-6_wp*MAXVAL(ABS(tz(:, :nz))), &
+ 'E1: EI|-zeta|f is EI|Bb with Bb = zeta EI/(pi f)')
+ CALL require(MAXVAL(ABS(t0(:, :n0) - tp(:, :np))) == 0.0_wp, 'E2: EI|0 is the undamped deck exactly')
+ rz = MAXVAL(tz(4, nz/2:nz)) - MINVAL(tz(4, nz/2:nz))
+ rp = MAXVAL(tp(4, np/2:np)) - MINVAL(tp(4, np/2:np))
+ r0 = MAXVAL(tz(3, nz/2:nz)) - MINVAL(tz(3, nz/2:nz))
+ WRITE (*, '(A,ES11.4,A,ES11.4,A)') 'E2: hang-off curvature range, damped ', rz, ' 1/m, undamped ', rp, ' 1/m'
+ CALL require(rz < rp, 'E2: the bending damping lowers the hang-off curvature range')
+ CALL require(r0 > 0.0_wp, 'E2: the hang-off moment varies in the sea')
+ END SUBROUTINE check_runs
+
+ SUBROUTINE check_refusals()
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('bdd_rope.dat', '0.0|250.0', 0.0_wp, rope=.TRUE.)
+ CALL run('bdd_rope.dat', 'bdd_rope', ok, msg)
+ WRITE (*, '(A)') 'E3 EI = 0: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'bending damping (EI|Bb) needs a finite-EI cable') > 0, &
+ 'E3: bending damping on an EI = 0 type')
+ CALL write_deck('bdd_rope_ratio.dat', '0.0|-0.05|0.5', 0.0_wp, rope=.TRUE.)
+ CALL run('bdd_rope_ratio.dat', 'bdd_rope_ratio', ok, msg)
+ WRITE (*, '(A)') 'E3 EI = 0, ratio form: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'bending damping (EI|Bb) needs a finite-EI cable') > 0, &
+ 'E3: a damping ratio on an EI = 0 type')
+ CALL write_deck('bdd_neg.dat', '2.0e4|-250.0', 0.0_wp)
+ CALL run('bdd_neg.dat', 'bdd_neg', ok, msg)
+ WRITE (*, '(A)') 'E3 negative without f: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'needs the frequency it holds at') > 0, 'E3: negative Bb without f')
+ CALL write_deck('bdd_five.dat', '2.0e4|-0.05|1|2|3', 0.0_wp)
+ CALL run('bdd_five.dat', 'bdd_five', ok, msg)
+ WRITE (*, '(A)') 'E3 five parts: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'takes EI, EI|Bb, EI|-zeta|f or EI|-zeta|f1|f2') > 0, &
+ 'E3: five-part EI column')
+ CALL write_deck('bdd_pair_pos.dat', '2.0e4|0.05|0.5|2.0', 0.0_wp)
+ CALL run('bdd_pair_pos.dat', 'bdd_pair_pos', ok, msg)
+ WRITE (*, '(A)') 'E5 positive ratio: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'EI|-zeta|f1|f2 takes a damping ratio 0 < zeta < 1') > 0, &
+ 'E5: a positive ratio in the two-frequency form')
+ CALL write_deck('bdd_pair_f0.dat', '2.0e4|-0.05|0.5|0', 0.0_wp)
+ CALL run('bdd_pair_f0.dat', 'bdd_pair_f0', ok, msg)
+ WRITE (*, '(A)') 'E5 zero frequency: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'frequencies f1 and f2 of EI|-zeta|f1|f2 must be positive') > 0, &
+ 'E5: a zero frequency in the two-frequency form')
+ CALL write_deck('bdd_rope_pair.dat', '0.0|-0.05|0.5|2.0', 0.0_wp, rope=.TRUE.)
+ CALL run('bdd_rope_pair.dat', 'bdd_rope_pair', ok, msg)
+ WRITE (*, '(A)') 'E5 EI = 0, two-frequency form: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'bending damping (EI|Bb) needs a finite-EI cable') > 0, &
+ 'E5: the two-frequency form on an EI = 0 type')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE check_pair()
+ REAL(wp), PARAMETER :: F1 = 0.5_wp, F2 = 2.0_wp
+ REAL(wp), ALLOCATABLE :: tr(:, :), tb(:, :), tp(:, :)
+ INTEGER :: nr, nb, np
+ REAL(wp) :: bb, rr, rb, rp
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CHARACTER(64) :: col
+ bb = ZETA*EI/(PI*(F1 + F2))
+ WRITE (col, '(ES22.15)') bb
+ CALL write_deck('bdd_pair.dat', '2.0e4|-0.05|0.5|2.0', 20.0_wp)
+ CALL run('bdd_pair.dat', 'bdd_pair', ok, msg)
+ CALL require(ok, 'E4: the EI|-zeta|f1|f2 deck runs: '//TRIM(msg))
+ CALL write_deck('bdd_pair_bb.dat', '2.0e4|'//TRIM(ADJUSTL(col)), 20.0_wp)
+ CALL run('bdd_pair_bb.dat', 'bdd_pair_bb', ok, msg)
+ CALL require(ok, 'E4: the EI|Bb deck of its Bb runs: '//TRIM(msg))
+ CALL read_out('bdd_pair.out', tr, nr)
+ CALL read_out('bdd_pair_bb.out', tb, nb)
+ CALL read_out('bdd_plain.out', tp, np)
+ CALL require(nr > 10 .AND. nr == nb .AND. nr == np, 'E4: the runs wrote matching rows')
+ IF (.NOT. (nr > 10 .AND. nr == nb .AND. nr == np)) RETURN
+ rr = MAXVAL(tr(4, nr/2:nr)) - MINVAL(tr(4, nr/2:nr))
+ rb = MAXVAL(tb(4, nb/2:nb)) - MINVAL(tb(4, nb/2:nb))
+ rp = MAXVAL(tp(4, np/2:np)) - MINVAL(tp(4, np/2:np))
+ WRITE (*, '(A,ES11.4,A)') 'E4: max |EI|-zeta|f1|f2 - EI|Bb| over the channels ', &
+ MAXVAL(ABS(tr(:, :nr) - tb(:, :nb))), ' (the alpha share)'
+ WRITE (*, '(A,3ES11.4,A)') 'E4: hang-off curvature range, Rayleigh pair, its Bb alone, undamped ', rr, rb, rp, &
+ ' 1/m'
+ CALL require(MAXVAL(ABS(tr(:, :nr) - tb(:, :nb))) > 1.0e-6_wp*MAXVAL(ABS(tb(:, :nb))), &
+ 'E4: the mass-proportional half acts')
+ CALL require(rr < rb .AND. rb < rp, 'E4: the mass-proportional half lowers the curvature range further')
+ END SUBROUTINE check_pair
+
+END PROGRAM test_bending_damping_deck
diff --git a/tests/test_c_api.f90 b/tests/test_c_api.f90
index f8d827e6..6368bd2c 100644
--- a/tests/test_c_api.f90
+++ b/tests/test_c_api.f90
@@ -59,7 +59,7 @@ SUBROUTINE case_version()
abi_version = -1_C_INT
msg = 'x'
CALL CableDyn_GetVersion(major, minor, patch, abi_version)
- CALL require(major == 0_C_INT .AND. minor == 4_C_INT .AND. patch == 2_C_INT .AND. abi_version == 1_C_INT, &
+ CALL require(major == 0_C_INT .AND. minor == 4_C_INT .AND. patch == 3_C_INT .AND. abi_version == 1_C_INT, &
'c-api-version:tuple')
CALL CableDyn_GetVersionString(C_LOC(msg), INT(SIZE(msg), C_INT))
CALL require(INDEX(c_text(msg), 'CableDyn') == 1 .AND. INDEX(c_text(msg), 'C-ABI 1') > 0, &
diff --git a/tests/test_cable_statics_matrix.py b/tests/test_cable_statics_matrix.py
index ad2b0f5f..64d5a9fa 100644
--- a/tests/test_cable_statics_matrix.py
+++ b/tests/test_cable_statics_matrix.py
@@ -40,7 +40,14 @@
parent profile at the same unstretched arc length;
* at-rest twins (the parent deck marched in time with nothing moving) must report the
line-end forces of the static solution at every output step: FairTen/AnchTen are the
- end forces of the committed state, identical for the static and the dynamic run.
+ end forces of the committed state, identical for the static and the dynamic run;
+* a deck with a ``side`` must leave its vertical plane to that side (``+y`` or ``-y``, its
+ recorded equilibrium): past the pitchfork of an in-plane current the symmetry-breaking pass
+ adds a cross-flow to the left of the horizontal chord from the anchor (End B) to the
+ fairlead (End A), so the deck rotated by 180 degrees about z leaves to the opposite global
+ side, and a small cross current of the deck's own picks the side;
+* mirror twins (``mirror_of``: the parent deck reflected in y) must reach the mirror image of
+ the parent's equilibrium: end forces within 1e-6, nodes within 1e-6 of the line length.
usage: test_cable_statics_matrix.py --exe --cases --output
"""
@@ -285,6 +292,38 @@ def check_case(case: dict, res: dict) -> list:
return errs
+def side_errors(res: dict, side: str) -> list:
+ """The side a line turned to out of its vertical plane: the node farthest from y = 0 lies at
+ +y or -y (``side``) by more than 1e-3 of the line length."""
+ errs = []
+ for lid, rows in res["static"].items():
+ length = rows[-1][0] - rows[0][0]
+ y = max((r[2] for r in rows), key=abs)
+ if abs(y) <= 1e-3 * length or (y > 0.0) != (side == "+y"):
+ errs.append("line %s turned to y = %.4g m, expected the %s side" % (lid, y, side))
+ return errs
+
+
+def mirror_errors(res: dict, pr: dict, parent: str) -> list:
+ """The mirror image in y of the parent's equilibrium: end forces within 1e-6, every node's x
+ and z equal and y opposite within 1e-6 of the line length."""
+ errs = []
+ for name, v in res["forces"].items():
+ vp = pr["forces"].get(name)
+ if vp is None or abs(v - vp) > 1e-6 * max(abs(vp), 1.0):
+ errs.append("%s %.9g differs from its mirror %s (%s)" % (name, v, parent, vp))
+ for lid, rows in res["static"].items():
+ prow = pr["static"].get(lid)
+ if not prow or len(prow) != len(rows):
+ errs.append("line %s has no matching profile in %s" % (lid, parent))
+ continue
+ length = rows[-1][0] - rows[0][0]
+ dev = max(max(abs(r[1] - p[1]), abs(r[2] + p[2]), abs(r[3] - p[3])) for r, p in zip(rows, prow))
+ if dev > 1e-6 * length:
+ errs.append("line %s departs %.3g m from the mirror of %s" % (lid, dev, parent))
+ return errs
+
+
def mesh_twin_errors(res: dict, pr: dict, parent: str) -> list:
"""The same equilibrium on a refined mesh: FairTen within 0.5 %, every node within 1e-3 of
the line length of the parent profile interpolated at its unstretched arc length."""
@@ -376,6 +415,15 @@ def main() -> int:
errs.append("mesh parent %s did not converge" % mesh)
else:
errs += mesh_twin_errors(res, pr, mesh)
+ if case.get("side") and not errs:
+ errs += side_errors(res, case["side"])
+ mirror = case.get("mirror_of")
+ if mirror and not errs:
+ pr = byid.get(mirror)
+ if pr is None or pr["rc"] != 0 or "forces" not in pr:
+ errs.append("mirror parent %s did not converge" % mirror)
+ else:
+ errs += mirror_errors(res, pr, mirror)
status = "FAIL" if errs else "ok"
print("%-4s %-18s %-14s rc=%-7s %6.2fs wall %6.2fs cpu %s" % (
status, case["id"], case["expect"], res["rc"], res["time"], res["cpu"], "; ".join(errs)[:400]))
diff --git a/tests/test_channel_row.f90 b/tests/test_channel_row.f90
new file mode 100644
index 00000000..ceb902a4
--- /dev/null
+++ b/tests/test_channel_row.f90
@@ -0,0 +1,293 @@
+! File: tests/test_channel_row.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_channel_row
+ !! The deck channels of one output row evaluated together, as the OpenFAST shell's CalcOutput,
+ !! its committed-step record, its linearization and the standalone mixed route evaluate them
+ !! (CD_AGG_EvalChannels: the line-wide values a cable's channels read -- element twists, torsion
+ !! state, end twists, node torques, section curvature -- once per row), against the same
+ !! channels one at a time (CD_AGG_EvalChannel), bit for bit. The deck is coupled: an EI = 0
+ !! line and two finite-EI cables restrained in torsion (nodal twist), the second with
+ !! torque-tension coupling (GJ|K) and a torsional end spring, every fairlead surging and
+ !! rolling with the platform; the channels mix twists, torques, bend moments, curvatures,
+ !! tensions, kinematics and point forces of all three lines.
+ !! 1. the static state, then every step of a rolling, surging march: a row's values must
+ !! follow the state (a line-wide value kept from the row before, the stale row, fails);
+ !! a second row at the same state repeats the first bit for bit;
+ !! 2. a non-stepping transfer of other kinematics (the shell's output probe) changes the
+ !! state without a step: the row follows it;
+ !! 3. OPTIONS CDOutDt, the interval of the shell's committed-step record, reaches the
+ !! aggregate, and a negative interval stops the deck.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_NMovingPoints, &
+ CD_AGG_GetMovingPointMesh, CD_AGG_UpdateStates_Moving, &
+ CD_AGG_Step_Moving, CD_AGG_CalcOutput, CD_AGG_NumChannels, &
+ CD_AGG_EvalChannel, CD_AGG_EvalChannels, CD_AGG_End, CD_AGG_OK
+ USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: INT64
+ IMPLICIT NONE
+
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, RHOW = 1025.0_wp
+ REAL(wp), PARAMETER :: DT = 0.05_wp, DEG = PI/180.0_wp
+ INTEGER, PARAMETER :: NSTEP = 12
+ INTEGER :: n_fail = 0
+
+ CALL write_deck('chrow.dat')
+ CALL check_rows()
+ CALL check_cd_out_dt()
+ IF (n_fail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', n_fail, ' channel row check(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: channel rows (one row against one channel at a time, through a march and a '// &
+ 'probe transfer)'
+
+CONTAINS
+
+ SUBROUTINE require(cond, msg)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: msg
+ IF (.NOT. cond) THEN
+ n_fail = n_fail + 1
+ WRITE (*, '(A,A)') 'FAILED: ', msg
+ END IF
+ END SUBROUTINE require
+
+ LOGICAL FUNCTION same_bits(a, b) RESULT(same)
+ !! Whether two arrays of the same size have the same bit patterns.
+ REAL(wp), INTENT(IN) :: a(:), b(:)
+ INTEGER :: k
+ same = SIZE(a) == SIZE(b)
+ IF (.NOT. same) RETURN
+ DO k = 1, SIZE(a)
+ IF (TRANSFER(a(k), 0_INT64) /= TRANSFER(b(k), 0_INT64)) THEN
+ same = .FALSE.
+ RETURN
+ END IF
+ END DO
+ END FUNCTION same_bits
+
+ SUBROUTINE write_deck(path, extra_option)
+ !! Three taut 100 m lines from fairleads at x = 0 to anchors at x = 100 m, 40 m deep, the cables
+ !! neutrally buoyant: line 1 EI = 0 (twice the displaced mass); line 2 finite EI, clamped and
+ !! restrained in torsion at both ends with a quarter turn of pretwist; line 3 finite EI under
+ !! torque-tension coupling, clamped, rigid in torsion at End A and on a torsional spring at End B.
+ CHARACTER(*), INTENT(IN) :: path
+ CHARACTER(*), INTENT(IN), OPTIONAL :: extra_option
+ INTEGER :: u
+ REAL(wp) :: m
+ CHARACTER(32) :: mtxt, rtxt
+ m = RHOW*0.25_wp*PI*0.04_wp
+ WRITE (mtxt, '(ES24.16)') m
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'channel row gate'
+ WRITE (u, '(A)') '--- LINE TYPES ---'
+ WRITE (u, '(A)') 'Name Diam Mass EA BA EI GAs GJ Irt Irn Cdn Cdt Can Cat'
+ WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (N) (Nm2) (kgm) (kgm) (-) (-) (-) (-)'
+ WRITE (rtxt, '(ES24.16)') 2.0_wp*m
+ WRITE (u, '(A)') 'rope 0.2 '//TRIM(rtxt)//' 1.0e7 0.0 0.0 0.0 0.0 0.0 0.0 1.2 0.0 1.0 0.0'
+ WRITE (u, '(A)') 'cab 0.2 '//TRIM(mtxt)//' 1.0e7 0.0 1.0e6 1.0e8 5.0e4 1.0 2.0 1.2 0.0 1.0 0.0'
+ WRITE (u, '(A)') 'arm 0.2 '//TRIM(mtxt)//' 1.0e7 0.0 1.0e6 1.0e8 5.0e4|4.0e3 1.0 2.0 1.2 0.0 1.0 0.0'
+ WRITE (u, '(A)') '--- POINTS ---'
+ WRITE (u, '(A)') 'ID Type X Y Z'
+ WRITE (u, '(A)') '(-) (-) (m) (m) (m)'
+ WRITE (u, '(A)') '1 Coupled 0.0 -20.0 -40.0'
+ WRITE (u, '(A)') '2 Fixed 100.0 -20.0 -40.0'
+ WRITE (u, '(A)') '3 Coupled 0.0 0.0 -40.0'
+ WRITE (u, '(A)') '4 Fixed 100.0 0.0 -40.0'
+ WRITE (u, '(A)') '5 Coupled 0.0 20.0 -40.0'
+ WRITE (u, '(A)') '6 Fixed 100.0 20.0 -40.0'
+ WRITE (u, '(A)') '--- LINES ---'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ WRITE (u, '(A)') '(-) (-) (-) (-)'
+ WRITE (u, '(A)') '1 1 2 -'
+ WRITE (u, '(A)') '2 3 4 -'
+ WRITE (u, '(A)') '3 5 6 -'
+ WRITE (u, '(A)') '--- SECTIONS ---'
+ WRITE (u, '(A)') 'LineID LineType Length NumSegs'
+ WRITE (u, '(A)') '(-) (-) (m) (-)'
+ WRITE (u, '(A)') '1 rope 99.5 10'
+ WRITE (u, '(A)') '2 cab 99.5 12'
+ WRITE (u, '(A)') '3 arm 99.5 12'
+ WRITE (u, '(A)') '--- END CONNECTIONS ---'
+ WRITE (u, '(A)') 'LineID End Stiffness EzX EzY EzZ TorsStiffness NxX NxY NxZ Pretwist'
+ WRITE (u, '(A)') '(-) (-) (N-m/rad) (-) (-) (-) (N-m/rad) (-) (-) (-) (deg)'
+ WRITE (u, '(A)') '2 A Rigid 1 0 0 Rigid 0 0 1 0'
+ WRITE (u, '(A)') '2 B Rigid 1 0 0 Rigid 0 0 1 90'
+ WRITE (u, '(A)') '3 A Rigid 1 0 0 Rigid 0 0 1 0'
+ WRITE (u, '(A)') '3 B Rigid 1 0 0 2.0e4 0 0 1 45'
+ WRITE (u, '(A)') '--- OPTIONS ---'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '0.05 dtM'
+ IF (PRESENT(extra_option)) WRITE (u, '(A)') extra_option
+ WRITE (u, '(A)') '--- OUTPUTS ---'
+ WRITE (u, '(A)') 'FairTen1'
+ WRITE (u, '(A)') 'L1N4pz'
+ WRITE (u, '(A)') 'L1N4ax'
+ WRITE (u, '(A)') 'Point1Fx'
+ WRITE (u, '(A)') 'Twist2'
+ WRITE (u, '(A)') 'Twist2N1'
+ WRITE (u, '(A)') 'Twist2N5'
+ WRITE (u, '(A)') 'Twist2N12'
+ WRITE (u, '(A)') 'Torq2N1'
+ WRITE (u, '(A)') 'Torq2N7'
+ WRITE (u, '(A)') 'BendMom2N3'
+ WRITE (u, '(A)') 'BendMom2N8'
+ WRITE (u, '(A)') 'Curv2N4'
+ WRITE (u, '(A)') 'CurvX2N4'
+ WRITE (u, '(A)') 'CurvY2N9'
+ WRITE (u, '(A)') 'Ten2N6'
+ WRITE (u, '(A)') 'L2N6vy'
+ WRITE (u, '(A)') 'L2N6ay'
+ WRITE (u, '(A)') 'FairTen2'
+ WRITE (u, '(A)') 'Twist3'
+ WRITE (u, '(A)') 'Twist3N2'
+ WRITE (u, '(A)') 'Twist3N11'
+ WRITE (u, '(A)') 'Torq3N1'
+ WRITE (u, '(A)') 'Torq3N13'
+ WRITE (u, '(A)') 'BendMom3N6'
+ WRITE (u, '(A)') 'CurvX3N6'
+ WRITE (u, '(A)') 'Ten3N6'
+ WRITE (u, '(A)') 'AnchTen3'
+ WRITE (u, '(A)') 'Point5Fz'
+ WRITE (u, '(A)') '--- END ---'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE check_cd_out_dt()
+ !! OPTIONS CDOutDt (the shell's .CD.out row interval) is carried to the aggregate, 0 without it;
+ !! a negative interval fails the deck naming the option.
+ TYPE(CD_AGG_ModuleType) :: agg
+ INTEGER :: es
+ CHARACTER(512) :: em
+ CALL CD_AGG_Init_From_Deck(agg, 'chrow.dat', DT, es, em, host_orientation=.TRUE.)
+ CALL require(es == CD_AGG_OK .AND. .NOT. (ABS(agg%cd_out_dt) > 0.0_wp), &
+ 'without CDOutDt the record keeps a row per step (cd_out_dt = 0)')
+ CALL CD_AGG_End(agg, es, em)
+ CALL write_deck('chrow_cdout.dat', '0.1 CDOutDt')
+ CALL CD_AGG_Init_From_Deck(agg, 'chrow_cdout.dat', DT, es, em, host_orientation=.TRUE.)
+ CALL require(es == CD_AGG_OK, 'a deck with CDOutDt builds: '//TRIM(em))
+ CALL require(ABS(agg%cd_out_dt - 0.1_wp) <= 0.0_wp, 'CDOutDt reaches the aggregate')
+ CALL CD_AGG_End(agg, es, em)
+ CALL write_deck('chrow_cdout.dat', '-0.1 cd_out_dt')
+ CALL CD_AGG_Init_From_Deck(agg, 'chrow_cdout.dat', DT, es, em, host_orientation=.TRUE.)
+ CALL require(es /= CD_AGG_OK .AND. INDEX(em, 'cd_out_dt') + INDEX(em, 'CDOutDt') > 0, &
+ 'a negative CDOutDt stops the deck naming the option: '//TRIM(em))
+ CALL CD_AGG_End(agg, es, em)
+ END SUBROUTINE check_cd_out_dt
+
+ FUNCTION roll_dcm(phi) RESULT(r)
+ !! OpenFAST mesh orientation (global to local) of a roll phi about +x.
+ REAL(wp), INTENT(IN) :: phi
+ REAL(wp) :: r(3, 3)
+ r = 0.0_wp
+ r(1, 1) = 1.0_wp
+ r(2, 2) = COS(phi)
+ r(2, 3) = SIN(phi)
+ r(3, 2) = -SIN(phi)
+ r(3, 3) = COS(phi)
+ END FUNCTION roll_dcm
+
+ SUBROUTINE one_at_a_time(agg, values)
+ TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg
+ REAL(wp), INTENT(OUT) :: values(:)
+ INTEGER :: i, es
+ CHARACTER(512) :: em
+ DO i = 1, SIZE(values)
+ CALL CD_AGG_EvalChannel(agg, i, values(i), es, em)
+ CALL require(es == CD_AGG_OK, 'channel evaluates: '//TRIM(em))
+ END DO
+ END SUBROUTINE one_at_a_time
+
+ SUBROUTINE row(agg, values)
+ TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg
+ REAL(wp), INTENT(OUT) :: values(:)
+ INTEGER :: es, n_done
+ CHARACTER(512) :: em
+ values = 0.0_wp
+ CALL CD_AGG_EvalChannels(agg, values, n_done, es, em)
+ CALL require(es == CD_AGG_OK .AND. n_done == SIZE(values), 'the row evaluates: '//TRIM(em))
+ END SUBROUTINE row
+
+ SUBROUTINE check_rows()
+ TYPE(CD_AGG_ModuleType) :: agg
+ INTEGER, PARAMETER :: NCP = 3
+ ! the twist and torque channels away from End A (Twist2N1, the twist from End A to End A, is 0)
+ INTEGER, PARAMETER :: TWIST_CH(10) = [5, 7, 8, 9, 10, 20, 21, 22, 23, 24]
+ REAL(wp) :: pos(3, NCP), vel(3, NCP), acc(3, NCP), load(3, NCP), orient(3, 3, NCP)
+ REAL(wp) :: omega(3, NCP), alpha(3, NCP), x0(3, NCP), pos2(3, NCP)
+ REAL(wp), ALLOCATABLE :: v_row(:), v_one(:), v_again(:), v_prev(:), v_b(:)
+ REAL(wp) :: phi, rate, amp, w, t
+ INTEGER :: es, ni, k, nmp, nch, j
+ LOGICAL :: cv, st, rows_ok, moved
+ CHARACTER(512) :: em
+
+ CALL CD_AGG_Init_From_Deck(agg, 'chrow.dat', DT, es, em, host_orientation=.TRUE.)
+ CALL require(es == CD_AGG_OK, 'the channel row deck builds on the aggregate: '//TRIM(em))
+ IF (es /= CD_AGG_OK) RETURN
+ nmp = CD_AGG_NMovingPoints(agg, es, em)
+ CALL require(nmp == NCP .AND. agg%ncable == 2, 'the deck is one EI = 0 line and two coupled cables')
+ IF (nmp /= NCP) RETURN
+ nch = CD_AGG_NumChannels(agg)
+ CALL require(nch == 29, 'the deck declares its 29 channels')
+ ALLOCATE (v_row(nch), v_one(nch), v_again(nch), v_prev(nch), v_b(nch))
+
+ ! 1. the static state, then a rolling, surging march
+ CALL row(agg, v_row)
+ CALL one_at_a_time(agg, v_one)
+ CALL require(same_bits(v_row, v_one), '1: static state: the row equals the channels one at a time')
+ CALL CD_AGG_GetMovingPointMesh(agg, pos, vel, acc, load, es, em, orientation=orient)
+ x0 = pos
+ rate = 20.0_wp*DEG
+ amp = 0.5_wp
+ w = 2.0_wp*PI/1.2_wp
+ rows_ok = .TRUE.
+ moved = .TRUE.
+ v_prev = v_row
+ DO k = 1, NSTEP
+ t = DT*k
+ phi = rate*t
+ DO j = 1, NCP
+ orient(:, :, j) = roll_dcm(phi)
+ pos(:, j) = x0(:, j)
+ pos(1, j) = x0(1, j) + amp*SIN(w*t)
+ vel(:, j) = 0.0_wp
+ vel(1, j) = amp*w*COS(w*t)
+ acc(:, j) = 0.0_wp
+ acc(1, j) = -amp*w*w*SIN(w*t)
+ omega(:, j) = [rate, 0.0_wp, 0.0_wp]
+ alpha(:, j) = 0.0_wp
+ END DO
+ CALL CD_AGG_Step_Moving(agg, DT, pos, vel, acc, cv, st, ni, es, em, orientation=orient, &
+ angular_velocity=omega, angular_acceleration=alpha)
+ CALL require(es == CD_AGG_OK .AND. cv, '1: the march step converges: '//TRIM(em))
+ IF (es /= CD_AGG_OK) EXIT
+ CALL CD_AGG_CalcOutput(agg, es, em)
+ CALL row(agg, v_row)
+ CALL one_at_a_time(agg, v_one)
+ CALL row(agg, v_again)
+ rows_ok = rows_ok .AND. same_bits(v_row, v_one) .AND. same_bits(v_again, v_row)
+ ! every twist and torque channel moves with the roll: a row value kept from the state before
+ ! would show here
+ moved = moved .AND. ALL(ABS(v_row(TWIST_CH) - v_prev(TWIST_CH)) > 0.0_wp)
+ v_prev = v_row
+ END DO
+ CALL require(rows_ok, '1: every step: the row equals the channels one at a time, and a second row '// &
+ 'at the same state repeats it, bit for bit')
+ CALL require(moved, '1: the twist and torque channels change at every step (the rows follow the state)')
+ WRITE (*, '(A,F10.4,A,F10.4,A)') '1 march: Twist2 ', v_row(5), ' deg, Twist3 ', v_row(20), ' deg'
+
+ ! 2. a non-stepping transfer of other kinematics changes the state without a step
+ pos2 = pos
+ pos2(2, :) = pos(2, :) + 0.05_wp
+ CALL CD_AGG_UpdateStates_Moving(agg, pos2, vel, acc, es, em, output_probe=.TRUE., orientation=orient, &
+ angular_velocity=omega, angular_acceleration=alpha)
+ CALL require(es == CD_AGG_OK, '2: the probe transfer applies: '//TRIM(em))
+ CALL CD_AGG_CalcOutput(agg, es, em)
+ CALL row(agg, v_b)
+ CALL one_at_a_time(agg, v_one)
+ CALL require(same_bits(v_b, v_one), '2: after a probe transfer: the row equals the channels one at a time')
+ CALL require(.NOT. same_bits(v_b, v_row), '2: the probe transfer changes the row (it follows the state)')
+ CALL CD_AGG_End(agg, es, em)
+ END SUBROUTINE check_rows
+END PROGRAM test_channel_row
diff --git a/tests/test_free_end_deck.f90 b/tests/test_free_end_deck.f90
new file mode 100644
index 00000000..ef2d6ddc
--- /dev/null
+++ b/tests/test_free_end_deck.f90
@@ -0,0 +1,357 @@
+! File: tests/test_free_end_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_free_end_deck
+ !! A finite-EI line ending on a Free point (a free end): a 7 m cable (Diam 0.048 m, 2.8 kg/m,
+ !! EA 1e8 N) hanging from a Coupled point at z = -0.5 m with a 200 kg clump (0.02548 m^3, CdA
+ !! 0.06 m^2, CA 1) on its Free End B, 70 elements:
+ !! F1 in still water the run holds the static state: the top tension is the submerged weight of
+ !! the line and the clump (to 1e-6 relative), the end hangs one stretched line length below
+ !! the top (the stretch (W_B L + w L^2/2)/EA, to 1e-7 m), nothing moves over the run, and
+ !! the force the line exerts on the point (AnchTen1, Point2Fz) is the clump's submerged weight
+ !! (to 1e-6 relative), as the EI = 0 Free point reads it: the point's own loads stay out;
+ !! F2 in a 0.5 m/s current along x the end rests where the same deck as an EI = 0 line on the
+ !! point-system route puts its Free point (EI 3 N m^2: within 2e-5 m), and the Point
+ !! channels of the free end read its line's End B node;
+ !! F3 a prescribed 0.05 m sway of the top at 0.05 Hz moves the end in phase with an amplitude
+ !! ratio within 1 % of the Rayleigh estimate for a hanging string with a heavy end mass
+ !! (1.104: the end mass with its added mass, a third of the line's, the mean tension);
+ !! F6 the point keeps its isotropic drag rho CdA |w| w / 2: in a vertical 0.5 m/s current along
+ !! the hanging line (axial flow at the end) the top tension grows by the clump's drag
+ !! rho CdA w^2 / 2 = 7.69 N (to 1e-3 N; the line's own axial drag is zero here);
+ !! F5 on a flat seabed above which the vertical seed would lie (7.3 m deep, the line 7 m from
+ !! z = -0.5 m), a 5 kg end in a 0.8 m/s current rests above the seabed (the seed is placed on
+ !! it, the release lifts the end), and the 200 kg clump, which comes to rest on the seabed
+ !! (6 m deep), is refused by name (a Free point has no seabed contact on a finite-EI line);
+ !! F4 a Free point that is not such an end leaves the deck as it was, refused by the routes'
+ !! own messages: a clamped End B, a net-buoyant end, a second Free point.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, G = 9.80665_wp, RHO = 1025.0_wp
+ REAL(wp), PARAMETER :: L = 7.0_wp, D = 0.048_wp, M = 2.8_wp, EA = 1.0e8_wp
+ REAL(wp), PARAMETER :: MB = 200.0_wp, VB = 0.02548_wp
+ INTEGER :: nfail = 0
+
+ CALL check_still()
+ CALL check_current()
+ CALL check_sway()
+ CALL check_refusals()
+ CALL check_seabed()
+ CALL check_axial_drag()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: free cable end deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_profile(path, u)
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), INTENT(IN) :: u
+ INTEGER :: k
+ OPEN (NEWUNIT=k, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (k, '(A)') 'z ux uy uz'
+ WRITE (k, '(A)') '(m) (m/s) (m/s) (m/s)'
+ WRITE (k, '(A,F6.3,A)') '-20 ', u, ' 0 0'
+ WRITE (k, '(A,F6.3,A)') '0 ', u, ' 0 0'
+ CLOSE (k)
+ END SUBROUTINE write_profile
+
+ SUBROUTINE write_deck(path, ei, pt2, extra_pts, endconn, opts_extra, outs, dt, tmax)
+ !! ei: the type's EI; pt2: the Free point row of End B (after 'ID'); extra_pts: more POINTS rows
+ !! (';'-separated, '' for none); endconn: an END CONNECTIONS data row ('' for none);
+ !! opts_extra: more OPTIONS rows (';'-separated); outs: OUTPUTS channels (';'-separated).
+ CHARACTER(*), INTENT(IN) :: path, ei, pt2, extra_pts, endconn, opts_extra, outs
+ REAL(wp), INTENT(IN) :: dt, tmax
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'free cable end gate'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ WRITE (u, '(A)') 'TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t'
+ WRITE (u, '(A)') '(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-)'
+ WRITE (u, '(A)') 'cable 0.048 2.8 1.0e8 0.0 '//ei//' 1.2 0.0 1.0 0.0'
+ WRITE (u, '(A)') '----------------------- POINTS ----------------------------------------------'
+ WRITE (u, '(A)') 'ID Attachment X Y Z M V CdA CA'
+ WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)'
+ WRITE (u, '(A)') '1 Coupled 0.0 0.0 -0.5 0 0 0 0'
+ WRITE (u, '(A)') '2 '//pt2
+ CALL put_rows(u, extra_pts)
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID LineType AttachA AttachB UnstrLen NumSegs Outputs'
+ WRITE (u, '(A)') '(-) (-) (-) (-) (m) (-) (-)'
+ WRITE (u, '(A)') '1 cable 1 2 7.0 70 -'
+ IF (LEN_TRIM(endconn) > 0) THEN
+ WRITE (u, '(A)') '--------------------- END CONNECTIONS ----------------------------------'
+ WRITE (u, '(A)') 'LineID End Stiffness EzX EzY EzZ'
+ WRITE (u, '(A)') '(-) (-) (N-m/rad) (-) (-) (-)'
+ WRITE (u, '(A)') endconn
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '1025 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ IF (INDEX(opts_extra, 'WtrDpth') == 0) WRITE (u, '(A)') '20 WtrDpth'
+ WRITE (u, '(ES12.5,A)') dt, ' dtM'
+ WRITE (u, '(ES12.5,A)') tmax, ' TMax'
+ CALL put_rows(u, opts_extra)
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ CALL put_rows(u, outs)
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE put_rows(u, rows)
+ INTEGER, INTENT(IN) :: u
+ CHARACTER(*), INTENT(IN) :: rows
+ INTEGER :: i0, i1
+ i0 = 1
+ DO WHILE (i0 <= LEN_TRIM(rows))
+ i1 = INDEX(rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END SUBROUTINE put_rows
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, ncol, tab, n)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER, INTENT(IN) :: ncol
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(2048) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(ncol, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ SUBROUTINE check_still()
+ REAL(wp), ALLOCATABLE :: tab(:, :), t0(:, :)
+ REAL(wp) :: w, wb, stretch
+ INTEGER :: n, n0
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('fed_still.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '', &
+ 'FairTen1;Point2px;Point2pz;AnchTen1;Point2Fz;Point2Fx', 0.005_wp, 2.0_wp)
+ CALL run('fed_still.dat', 'fed_still', ok, msg)
+ CALL require(ok, 'F1 still-water run: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_still.out', 7, tab, n)
+ CALL require(n > 10, 'F1 output rows')
+ IF (n <= 10) RETURN
+ w = (M - RHO*0.25_wp*PI*D**2)*G
+ wb = (MB - RHO*VB)*G
+ stretch = (wb*L + 0.5_wp*w*L**2)/EA
+ CALL require(ABS(tab(2, 1)/(w*L + wb) - 1.0_wp) < 1.0e-6_wp, 'F1 top tension = submerged weight')
+ CALL require(ABS(tab(4, 1) - (-0.5_wp - L - stretch)) < 1.0e-7_wp, 'F1 end one stretched length below')
+ CALL require(MAXVAL(ABS(tab(3:4, 1:n) - SPREAD(tab(3:4, 1), 2, n))) < 1.0e-10_wp, 'F1 nothing moves')
+ CALL require(ABS(tab(5, n)/wb - 1.0_wp) < 1.0e-6_wp, 'F1 AnchTen = the clump''s submerged weight')
+ CALL require(ABS(tab(6, n)/wb - 1.0_wp) < 1.0e-6_wp .AND. ABS(tab(7, n)) < 1.0e-6_wp*wb, &
+ 'F1 Point2Fz = the clump''s submerged weight')
+ CALL write_deck('fed_still0.dat', '0', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '', &
+ 'AnchTen1;Point2Fz', 0.005_wp, 0.1_wp)
+ CALL run('fed_still0.dat', 'fed_still0', ok, msg)
+ CALL require(ok, 'F1 EI = 0 still-water run: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_still0.out', 3, t0, n0)
+ IF (n0 > 0) CALL require(ABS(tab(5, n) - t0(2, n0)) < 1.0e-6_wp*wb .AND. &
+ ABS(tab(6, n) - t0(3, n0)) < 1.0e-6_wp*wb, 'F1 the end force = the EI = 0 Free point''s')
+ END SUBROUTINE check_still
+
+ SUBROUTINE check_current()
+ REAL(wp), ALLOCATABLE :: tf(:, :), t0(:, :)
+ INTEGER :: nf, n0
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_profile('current_profile.txt', 0.5_wp)
+ CALL write_deck('fed_cur.dat', '3', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '1 Currents', &
+ 'Point2px;Con2pz;L1N71px;L1N71pz', 0.005_wp, 0.5_wp)
+ CALL run('fed_cur.dat', 'fed_cur', ok, msg)
+ CALL require(ok, 'F2 finite-EI free end in current: '//TRIM(msg))
+ CALL write_deck('fed_cur0.dat', '0', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '1 Currents', &
+ 'Point2px;Point2pz', 0.005_wp, 0.5_wp)
+ CALL run('fed_cur0.dat', 'fed_cur0', ok, msg)
+ CALL require(ok, 'F2 EI = 0 Free point in current: '//TRIM(msg))
+ CALL read_out('fed_cur.out', 5, tf, nf)
+ CALL read_out('fed_cur0.out', 3, t0, n0)
+ IF (nf < 1 .OR. n0 < 1) THEN
+ CALL require(.FALSE., 'F2 output rows')
+ RETURN
+ END IF
+ CALL require(ABS(tf(2, 1) - t0(2, 1)) < 2.0e-5_wp .AND. ABS(tf(3, 1) - t0(3, 1)) < 2.0e-5_wp, &
+ 'F2 rest position = the EI = 0 Free point''s')
+ CALL require(tf(2, 1) > 0.1_wp, 'F2 the end is carried downstream')
+ CALL require(ABS(tf(2, nf) - tf(4, nf)) < 1.0e-12_wp .AND. ABS(tf(3, nf) - tf(5, nf)) < 1.0e-12_wp, &
+ 'F2 Point channels read the End B node')
+ END SUBROUTINE check_current
+
+ SUBROUTINE check_sway()
+ REAL(wp), PARAMETER :: A = 0.05_wp, F = 0.05_wp, DT = 0.01_wp, TMAX = 120.0_wp, TR = 20.0_wp
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ REAL(wp) :: t, r, dr, ddr, om, s, c, ata(3, 3), atb(3), coef(3), w, wb, ma, tmean, om2, ratio
+ INTEGER :: u, k, n, i
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ om = 2.0_wp*PI*F
+ OPEN (NEWUNIT=u, FILE='fed_motion.txt', STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '# time point x y z vx vy vz ax ay az'
+ DO k = 0, NINT(TMAX/DT)
+ t = REAL(k, wp)*DT
+ IF (t < TR) THEN
+ r = 0.5_wp*(1.0_wp - COS(PI*t/TR))
+ dr = 0.5_wp*PI/TR*SIN(PI*t/TR)
+ ddr = 0.5_wp*(PI/TR)**2*COS(PI*t/TR)
+ ELSE
+ r = 1.0_wp; dr = 0.0_wp; ddr = 0.0_wp
+ END IF
+ s = SIN(om*t); c = COS(om*t)
+ WRITE (u, '(F12.6,A,3ES17.9,A,ES17.9,A,ES17.9,A)') t, ' 1', A*r*s, 0.0_wp, -0.5_wp, ' ', &
+ A*(dr*s + r*om*c), ' 0 0 ', A*(ddr*s + 2.0_wp*dr*om*c - r*om*om*s), ' 0 0'
+ END DO
+ CLOSE (u)
+ CALL write_deck('fed_sway.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', &
+ 'fed_motion.txt motionFile', 'Point2px', DT, TMAX)
+ CALL run('fed_sway.dat', 'fed_sway', ok, msg)
+ CALL require(ok, 'F3 prescribed sway: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_sway.out', 2, tab, n)
+ ata = 0.0_wp; atb = 0.0_wp
+ DO i = 1, n
+ IF (tab(1, i) < 40.0_wp) CYCLE
+ coef = [SIN(om*tab(1, i)), COS(om*tab(1, i)), 1.0_wp]
+ ata = ata + SPREAD(coef, 2, 3)*SPREAD(coef, 1, 3)
+ atb = atb + coef*tab(2, i)
+ END DO
+ CALL solve3(ata, atb, coef)
+ ! Rayleigh estimate, shape s/L from the top: omega_p^2 = (mean tension / L)/(end mass with
+ ! added mass + a third of the line's mass with added mass)
+ w = (M - RHO*0.25_wp*PI*D**2)*G
+ wb = (MB - RHO*VB)*G
+ tmean = wb + 0.5_wp*w*L
+ ma = (MB + RHO*VB) + (M + RHO*0.25_wp*PI*D**2)*L/3.0_wp
+ om2 = (tmean/L)/ma
+ ratio = 1.0_wp/(1.0_wp - om**2/om2)
+ CALL require(ABS(HYPOT(coef(1), coef(2))/A/ratio - 1.0_wp) < 0.01_wp, 'F3 sway amplitude ratio')
+ CALL require(ABS(coef(2)) < 0.05_wp*ABS(coef(1)) .AND. coef(1) > 0.0_wp, 'F3 the end moves in phase')
+ END SUBROUTINE check_sway
+
+ SUBROUTINE solve3(a, b, x)
+ REAL(wp), INTENT(IN) :: a(3, 3), b(3)
+ REAL(wp), INTENT(OUT) :: x(3)
+ REAL(wp) :: m(3, 4), f
+ INTEGER :: i, j
+ m(:, 1:3) = a
+ m(:, 4) = b
+ DO i = 1, 3
+ DO j = i + 1, 3
+ f = m(j, i)/m(i, i)
+ m(j, :) = m(j, :) - f*m(i, :)
+ END DO
+ END DO
+ DO i = 3, 1, -1
+ x(i) = (m(i, 4) - SUM(m(i, i + 1:3)*x(i + 1:3)))/m(i, i)
+ END DO
+ END SUBROUTINE solve3
+
+ SUBROUTINE check_axial_drag()
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ REAL(wp) :: w, wb
+ INTEGER :: n, k
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ OPEN (NEWUNIT=k, FILE='current_profile.txt', STATUS='REPLACE', ACTION='WRITE')
+ WRITE (k, '(A)') 'z ux uy uz'
+ WRITE (k, '(A)') '(m) (m/s) (m/s) (m/s)'
+ WRITE (k, '(A)') '-20 0 0 -0.5'
+ WRITE (k, '(A)') '0 0 0 -0.5'
+ CLOSE (k)
+ CALL write_deck('fed_axial.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '1 Currents', &
+ 'FairTen1', 0.005_wp, 0.05_wp)
+ CALL run('fed_axial.dat', 'fed_axial', ok, msg)
+ CALL require(ok, 'F6 axial current: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_axial.out', 2, tab, n)
+ w = (M - RHO*0.25_wp*PI*D**2)*G
+ wb = (MB - RHO*VB)*G
+ IF (n > 0) CALL require(ABS(tab(2, 1) - (w*L + wb + 0.5_wp*RHO*0.06_wp*0.25_wp)) < 1.0e-3_wp, &
+ 'F6 the clump''s isotropic drag in axial flow')
+ END SUBROUTINE check_axial_drag
+
+ SUBROUTINE check_seabed()
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ INTEGER :: n
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_profile('current_profile.txt', 0.8_wp)
+ CALL write_deck('fed_lift.dat', '3000', 'Free 0.0 0.0 -7.5 5 0.000637 0.01 1.0', '', '', &
+ '1 Currents;7.3 WtrDpth', 'Point2px;Point2pz', 0.005_wp, 0.2_wp)
+ CALL run('fed_lift.dat', 'fed_lift', ok, msg)
+ CALL require(ok, 'F5 a seed below the seabed, the end at rest above it: '//TRIM(msg))
+ IF (ok) THEN
+ CALL read_out('fed_lift.out', 3, tab, n)
+ IF (n > 0) CALL require(tab(3, n) > -7.3_wp + 0.5_wp .AND. tab(2, n) > 1.0_wp, 'F5 the end lifted and carried')
+ END IF
+ CALL write_profile('current_profile.txt', 0.5_wp)
+ CALL write_deck('fed_ground.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', &
+ '1 Currents;6.0 WtrDpth', 'FairTen1', 0.005_wp, 0.1_wp)
+ CALL run('fed_ground.dat', 'fed_ground', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'comes to rest on the seabed') > 0, &
+ 'F5 a clump at rest on the seabed refused: '//TRIM(msg))
+ END SUBROUTINE check_seabed
+
+ SUBROUTINE check_refusals()
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('fed_r1.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '1 B Rigid 0 0 -1', '', &
+ 'FairTen1', 0.005_wp, 0.1_wp)
+ CALL run('fed_r1.dat', 'fed_r1', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'non-pinned END CONNECTIONS need End B') > 0, &
+ 'F4 clamped End B refused: '//TRIM(msg))
+ CALL write_deck('fed_r2.dat', '3000', 'Free 0.0 0.0 -7.5 10 0.5 0.06 1.0', '', '', '', 'FairTen1', &
+ 0.005_wp, 0.1_wp)
+ CALL run('fed_r2.dat', 'fed_r2', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'not supported on the multibody march') > 0, &
+ 'F4 net-buoyant end refused: '//TRIM(msg))
+ CALL write_deck('fed_r3.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', &
+ '3 Free 5.0 0.0 -5.0 10 0 0 0', '', '', 'FairTen1', 0.005_wp, 0.1_wp)
+ CALL run('fed_r3.dat', 'fed_r3', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'not supported on the multibody march') > 0, &
+ 'F4 a second Free point refused: '//TRIM(msg))
+ END SUBROUTINE check_refusals
+END PROGRAM test_free_end_deck
diff --git a/tests/test_hermite_bending_damping.f90 b/tests/test_hermite_bending_damping.f90
new file mode 100644
index 00000000..0409ef66
--- /dev/null
+++ b/tests/test_hermite_bending_damping.f90
@@ -0,0 +1,253 @@
+! File: tests/test_hermite_bending_damping.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_bending_damping
+ !! Kernel gates of the Kelvin-Voigt bending damping (CD_HermiteCable_Bending_Damping):
+ !! K1 Kv equals the central difference of fdamp in the rates, Kq that in the positions, on a
+ !! stretched, twisted 3D element and on a straight one;
+ !! K2 fdamp is linear in the rates, dissipative (v . fdamp >= 0) and zero for Bb = 0;
+ !! K3 zero for a rigid translation and for a rigid rotation whose axis is normal to the
+ !! tangent everywhere (a planar arc spun about the normal of its plane);
+ !! K4 the planar rate: a straight element bent in its plane at curvature rate kdot dissipates
+ !! Bb kdot^2 L, the dissipation function's closed form;
+ !! K5 bad inputs are refused by name;
+ !! K6 with a length rate l0_dot (active line control) the force is d psi / d v of the
+ !! dissipation function built independently from the public curvature (kappa_b = t x kvec,
+ !! CD_HermiteCable_Curvature) with its rate by central differences in the DOFs and the
+ !! length, and a length change alone (v = 0) is damped;
+ !! K7 Kq and Kv with a length rate equal the central differences of the force.
+ USE CableDyn_Precision, ONLY: wp
+ USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_VALUE, IEEE_POSITIVE_INF
+ USE CableDyn_HermiteCable, ONLY: CD_HermiteCable_Bending_Damping, CD_HCABLE_OK, CD_HermiteCable_Curvature, &
+ CD_HermiteCable_Shapes, CD_HermiteCable_Gauss_Rule
+ IMPLICIT NONE
+ INTEGER :: nfail = 0
+ REAL(wp), PARAMETER :: L = 2.5_wp, BB = 37.0_wp
+
+ CALL check_jacobians()
+ CALL check_linear_dissipative()
+ CALL check_rigid_motions()
+ CALL check_planar_rate()
+ CALL check_refusals()
+ CALL check_length_rate()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: Hermite bending damping kernel'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE curved_state(q, v)
+ !! A stretched, out-of-plane curved element with arbitrary nodal rates.
+ REAL(wp), INTENT(OUT) :: q(12), v(12)
+ q = [0.0_wp, 0.0_wp, 0.0_wp, 1.02_wp, 0.3_wp, -0.2_wp, &
+ 2.4_wp, 0.5_wp, -0.3_wp, 0.9_wp, -0.25_wp, 0.35_wp]
+ v = [0.11_wp, -0.23_wp, 0.31_wp, 0.4_wp, -0.15_wp, 0.27_wp, &
+ -0.19_wp, 0.08_wp, 0.42_wp, -0.33_wp, 0.21_wp, 0.12_wp]
+ END SUBROUTINE curved_state
+
+ SUBROUTINE fd_check(q, v, label)
+ REAL(wp), INTENT(IN) :: q(12), v(12)
+ CHARACTER(*), INTENT(IN) :: label
+ REAL(wp) :: f(12), Kq(12, 12), Kv(12, 12), fp(12), fm(12), Kq_fd(12, 12), Kv_fd(12, 12), dq(12), h
+ REAL(wp) :: eq, ev
+ INTEGER :: es, j
+ CHARACTER(256) :: em
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, Kq, Kv, es, em)
+ CALL require(es == CD_HCABLE_OK, 'K1 '//label//': evaluation: '//TRIM(em))
+ DO j = 1, 12
+ h = 1.0e-6_wp*MAX(1.0_wp, ABS(q(j)))
+ dq = 0.0_wp; dq(j) = h
+ CALL CD_HermiteCable_Bending_Damping(q + dq, v, L, BB, fp, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_Bending_Damping(q - dq, v, L, BB, fm, ErrStat=es, ErrMsg=em)
+ Kq_fd(:, j) = (fp - fm)/(2.0_wp*h)
+ h = 1.0e-6_wp*MAX(1.0_wp, ABS(v(j)))
+ dq = 0.0_wp; dq(j) = h
+ CALL CD_HermiteCable_Bending_Damping(q, v + dq, L, BB, fp, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_Bending_Damping(q, v - dq, L, BB, fm, ErrStat=es, ErrMsg=em)
+ Kv_fd(:, j) = (fp - fm)/(2.0_wp*h)
+ END DO
+ eq = MAXVAL(ABS(Kq - Kq_fd))/MAX(1.0e-12_wp, MAXVAL(ABS(Kq_fd)))
+ ev = MAXVAL(ABS(Kv - Kv_fd))/MAX(1.0e-12_wp, MAXVAL(ABS(Kv_fd)))
+ WRITE (*, '(A,2ES11.3)') 'K1 '//label//': relative |Kq - FD|, |Kv - FD| ', eq, ev
+ CALL require(eq < 1.0e-6_wp, 'K1 '//label//': Kq matches the central difference')
+ CALL require(ev < 1.0e-6_wp, 'K1 '//label//': Kv matches the central difference')
+ CALL require(MAXVAL(ABS(Kv - TRANSPOSE(Kv))) <= 1.0e-12_wp*MAXVAL(ABS(Kv)), 'K1 '//label//': Kv symmetric')
+ END SUBROUTINE fd_check
+
+ SUBROUTINE check_jacobians()
+ REAL(wp) :: q(12), v(12)
+ CALL curved_state(q, v)
+ CALL fd_check(q, v, 'curved 3D')
+ ! straight, unstretched element along x (the zero-curvature state)
+ q = [0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, L, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp]
+ CALL fd_check(q, v, 'straight')
+ END SUBROUTINE check_jacobians
+
+ SUBROUTINE check_linear_dissipative()
+ REAL(wp) :: q(12), v(12), f1(12), f2(12)
+ INTEGER :: es
+ CHARACTER(256) :: em
+ CALL curved_state(q, v)
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f1, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_Bending_Damping(q, 2.0_wp*v, L, BB, f2, ErrStat=es, ErrMsg=em)
+ CALL require(MAXVAL(ABS(f2 - 2.0_wp*f1)) <= 1.0e-12_wp*MAXVAL(ABS(f1)), 'K2: linear in the rates')
+ CALL require(DOT_PRODUCT(v, f1) > 0.0_wp, 'K2: dissipative (v . f > 0)')
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, 0.0_wp, f1, ErrStat=es, ErrMsg=em)
+ CALL require(es == CD_HCABLE_OK .AND. MAXVAL(ABS(f1)) == 0.0_wp, 'K2: zero for Bb = 0')
+ END SUBROUTINE check_linear_dissipative
+
+ SUBROUTINE check_rigid_motions()
+ REAL(wp) :: q(12), v(12), f(12), scale, omega(3)
+ INTEGER :: es, k
+ CHARACTER(256) :: em
+ CALL curved_state(q, v)
+ ! rigid translation: every node moves with c, tangents fixed
+ v = [0.3_wp, -0.7_wp, 0.2_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.3_wp, -0.7_wp, 0.2_wp, 0.0_wp, 0.0_wp, 0.0_wp]
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, ErrStat=es, ErrMsg=em)
+ CALL require(MAXVAL(ABS(f)) <= 1.0e-12_wp*BB, 'K3: zero for a rigid translation')
+ ! a planar arc in the x-z plane spun about y (normal to every tangent): v = omega x r, m' = omega x m
+ q = [0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.4_wp, 2.3_wp, 0.0_wp, 0.6_wp, 0.8_wp, 0.0_wp, -0.3_wp]
+ omega = [0.0_wp, 0.9_wp, 0.0_wp]
+ DO k = 0, 3
+ v(3*k + 1:3*k + 3) = cross(omega, q(3*k + 1:3*k + 3))
+ END DO
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, ErrStat=es, ErrMsg=em)
+ ! reference: the same element bent at the same rate scale
+ scale = BB*0.9_wp/L
+ WRITE (*, '(A,ES11.3)') 'K3: rigid in-plane rotation, max |f| / (Bb omega / L) ', MAXVAL(ABS(f))/scale
+ CALL require(MAXVAL(ABS(f)) <= 1.0e-12_wp*scale, 'K3: zero for a rigid rotation normal to the tangents')
+ END SUBROUTINE check_rigid_motions
+
+ SUBROUTINE check_planar_rate()
+ !! A straight unstretched element along x bent in the x-z plane with rates that give a
+ !! uniform curvature rate kdot (w(x) = 1/2 kdot x^2 t, end slopes kdot x): the dissipation
+ !! v . f = 2 psi = Bb kdot^2 L at the straight state.
+ REAL(wp) :: q(12), v(12), f(12), kdot, d
+ INTEGER :: es
+ CHARACTER(256) :: em
+ kdot = 0.17_wp
+ q = [0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, L, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp]
+ v = 0.0_wp
+ ! w = kdot x^2 / 2: node 2 rate kdot L^2/2, slope handle m = dr/ds -> rate kdot L
+ v(9) = 0.5_wp*kdot*L*L
+ v(12) = kdot*L
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, ErrStat=es, ErrMsg=em)
+ d = DOT_PRODUCT(v, f)
+ WRITE (*, '(A,ES14.6,A,ES14.6)') 'K4: v . f ', d, ', Bb kdot^2 L ', BB*kdot*kdot*L
+ CALL require(ABS(d - BB*kdot*kdot*L) <= 1.0e-10_wp*BB*kdot*kdot*L, 'K4: planar dissipation Bb kdot^2 L')
+ END SUBROUTINE check_planar_rate
+
+ SUBROUTINE check_refusals()
+ REAL(wp) :: q(12), v(12), f(12)
+ INTEGER :: es
+ CHARACTER(256) :: em
+ CALL curved_state(q, v)
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, -1.0_wp, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'Bb must be non-negative') > 0, 'K5: negative Bb')
+ CALL CD_HermiteCable_Bending_Damping(q, v, 0.0_wp, BB, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'length must be positive') > 0, 'K5: zero length')
+ q(4:6) = 0.0_wp; q(7:9) = 0.0_wp; q(10:12) = 0.0_wp
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'degenerate centreline') > 0, 'K5: collapsed element')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE kappa_b(q, el, xi, kb)
+ !! The binormal curvature vector (a x b)/|a|^3 from the public routines: t x kvec, with
+ !! kvec = (r' x r'') x r'/|r'|^4 of CD_HermiteCable_Curvature and t from the shape derivatives.
+ REAL(wp), INTENT(IN) :: q(12), el, xi
+ REAL(wp), INTENT(OUT) :: kb(3)
+ REAL(wp) :: H(4), dH(4), a(3), kv(3), cv
+ INTEGER :: es, c
+ CHARACTER(256) :: em
+ CALL CD_HermiteCable_Shapes(xi, el, H, dH)
+ DO c = 1, 3
+ a(c) = (dH(1)*q(c) + dH(2)*q(3 + c) + dH(3)*q(6 + c) + dH(4)*q(9 + c))/el
+ END DO
+ CALL CD_HermiteCable_Curvature(q, el, xi, cv, es, em, kvec=kv)
+ kb = cross(a/NORM2(a), kv)
+ END SUBROUTINE kappa_b
+
+ REAL(wp) FUNCTION psi_fd(q, v, ldot) RESULT(psi)
+ !! 1/2 Bb int |(I - t t^T) dkappa_b/dt|^2 ds over the element, the rate by central differences
+ !! along (v, ldot), with the kernel's Gauss rule (order 4) on the unstretched length.
+ REAL(wp), INTENT(IN) :: q(12), v(12), ldot
+ REAL(wp) :: gp(6), gw(6), kp(3), km(3), kd(3), H(4), dH(4), a(3), tv(3), eps
+ INTEGER :: ig, c
+ eps = 1.0e-6_wp
+ CALL CD_HermiteCable_Gauss_Rule(4, gp, gw)
+ psi = 0.0_wp
+ DO ig = 1, 4
+ CALL kappa_b(q + eps*v, L + eps*ldot, gp(ig), kp)
+ CALL kappa_b(q - eps*v, L - eps*ldot, gp(ig), km)
+ kd = (kp - km)/(2.0_wp*eps)
+ CALL CD_HermiteCable_Shapes(gp(ig), L, H, dH)
+ DO c = 1, 3
+ a(c) = (dH(1)*q(c) + dH(2)*q(3 + c) + dH(3)*q(6 + c) + dH(4)*q(9 + c))/L
+ END DO
+ tv = a/NORM2(a)
+ kd = kd - tv*DOT_PRODUCT(tv, kd)
+ psi = psi + 0.5_wp*BB*DOT_PRODUCT(kd, kd)*gw(ig)*L
+ END DO
+ END FUNCTION psi_fd
+
+ SUBROUTINE check_length_rate()
+ REAL(wp) :: q(12), v(12), f(12), fx(12), dv(12), h, ldot, scale, Kq(12, 12), Kv(12, 12), fp(12), fm(12)
+ REAL(wp) :: Kq_fd(12, 12), Kv_fd(12, 12), eq, ev
+ INTEGER :: es, j
+ CHARACTER(256) :: em
+ CALL curved_state(q, v)
+ ldot = 0.37_wp
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, ErrStat=es, ErrMsg=em, l0_dot=ldot)
+ CALL require(es == CD_HCABLE_OK, 'K6: evaluation with l0_dot: '//TRIM(em))
+ ! d psi / d v by central differences (psi is quadratic in v)
+ h = 1.0e-2_wp
+ DO j = 1, 12
+ dv = 0.0_wp; dv(j) = h
+ fx(j) = (psi_fd(q, v + dv, ldot) - psi_fd(q, v - dv, ldot))/(2.0_wp*h)
+ END DO
+ scale = MAXVAL(ABS(fx))
+ WRITE (*, '(A,ES11.3)') 'K6: max |f - d psi/d v| / max |f| with l0_dot ', MAXVAL(ABS(f - fx))/scale
+ CALL require(MAXVAL(ABS(f - fx)) <= 1.0e-6_wp*scale, 'K6: the force is d psi/d v with the length rate')
+ v = 0.0_wp
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, ErrStat=es, ErrMsg=em, l0_dot=ldot)
+ CALL require(MAXVAL(ABS(f)) > 0.0_wp, 'K6: a length change alone is damped')
+ ! K7: Jacobians with the length rate
+ CALL curved_state(q, v)
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, Kq, Kv, es, em, l0_dot=ldot)
+ DO j = 1, 12
+ h = 1.0e-6_wp*MAX(1.0_wp, ABS(q(j)))
+ dv = 0.0_wp; dv(j) = h
+ CALL CD_HermiteCable_Bending_Damping(q + dv, v, L, BB, fp, ErrStat=es, ErrMsg=em, l0_dot=ldot)
+ CALL CD_HermiteCable_Bending_Damping(q - dv, v, L, BB, fm, ErrStat=es, ErrMsg=em, l0_dot=ldot)
+ Kq_fd(:, j) = (fp - fm)/(2.0_wp*h)
+ h = 1.0e-6_wp*MAX(1.0_wp, ABS(v(j)))
+ dv = 0.0_wp; dv(j) = h
+ CALL CD_HermiteCable_Bending_Damping(q, v + dv, L, BB, fp, ErrStat=es, ErrMsg=em, l0_dot=ldot)
+ CALL CD_HermiteCable_Bending_Damping(q, v - dv, L, BB, fm, ErrStat=es, ErrMsg=em, l0_dot=ldot)
+ Kv_fd(:, j) = (fp - fm)/(2.0_wp*h)
+ END DO
+ eq = MAXVAL(ABS(Kq - Kq_fd))/MAXVAL(ABS(Kq_fd))
+ ev = MAXVAL(ABS(Kv - Kv_fd))/MAXVAL(ABS(Kv_fd))
+ WRITE (*, '(A,2ES11.3)') 'K7: relative |Kq - FD|, |Kv - FD| with l0_dot ', eq, ev
+ CALL require(eq < 1.0e-6_wp .AND. ev < 1.0e-6_wp, 'K7: Jacobians with the length rate')
+ CALL CD_HermiteCable_Bending_Damping(q, v, L, BB, f, ErrStat=es, ErrMsg=em, l0_dot=IEEE_VALUE(1.0_wp, IEEE_POSITIVE_INF))
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'l0_dot must be finite') > 0, 'K5: non-finite l0_dot refused')
+ END SUBROUTINE check_length_rate
+
+ PURE FUNCTION cross(a, b) RESULT(c)
+ REAL(wp), INTENT(IN) :: a(3), b(3)
+ REAL(wp) :: c(3)
+ c = [a(2)*b(3) - a(3)*b(2), a(3)*b(1) - a(1)*b(3), a(1)*b(2) - a(2)*b(1)]
+ END FUNCTION cross
+
+END PROGRAM test_hermite_bending_damping
diff --git a/tests/test_hermite_bending_damping_dynamic.f90 b/tests/test_hermite_bending_damping_dynamic.f90
new file mode 100644
index 00000000..bdbb14b4
--- /dev/null
+++ b/tests/test_hermite_bending_damping_dynamic.f90
@@ -0,0 +1,196 @@
+! File: tests/test_hermite_bending_damping_dynamic.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_bending_damping_dynamic
+ !! Free decay of the first mode of a weightless, pinned-pinned, tensioned finite-EI cable with
+ !! bending Kelvin-Voigt damping (CD_HermiteCable_Dyn_Set_Bending_Damping), generalised-alpha with
+ !! rho_inf = 1 (no numerical damping). For mode shape sin(k x), k = pi/L, the bending moment is
+ !! EI k^2 a and the tension carries T k^2 a, so the mode's damping ratio is
+ !! zeta_1 = omega_1 Bb / (2 EI) * EI k^2 / (EI k^2 + T), omega_1^2 = (EI k^4 + T k^2)/m:
+ !! only the bending share of the modal stiffness is damped.
+ !! B1 a bending-dominated cable (share 0.96) decays at that zeta to 1 %;
+ !! B2 a tension-dominated cable (share 0.2) decays at that smaller zeta to 1 %;
+ !! B3 Bb = 0 leaves the undamped decay (|zeta| below 1e-5) and installing an all-zero array
+ !! keeps the configuration off;
+ !! B4 a negative coefficient or a wrong length is refused;
+ !! B5 a straight cable moving in its first bending mode with zero acceleration has no elastic
+ !! curvature: the node recovery reports none although the bending damping acts (its viscous
+ !! moment is not EI kappa), while the end force carries the damping.
+ !! B6 the residual's round-off floor: a soft line (EA 4e5 N, as a tensioner in series) with a
+ !! stiff bending damping (Bb 1e4 N m^2 s) at dt 1e-4 s. The damping takes the curvature
+ !! rate from the Newmark velocity, whose rounding is gamma/(beta dt) times the coordinates',
+ !! so its force rounds at about Bb gamma/(beta dt) eps |r|/l0^3, far above the axial floor
+ !! EA eps |r|/l0 the tolerance scale allowed: every step stagnated just above the
+ !! tolerance and failed. Every step converges and the motion stays bounded.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Set_Bending_Damping, &
+ CD_HermiteCable_Dyn_Node_Recovery, CD_HermiteCable_Dyn_End_Force, &
+ CD_HCDYN_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
+ REAL(wp), PARAMETER :: LL = 20.0_wp, EA = 1.0e8_wp, EI = 1.0e5_wp, RHOA = 10.0_wp
+ INTEGER, PARAMETER :: NE = 40, NN = NE + 1, NDOF = 6*NN, MID = NE/2 + 1
+ INTEGER :: nfail = 0
+
+ CALL decay_case('B1 bending-dominated', 1.0e2_wp, 0.02_wp)
+ CALL decay_case('B2 tension-dominated', 1.0e4_wp, 0.02_wp)
+ CALL decay_case('B3 undamped', 1.0e4_wp, 0.0_wp)
+ CALL check_refusals()
+ CALL check_recovery()
+ CALL check_roundoff_floor()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: Hermite bending damping dynamic decay'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE setup(model, tens, a0)
+ TYPE(CD_HermiteCableDynType), INTENT(OUT) :: model
+ REAL(wp), INTENT(IN) :: tens, a0
+ REAL(wp) :: l0(NE), ea_(NE), ei_(NE), rho(NE), w(NE), q(NDOF), eps, lt, x
+ INTEGER :: k, es
+ CHARACTER(512) :: em
+ eps = tens/EA; lt = (1.0_wp + eps)*LL
+ l0 = LL/REAL(NE, wp); ea_ = EA; ei_ = EI; rho = RHOA; w = 0.0_wp
+ DO k = 1, NN
+ x = lt*REAL(k - 1, wp)/REAL(NE, wp)
+ q(6*k - 5:6*k) = [x, 0.0_wp, a0*SIN(PI*x/lt), (1.0_wp + eps), 0.0_wp, (1.0_wp + eps)*a0*PI/lt*COS(PI*x/lt)]
+ END DO
+ CALL CD_HermiteCable_Dyn_Init(model, l0, ea_, ei_, rho, w, q, [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3], &
+ -1.0e4_wp, 0.0_wp, 1.0_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'init: '//TRIM(em))
+ END SUBROUTINE setup
+
+ SUBROUTINE decay_case(label, tens, zeta_ref)
+ CHARACTER(*), INTENT(IN) :: label
+ REAL(wp), INTENT(IN) :: tens, zeta_ref
+ TYPE(CD_HermiteCableDynType) :: model
+ REAL(wp) :: kk, om1, share, bb, zeta_expect, dt, z, zprev, zprev2, peaks(200), tpk(200), delta, zeta_meas, res
+ INTEGER :: n, k, np, es, it, nstep
+ CHARACTER(512) :: em
+ kk = PI/LL
+ om1 = SQRT((EI*kk**4 + tens*kk**2)/RHOA)
+ share = EI*kk**2/(EI*kk**2 + tens)
+ bb = 2.0_wp*zeta_ref*EI/om1
+ zeta_expect = om1*bb/(2.0_wp*EI)*share
+ CALL setup(model, tens, 1.0e-3_wp)
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(bb, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, label//': set damping: '//TRIM(em))
+ dt = (2.0_wp*PI/om1)/200.0_wp
+ nstep = 200*12
+ np = 0; zprev = model%q(6*(MID - 1) + 3); zprev2 = zprev
+ DO n = 1, nstep
+ CALL CD_HermiteCable_Dyn_Step(model, dt, 50, 1.0e-10_wp, es, em, it, res)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL require(.FALSE., label//': step failed: '//TRIM(em)); RETURN
+ END IF
+ z = model%q(6*(MID - 1) + 3)
+ ! a positive peak of the midspan deflection (parabolic refinement of the sampled peak)
+ IF (n >= 2 .AND. zprev > zprev2 .AND. zprev >= z .AND. zprev > 0.0_wp .AND. np < SIZE(peaks)) THEN
+ np = np + 1
+ peaks(np) = zprev - 0.125_wp*(z - zprev2)**2/(z - 2.0_wp*zprev + zprev2)
+ tpk(np) = dt*REAL(n - 1, wp)
+ END IF
+ zprev2 = zprev; zprev = z
+ END DO
+ CALL require(np >= 8, label//': enough peaks')
+ IF (np < 8) RETURN
+ delta = LOG(peaks(2)/peaks(np))/REAL(np - 2, wp)
+ zeta_meas = delta/SQRT(4.0_wp*PI*PI + delta*delta)
+ WRITE (*, '(A,A,F7.4,A,ES11.4,A,ES11.4,A,F8.3)') label, ': bending share ', share, ', zeta expected ', &
+ zeta_expect, ', measured ', zeta_meas, ', period ratio ', (tpk(np) - tpk(2))/REAL(np - 2, wp)*om1/(2.0_wp*PI)
+ IF (zeta_ref > 0.0_wp) THEN
+ CALL require(ABS(zeta_meas - zeta_expect) <= 0.01_wp*zeta_expect, label//': decay matches zeta to 1 %')
+ ELSE
+ CALL require(ABS(zeta_meas) <= 1.0e-5_wp, label//': no damping without Bb')
+ END IF
+ END SUBROUTINE decay_case
+
+ SUBROUTINE check_refusals()
+ TYPE(CD_HermiteCableDynType) :: model
+ INTEGER :: es, k
+ CHARACTER(512) :: em
+ CALL setup(model, 1.0e4_wp, 0.02_wp)
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(-1.0_wp, k=1, NE)], es, em)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'finite and non-negative') > 0, 'B4: negative Bb refused')
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(1.0_wp, k=1, NE - 1)], es, em)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'length ne') > 0, 'B4: wrong length refused')
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(0.0_wp, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK .AND. .NOT. model%has_bend_damping, 'B3: all-zero Bb keeps it off')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE check_recovery()
+ TYPE(CD_HermiteCableDynType) :: model
+ REAL(wp) :: curv(NN), bb, v0, lt, x, kdot, f_damped(3), f_plain(3)
+ INTEGER :: es, k
+ CHARACTER(512) :: em
+ v0 = 0.3_wp
+ bb = 2.0e3_wp
+ CALL setup(model, 1.0e4_wp, 0.0_wp)
+ lt = model%q(6*(NN - 1) + 1)
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(bb, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, 'B5: set damping: '//TRIM(em))
+ ! straight line, first-mode velocity z' = v0 sin(pi x/lt) and its slope rate, no acceleration
+ model%v = 0.0_wp
+ DO k = 1, NN
+ x = model%q(6*(k - 1) + 1)
+ model%v(6*(k - 1) + 3) = v0*SIN(PI*x/lt)
+ model%v(6*(k - 1) + 6) = v0*PI/lt*COS(PI*x/lt)
+ END DO
+ model%v([1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3]) = 0.0_wp
+ model%a = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Node_Recovery(model, es, em, curvature=curv)
+ CALL require(es == CD_HCDYN_OK, 'B5: node recovery: '//TRIM(em))
+ kdot = v0*(PI/lt)**2
+ WRITE (*, '(A,ES11.3,A,ES11.3)') 'B5: max recovered curvature ', MAXVAL(ABS(curv)), &
+ ' 1/m; the viscous moment over EI would read ', bb*kdot/EI
+ CALL require(MAXVAL(ABS(curv)) <= 1.0e-6_wp*bb*kdot/EI, 'B5: no viscous curvature in the node recovery')
+ CALL CD_HermiteCable_Dyn_End_Force(model, 1, f_damped, es, em)
+ model%has_bend_damping = .FALSE.
+ CALL CD_HermiteCable_Dyn_End_Force(model, 1, f_plain, es, em)
+ WRITE (*, '(A,ES11.3,A)') 'B5: the bending damping changes the end force by ', NORM2(f_damped - f_plain), ' N'
+ CALL require(NORM2(f_damped - f_plain) > 0.0_wp, 'B5: the end force carries the damping')
+ END SUBROUTINE check_recovery
+
+ SUBROUTINE check_roundoff_floor()
+ TYPE(CD_HermiteCableDynType) :: model
+ REAL(wp), PARAMETER :: EA_SOFT = 4.0e5_wp, TENS = 6.0e3_wp, A0 = 1.0e-3_wp, BB = 1.0e4_wp, DT = 1.0e-4_wp
+ REAL(wp) :: l0(NE), ea_(NE), ei_(NE), rho(NE), w(NE), q(NDOF), eps, lt, x, res, zmax
+ INTEGER :: k, n, es, it
+ CHARACTER(512) :: em
+ eps = TENS/EA_SOFT; lt = (1.0_wp + eps)*LL
+ l0 = LL/REAL(NE, wp); ea_ = EA_SOFT; ei_ = EI; rho = RHOA; w = 0.0_wp
+ DO k = 1, NN
+ x = lt*REAL(k - 1, wp)/REAL(NE, wp)
+ q(6*k - 5:6*k) = [x, 0.0_wp, A0*SIN(PI*x/lt), (1.0_wp + eps), 0.0_wp, (1.0_wp + eps)*A0*PI/lt*COS(PI*x/lt)]
+ END DO
+ CALL CD_HermiteCable_Dyn_Init(model, l0, ea_, ei_, rho, w, q, [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3], &
+ -1.0e4_wp, 0.0_wp, 1.0_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'B6 init: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(BB, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, 'B6 set damping: '//TRIM(em))
+ zmax = 0.0_wp
+ DO n = 1, 200
+ CALL CD_HermiteCable_Dyn_Step(model, DT, 50, 1.0e-8_wp, es, em, it, res)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL require(.FALSE., 'B6 round-off floor: step failed: '//TRIM(em)); RETURN
+ END IF
+ zmax = MAX(zmax, ABS(model%q(6*(MID - 1) + 3)))
+ END DO
+ WRITE (*, '(A,ES11.4,A,ES11.4)') 'B6 round-off floor: 200 steps converged, last residual ', res, &
+ ', largest midspan deflection ', zmax
+ CALL require(zmax <= A0*(1.0_wp + 1.0e-6_wp), 'B6 round-off floor: the damped motion stays bounded')
+ END SUBROUTINE check_roundoff_floor
+
+END PROGRAM test_hermite_bending_damping_dynamic
diff --git a/tests/test_hermite_drag_dynamics.f90 b/tests/test_hermite_drag_dynamics.f90
index 04e7c880..afc039e0 100644
--- a/tests/test_hermite_drag_dynamics.f90
+++ b/tests/test_hermite_drag_dynamics.f90
@@ -14,7 +14,12 @@ PROGRAM test_hermite_drag_dynamics
!! the same run with drag off conserves it: drag is dissipative and correctly wired,
!! C IMPLICIT-TANGENT CORRECTNESS -- a drag-active step under prescribed motion converges in a
!! few Newton iterations; a wrong velocity Jacobian would degrade or break that convergence,
- !! D fail-closed on a bad drag configuration.
+ !! D fail-closed on a bad drag configuration;
+ !! E SURFACE BAND -- an element through the free surface carries at each Gauss point the
+ !! immersed fraction of its section (linear across one diameter): the load is continuous as
+ !! the element moves through the surface in 0.1 mm steps (no jump where a Gauss point
+ !! crosses it), the position Jacobian with points in the band matches central FD, and a
+ !! fully submerged element is unchanged to the bit.
!!
!! Submerged straight beam along x (planar x-z), pinned ends, so the transverse (z) motion drives
!! the normal drag. The beam sits well below the waterline, so the submerged fraction is 1.
@@ -39,6 +44,7 @@ PROGRAM test_hermite_drag_dynamics
nfail = 0
CALL check_drag_element_jacobian()
+ CALL check_drag_surface_band()
CALL check_drag_arc_length_scaling()
CALL check_set_drag_rollback()
CALL check_fully_constrained_validation()
@@ -143,6 +149,54 @@ SUBROUTINE check_drag_element_jacobian()
CALL require(mmag > 1.0e-6_wp, 'material-tangent (m) DOFs carry consistent drag load (interior motion damped)')
END SUBROUTINE check_drag_element_jacobian
+ SUBROUTINE check_drag_surface_band()
+ !! E: the drag of an element through the free surface (gate E in the header).
+ REAL(wp) :: qe(12), ve(12), fluid(3), fd(12), jq(12, 12), jv(12, 12), f0(12), f1(12)
+ REAL(wp) :: qp(12), fp(12), fm(12), dfd(12, 12), dj(12, 12), djd(12, 12), fs(12), fs2(12)
+ REAL(wp) :: hstep, errq, dz, jump, fmax
+ INTEGER :: i, k, es
+ CHARACTER(300) :: em
+ ! a deformed, moving element from z 0 to 0.2 m (D 0.3 m: the band is +-0.15 m about the surface)
+ qe = [0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.10_wp, 1.02_wp, 0.0_wp, 0.20_wp, 1.0_wp, 0.0_wp, -0.10_wp]
+ ve = [0.10_wp, 0.0_wp, 0.30_wp, 0.20_wp, 0.0_wp, 0.10_wp, -0.10_wp, 0.0_wp, 0.40_wp, 0.05_wp, 0.0_wp, 0.20_wp]
+ fluid = [0.20_wp, 0.0_wp, -0.10_wp]
+ ! the surface at z 0.08: every Gauss point (z within about 0.02-0.18) lies in the band
+ CALL CD_HermiteCable_Drag_Element(qe, ve, 1.0_wp, fluid, 0.08_wp, RHOW, DIAM, CDN, CDT, fd, jq, jv, es, em)
+ CALL require(es == CD_HCDYN_OK, 'E: drag element through the surface accepted: '//TRIM(em))
+ DO i = 1, 12
+ hstep = 1.0e-7_wp*MAX(1.0_wp, ABS(qe(i)))
+ qp = qe; qp(i) = qe(i) + hstep
+ CALL CD_HermiteCable_Drag_Element(qp, ve, 1.0_wp, fluid, 0.08_wp, RHOW, DIAM, CDN, CDT, fp, dj, djd, es, em)
+ qp(i) = qe(i) - hstep
+ CALL CD_HermiteCable_Drag_Element(qp, ve, 1.0_wp, fluid, 0.08_wp, RHOW, DIAM, CDN, CDT, fm, dj, djd, es, em)
+ dfd(:, i) = (fp - fm)/(2.0_wp*hstep)
+ END DO
+ errq = nan_max_abs(jq - dfd)/MAX(1.0_wp, nan_max_abs(dfd))
+ WRITE (*, '(A,ES10.3)') ' [drag, surface band] position Jacobian vs central FD: err = ', errq
+ CALL require(errq < 1.0e-5_wp, 'E: drag position Jacobian in the surface band matches central FD')
+ ! the element moved down through the surface: the largest change between 0.1 mm steps against the
+ ! largest load (a wet/dry switch jumps by a Gauss weight, 5/18 or 8/18 of the element's load)
+ dz = 1.0e-4_wp
+ jump = 0.0_wp
+ fmax = 0.0_wp
+ CALL CD_HermiteCable_Drag_Element(qe, ve, 1.0_wp, fluid, -0.30_wp, RHOW, DIAM, CDN, CDT, f0, ErrStat=es, &
+ ErrMsg=em)
+ DO k = 1, 7000
+ CALL CD_HermiteCable_Drag_Element(qe, ve, 1.0_wp, fluid, -0.30_wp + k*dz, RHOW, DIAM, CDN, CDT, f1, &
+ ErrStat=es, ErrMsg=em)
+ jump = MAX(jump, nan_max_abs(f1 - f0))
+ fmax = MAX(fmax, nan_max_abs(f1))
+ f0 = f1
+ END DO
+ WRITE (*, '(A,ES10.3)') ' [drag, surface band] largest change per 0.1 mm / largest load = ', jump/fmax
+ CALL require(fmax > 0.0_wp .AND. jump < 2.0e-3_wp*fmax, 'E: the drag is continuous through the free surface')
+ ! fully submerged (every point more than D/2 below the surface at 1 m or at 100 m): the immersed
+ ! fraction is exactly 1, the load unchanged to the bit
+ CALL CD_HermiteCable_Drag_Element(qe, ve, 1.0_wp, fluid, 1.0_wp, RHOW, DIAM, CDN, CDT, fs, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_Drag_Element(qe, ve, 1.0_wp, fluid, 100.0_wp, RHOW, DIAM, CDN, CDT, fs2, ErrStat=es, ErrMsg=em)
+ CALL require(ALL(fs == fs2), 'E: a fully submerged element is unchanged to the bit')
+ END SUBROUTINE check_drag_surface_band
+
SUBROUTINE check_drag_arc_length_scaling()
!! Drag integrates over the DEFORMED cable length, not the reference length: a straight element
!! uniformly stretched 2x (same l0) under the same transverse velocity gets ~2x the net drag.
diff --git a/tests/test_hermite_load_power.f90 b/tests/test_hermite_load_power.f90
new file mode 100644
index 00000000..d2adb346
--- /dev/null
+++ b/tests/test_hermite_load_power.f90
@@ -0,0 +1,190 @@
+! File: tests/test_hermite_load_power.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_load_power
+ !! The load powers of a finite-EI cable (CD_HermiteCable_Dyn_Load_Power) close its energy
+ !! balance: on a weightless, pinned-pinned, tensioned cable with no added mass the kinetic plus
+ !! elastic energy changes by the work of the VIV loads, the drag and the structural damping,
+ !! E(t) - E(0) = int (P_viv + P_drag + P_damp) dt,
+ !! integrated by the trapezoidal rule over generalised-alpha steps with rho_inf = 1 (no numerical
+ !! damping) of 1/200 of the period of the motion the case resolves, so the two sides agree to
+ !! the steps' second-order error.
+ !! L1 the free decay of the first bending mode with the bending dashpot Bb;
+ !! L2 the free decay of the first axial mode with the axial dashpot BA (its own time step);
+ !! L3 the bending decay in still water with Morison drag and no dashpots;
+ !! L4 a cable starting straight in a 0.5 m/s current with the cross-flow, in-line and
+ !! higher-harmonic (Chh 1) VIV loads,
+ !! the drag and the bending dashpot;
+ !! L6 the bending decay with the Rayleigh pair, the mass-proportional transverse damping alpha
+ !! beside the bending dashpot (its work is in the damping power);
+ !! each within 0.5 % of the largest work; the damping power is never positive at any node, and
+ !! the VIV and drag powers are zero without those loads. L5 power arrays of the wrong size are
+ !! refused.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Set_Bending_Damping, &
+ CD_HermiteCable_Dyn_Set_Axial_Damping, CD_HermiteCable_Dyn_Set_Drag, &
+ CD_HermiteCable_Dyn_Set_VIV, CD_HermiteCable_Dyn_Energy, &
+ CD_HermiteCable_Dyn_Load_Power, CD_HermiteCable_Dyn_Set_Mass_Damping, &
+ CD_HCDYN_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
+ REAL(wp), PARAMETER :: LL = 20.0_wp, EA = 1.0e8_wp, EI = 1.0e5_wp, RHOA = 10.0_wp, TENS = 1.0e4_wp
+ REAL(wp), PARAMETER :: DIAM = 0.1_wp, RHOW = 1025.0_wp
+ INTEGER, PARAMETER :: NE = 40, NN = NE + 1, NDOF = 6*NN
+ INTEGER, PARAMETER :: BENDING = 1, AXIAL = 2, DRAG = 3, VIV = 4, RAYLEIGH = 5
+ INTEGER :: nfail = 0
+
+ CALL balance_case('L1 bending dashpot decay', BENDING)
+ CALL balance_case('L2 axial dashpot decay', AXIAL)
+ CALL balance_case('L3 still-water drag decay', DRAG)
+ CALL balance_case('L4 VIV in a current', VIV)
+ CALL balance_case('L6 Rayleigh decay', RAYLEIGH)
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: Hermite load power energy balance'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE setup(model, a0, u0, ok)
+ !! The tensioned cable along x, pinned at both ends, at rest in its first bending mode of
+ !! amplitude a0 (z) and its first axial mode of amplitude u0 (x), rho_inf = 1.
+ TYPE(CD_HermiteCableDynType), INTENT(OUT) :: model
+ REAL(wp), INTENT(IN) :: a0, u0
+ LOGICAL, INTENT(OUT) :: ok
+ REAL(wp) :: l0(NE), ea_(NE), ei_(NE), rho(NE), w(NE), q(NDOF), eps, lt, x, s, c
+ INTEGER :: k, es
+ CHARACTER(512) :: em
+ eps = TENS/EA; lt = (1.0_wp + eps)*LL
+ l0 = LL/REAL(NE, wp); ea_ = EA; ei_ = EI; rho = RHOA; w = 0.0_wp
+ DO k = 1, NN
+ x = lt*REAL(k - 1, wp)/REAL(NE, wp)
+ s = SIN(PI*x/lt)
+ c = COS(PI*x/lt)
+ q(6*k - 5:6*k) = [x + u0*s, 0.0_wp, a0*s, (1.0_wp + eps) + (1.0_wp + eps)*u0*PI/lt*c, 0.0_wp, &
+ (1.0_wp + eps)*a0*PI/lt*c]
+ END DO
+ CALL CD_HermiteCable_Dyn_Init(model, l0, ea_, ei_, rho, w, q, [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3], &
+ -1.0e4_wp, 0.0_wp, 1.0_wp, es, em)
+ ok = es == CD_HCDYN_OK
+ CALL require(ok, 'init: '//TRIM(em))
+ END SUBROUTINE setup
+
+ SUBROUTINE balance_case(label, what)
+ CHARACTER(*), INTENT(IN) :: label
+ INTEGER, INTENT(IN) :: what
+ TYPE(CD_HermiteCableDynType) :: model
+ REAL(wp) :: kk, period, dt, ek, es0, e0, e1, p_prev(3), p_now(3), work(3), res, scale, pm_max
+ REAL(wp) :: cl(NE), cf(NE), df(NE), clx(NE), alx(NE), chh(NE)
+ INTEGER :: n, k, es, it
+ CHARACTER(512) :: em
+ LOGICAL :: zero_viv, zero_drag, ok
+ kk = PI/LL
+ IF (what == AXIAL) THEN
+ period = 2.0_wp*LL/SQRT(EA/RHOA)
+ CALL setup(model, 0.0_wp, 1.0e-4_wp, ok)
+ ELSE
+ period = 2.0_wp*PI/SQRT((EI*kk**4 + TENS*kk**2)/RHOA)
+ CALL setup(model, MERGE(0.0_wp, 0.05_wp, what == VIV), 0.0_wp, ok)
+ END IF
+ IF (.NOT. ok) RETURN
+ dt = period/200.0_wp
+ IF (what == AXIAL) THEN
+ CALL CD_HermiteCable_Dyn_Set_Axial_Damping(model, [(2.0e4_wp, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, label//': axial damping: '//TRIM(em))
+ END IF
+ IF (what == RAYLEIGH) THEN
+ CALL CD_HermiteCable_Dyn_Set_Mass_Damping(model, [(0.3_wp, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, label//': mass damping: '//TRIM(em))
+ END IF
+ IF (what == BENDING .OR. what == VIV .OR. what == RAYLEIGH) THEN
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(2.0e2_wp, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, label//': bending damping: '//TRIM(em))
+ END IF
+ IF (what == DRAG .OR. what == VIV) THEN
+ CALL CD_HermiteCable_Dyn_Set_Drag(model, RHOW, [(DIAM, k=1, NE)], [(1.2_wp, k=1, NE)], [(0.0_wp, k=1, NE)], &
+ 1.0e3_wp, [0.0_wp, MERGE(0.5_wp, 0.0_wp, what == VIV), 0.0_wp], es, em)
+ CALL require(es == CD_HCDYN_OK, label//': drag: '//TRIM(em))
+ END IF
+ IF (what == VIV) THEN
+ cl = 0.8_wp; cf = 0.18_wp; df = 0.08_wp; clx = 0.85_wp; alx = 0.15_wp; chh = 1.0_wp
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=alx, chh=chh)
+ CALL require(es == CD_HCDYN_OK, label//': VIV: '//TRIM(em))
+ END IF
+ IF (es /= CD_HCDYN_OK) RETURN
+ CALL CD_HermiteCable_Dyn_Energy(model, ek, es0, es, em)
+ e0 = ek + es0
+ work = 0.0_wp
+ pm_max = -HUGE(1.0_wp)
+ zero_viv = .TRUE.
+ zero_drag = .TRUE.
+ CALL powers(model, label, p_prev, pm_max, zero_viv, zero_drag)
+ DO n = 1, 2400
+ CALL CD_HermiteCable_Dyn_Step(model, dt, 50, 1.0e-10_wp, es, em, it, res)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL require(.FALSE., label//': step failed: '//TRIM(em)); RETURN
+ END IF
+ CALL powers(model, label, p_now, pm_max, zero_viv, zero_drag)
+ work = work + 0.5_wp*dt*(p_prev + p_now)
+ p_prev = p_now
+ END DO
+ CALL CD_HermiteCable_Dyn_Energy(model, ek, es0, es, em)
+ e1 = ek + es0
+ scale = MAXVAL(ABS(work))
+ WRITE (*, '(2A,ES12.4,A,3ES12.4,A,ES10.2)') label, ': dE ', e1 - e0, ', work VIV/drag/damp ', work, &
+ ', mismatch/largest ', ABS(e1 - e0 - SUM(work))/MAX(scale, TINY(1.0_wp))
+ CALL require(scale > 0.0_wp, label//': the loads did work')
+ IF (.NOT. (scale > 0.0_wp)) RETURN
+ CALL require(ABS(e1 - e0 - SUM(work)) <= 5.0e-3_wp*scale, label//': the load work closes the energy balance')
+ CALL require(pm_max <= 0.0_wp, label//': the damping power is never positive at a node')
+ CALL require(zero_viv .EQV. what /= VIV, label//': VIV power only with VIV')
+ CALL require(zero_drag .EQV. (what /= DRAG .AND. what /= VIV), label//': drag power only with drag')
+ IF (what == BENDING .OR. what == AXIAL .OR. what == RAYLEIGH) &
+ CALL require(work(3) < 0.0_wp, label//': the dashpot dissipates')
+ IF (what == DRAG) CALL require(work(2) < 0.0_wp, label//': still-water drag dissipates')
+ IF (what == VIV) CALL require(work(1) > 0.0_wp, label//': the VIV loads put energy in')
+ END SUBROUTINE balance_case
+
+ SUBROUTINE powers(model, label, p, pm_max, zero_viv, zero_drag)
+ !! The line totals of the three load powers, with the running checks: the largest node
+ !! damping power, and whether the VIV and drag powers stayed zero at every node.
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: model
+ CHARACTER(*), INTENT(IN) :: label
+ REAL(wp), INTENT(OUT) :: p(3)
+ REAL(wp), INTENT(INOUT) :: pm_max
+ LOGICAL, INTENT(INOUT) :: zero_viv, zero_drag
+ REAL(wp) :: pv(NN), pd(NN), pm(NN)
+ INTEGER :: esp
+ CHARACTER(512) :: emp
+ CALL CD_HermiteCable_Dyn_Load_Power(model, pv, pd, pm, esp, emp)
+ CALL require(esp == CD_HCDYN_OK, label//': load power: '//TRIM(emp))
+ p = [SUM(pv), SUM(pd), SUM(pm)]
+ pm_max = MAX(pm_max, MAXVAL(pm))
+ zero_viv = zero_viv .AND. ALL(pv == 0.0_wp)
+ zero_drag = zero_drag .AND. ALL(pd == 0.0_wp)
+ END SUBROUTINE powers
+
+ SUBROUTINE check_refusals()
+ TYPE(CD_HermiteCableDynType) :: model
+ REAL(wp) :: pv(NN), pd(NN), pm(NN - 1)
+ INTEGER :: es
+ LOGICAL :: ok
+ CHARACTER(512) :: em
+ CALL setup(model, 0.0_wp, 0.0_wp, ok)
+ IF (.NOT. ok) RETURN
+ CALL CD_HermiteCable_Dyn_Load_Power(model, pv, pd, pm, es, em)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'one entry per node') > 0, 'L5: a wrong-size power array is refused')
+ END SUBROUTINE check_refusals
+
+END PROGRAM test_hermite_load_power
diff --git a/tests/test_hermite_mass_damping.f90 b/tests/test_hermite_mass_damping.f90
new file mode 100644
index 00000000..1e3902ca
--- /dev/null
+++ b/tests/test_hermite_mass_damping.f90
@@ -0,0 +1,203 @@
+! File: tests/test_hermite_mass_damping.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_mass_damping
+ !! Kernel gates of the mass-proportional (Rayleigh alpha) transverse damping
+ !! (CD_HermiteCable_Mass_Damping) and of the two-frequency Rayleigh pair:
+ !! M1 Kv equals the central difference of fdamp in the rates, Kq that in the positions, on a
+ !! stretched 3D curved element and on a straight one; Kv is symmetric;
+ !! M2 fdamp is d psi / d v of the dissipation function 1/2 cm |v|^2 - 1/2 cm (t . v)^2 built
+ !! independently from the public shape functions, v . fdamp = 2 psi >= 0, and fdamp is
+ !! linear in the rates and zero for cm = 0;
+ !! M3 on a straight element along x the force is cm M v in y and z with M the consistent mass
+ !! matrix (CD_HermiteCable_Mass, per unit mass), zero in x, and an axial sliding is not
+ !! damped; a rigid transverse translation is (the absolute-velocity convention);
+ !! M4 bad inputs are refused by name;
+ !! M5 CD_HermiteCable_Rayleigh_Pair: alpha/(2 omega) + (Bb/EI) omega/2 equals zeta at f1 and
+ !! f2, and its minimum 2 zeta sqrt(f1 f2)/(f1 + f2) lies at sqrt(f1 f2).
+ USE CableDyn_Precision, ONLY: wp
+ USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_VALUE, IEEE_QUIET_NAN
+ USE CableDyn_HermiteCable, ONLY: CD_HermiteCable_Mass_Damping, CD_HermiteCable_Rayleigh_Pair, CD_HCABLE_OK, &
+ CD_HermiteCable_Mass, CD_HermiteCable_Shapes, CD_HermiteCable_Gauss_Rule
+ IMPLICIT NONE
+ INTEGER :: nfail = 0
+ REAL(wp), PARAMETER :: L = 2.5_wp, CM = 13.0_wp, PI = 3.14159265358979323846_wp
+
+ CALL check_jacobians()
+ CALL check_dissipation()
+ CALL check_straight()
+ CALL check_refusals()
+ CALL check_pair()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: Hermite mass-proportional damping kernel'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE curved_state(q, v)
+ !! A stretched, out-of-plane curved element with arbitrary nodal rates.
+ REAL(wp), INTENT(OUT) :: q(12), v(12)
+ q = [0.0_wp, 0.0_wp, 0.0_wp, 1.02_wp, 0.3_wp, -0.2_wp, &
+ 2.4_wp, 0.5_wp, -0.3_wp, 0.9_wp, -0.25_wp, 0.35_wp]
+ v = [0.11_wp, -0.23_wp, 0.31_wp, 0.4_wp, -0.15_wp, 0.27_wp, &
+ -0.19_wp, 0.08_wp, 0.42_wp, -0.33_wp, 0.21_wp, 0.12_wp]
+ END SUBROUTINE curved_state
+
+ SUBROUTINE fd_check(q, v, label)
+ REAL(wp), INTENT(IN) :: q(12), v(12)
+ CHARACTER(*), INTENT(IN) :: label
+ REAL(wp) :: f(12), Kq(12, 12), Kv(12, 12), fp(12), fm(12), Kq_fd(12, 12), Kv_fd(12, 12), dq(12), h
+ REAL(wp) :: eq, ev
+ INTEGER :: es, j
+ CHARACTER(256) :: em
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, CM, f, Kq, Kv, es, em)
+ CALL require(es == CD_HCABLE_OK, 'M1 '//label//': evaluation: '//TRIM(em))
+ DO j = 1, 12
+ h = 1.0e-6_wp*MAX(1.0_wp, ABS(q(j)))
+ dq = 0.0_wp; dq(j) = h
+ CALL CD_HermiteCable_Mass_Damping(q + dq, v, L, CM, fp, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_Mass_Damping(q - dq, v, L, CM, fm, ErrStat=es, ErrMsg=em)
+ Kq_fd(:, j) = (fp - fm)/(2.0_wp*h)
+ h = 1.0e-6_wp*MAX(1.0_wp, ABS(v(j)))
+ dq = 0.0_wp; dq(j) = h
+ CALL CD_HermiteCable_Mass_Damping(q, v + dq, L, CM, fp, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_Mass_Damping(q, v - dq, L, CM, fm, ErrStat=es, ErrMsg=em)
+ Kv_fd(:, j) = (fp - fm)/(2.0_wp*h)
+ END DO
+ eq = MAXVAL(ABS(Kq - Kq_fd))/MAX(1.0e-12_wp, MAXVAL(ABS(Kq_fd)))
+ ev = MAXVAL(ABS(Kv - Kv_fd))/MAX(1.0e-12_wp, MAXVAL(ABS(Kv_fd)))
+ WRITE (*, '(A,2ES11.3)') 'M1 '//label//': relative |Kq - FD|, |Kv - FD| ', eq, ev
+ CALL require(eq < 1.0e-7_wp, 'M1 '//label//': Kq matches the central difference')
+ CALL require(ev < 1.0e-7_wp, 'M1 '//label//': Kv matches the central difference')
+ CALL require(MAXVAL(ABS(Kv - TRANSPOSE(Kv))) <= 1.0e-13_wp*MAXVAL(ABS(Kv)), 'M1 '//label//': Kv symmetric')
+ END SUBROUTINE fd_check
+
+ SUBROUTINE check_jacobians()
+ REAL(wp) :: q(12), v(12)
+ CALL curved_state(q, v)
+ CALL fd_check(q, v, 'curved 3D')
+ q = [0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, L, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp]
+ CALL fd_check(q, v, 'straight')
+ END SUBROUTINE check_jacobians
+
+ REAL(wp) FUNCTION psi(q, v)
+ !! 1/2 cm integral (|v|^2 - (t . v)^2) ds on the four-point rule, from the public shapes
+ REAL(wp), INTENT(IN) :: q(12), v(12)
+ REAL(wp) :: gp(6), gw(6), H(4), dH(4), rp(3), vv(3), t(3)
+ INTEGER :: g, c
+ CALL CD_HermiteCable_Gauss_Rule(4, gp, gw)
+ psi = 0.0_wp
+ DO g = 1, 4
+ CALL CD_HermiteCable_Shapes(gp(g), L, H, dH)
+ DO c = 1, 3
+ rp(c) = dH(1)*q(c) + dH(2)*q(3 + c) + dH(3)*q(6 + c) + dH(4)*q(9 + c)
+ vv(c) = H(1)*v(c) + H(2)*v(3 + c) + H(3)*v(6 + c) + H(4)*v(9 + c)
+ END DO
+ t = rp/NORM2(rp)
+ psi = psi + 0.5_wp*CM*gw(g)*L*(DOT_PRODUCT(vv, vv) - DOT_PRODUCT(t, vv)**2)
+ END DO
+ END FUNCTION psi
+
+ SUBROUTINE check_dissipation()
+ REAL(wp) :: q(12), v(12), f(12), f2(12), fd(12), dv(12), h, p0
+ INTEGER :: es, j
+ CHARACTER(256) :: em
+ CALL curved_state(q, v)
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, CM, f, ErrStat=es, ErrMsg=em)
+ CALL require(es == CD_HCABLE_OK, 'M2: evaluation: '//TRIM(em))
+ DO j = 1, 12
+ h = 1.0e-5_wp
+ dv = 0.0_wp; dv(j) = h
+ fd(j) = (psi(q, v + dv) - psi(q, v - dv))/(2.0_wp*h)
+ END DO
+ p0 = psi(q, v)
+ WRITE (*, '(A,ES11.3,A,ES11.3)') 'M2: relative |f - d psi/dv| ', MAXVAL(ABS(f - fd))/MAXVAL(ABS(fd)), &
+ ', |v . f - 2 psi|/psi ', ABS(DOT_PRODUCT(v, f) - 2.0_wp*p0)/p0
+ CALL require(MAXVAL(ABS(f - fd)) <= 1.0e-8_wp*MAXVAL(ABS(fd)), 'M2: the force is d psi / d v')
+ CALL require(ABS(DOT_PRODUCT(v, f) - 2.0_wp*p0) <= 1.0e-12_wp*p0 .AND. p0 > 0.0_wp, &
+ 'M2: v . f = 2 psi > 0 (dissipative)')
+ CALL CD_HermiteCable_Mass_Damping(q, 2.0_wp*v, L, CM, f2, ErrStat=es, ErrMsg=em)
+ CALL require(MAXVAL(ABS(f2 - 2.0_wp*f)) <= 1.0e-14_wp*MAXVAL(ABS(f)), 'M2: linear in the rates')
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, 0.0_wp, f2, ErrStat=es, ErrMsg=em)
+ CALL require(es == CD_HCABLE_OK .AND. ALL(f2 == 0.0_wp), 'M2: zero for cm = 0')
+ END SUBROUTINE check_dissipation
+
+ SUBROUTINE check_straight()
+ REAL(wp) :: q(12), v(12), f(12), Mm(12, 12), fm(12)
+ INTEGER :: es, k
+ CHARACTER(256) :: em
+ q = [0.0_wp, 0.0_wp, 0.0_wp, 1.01_wp, 0.0_wp, 0.0_wp, 1.01_wp*L, 0.0_wp, 0.0_wp, 1.01_wp, 0.0_wp, 0.0_wp]
+ v = [0.3_wp, -0.2_wp, 0.5_wp, 0.1_wp, 0.4_wp, -0.3_wp, -0.2_wp, 0.6_wp, 0.1_wp, 0.2_wp, -0.1_wp, 0.25_wp]
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, CM, f, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_Mass(1.0_wp, L, Mm, es, em)
+ fm = CM*MATMUL(Mm, v)
+ DO k = 0, 3
+ fm(3*k + 1) = 0.0_wp
+ END DO
+ WRITE (*, '(A,ES11.3)') 'M3: straight element, relative |f - cm M v_transverse| ', &
+ MAXVAL(ABS(f - fm))/MAXVAL(ABS(fm))
+ CALL require(MAXVAL(ABS(f - fm)) <= 1.0e-13_wp*MAXVAL(ABS(fm)), 'M3: cm M v in y and z, zero in x')
+ ! axial sliding: every node moves along x, the handles still
+ v = [0.7_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.7_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp]
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, CM, f, ErrStat=es, ErrMsg=em)
+ CALL require(ALL(f == 0.0_wp), 'M3: an axial sliding is not damped')
+ ! rigid transverse translation: damped as cm M v (the absolute-velocity convention)
+ v = [0.0_wp, 0.4_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.4_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp]
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, CM, f, ErrStat=es, ErrMsg=em)
+ WRITE (*, '(A,ES11.3,A,ES11.3)') 'M3: rigid transverse translation, total force ', f(2) + f(8), &
+ ' N against cm L v ', CM*L*0.4_wp
+ CALL require(ABS(f(2) + f(8) - CM*L*0.4_wp) <= 1.0e-13_wp*CM*L*0.4_wp, &
+ 'M3: a rigid transverse translation is damped at cm L v')
+ END SUBROUTINE check_straight
+
+ SUBROUTINE check_refusals()
+ REAL(wp) :: q(12), v(12), f(12)
+ INTEGER :: es
+ CHARACTER(256) :: em
+ CALL curved_state(q, v)
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, -1.0_wp, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'non-negative') > 0, 'M4: negative cm refused')
+ CALL CD_HermiteCable_Mass_Damping(q, v, 0.0_wp, CM, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'length must be positive') > 0, 'M4: zero length refused')
+ v(3) = IEEE_VALUE(1.0_wp, IEEE_QUIET_NAN)
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, CM, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'finite') > 0 .AND. ALL(f == 0.0_wp), 'M4: NaN rate refused')
+ q = 0.0_wp
+ v = 0.0_wp
+ CALL CD_HermiteCable_Mass_Damping(q, v, L, CM, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HCABLE_OK .AND. INDEX(em, 'degenerate') > 0, 'M4: degenerate centreline refused')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE check_pair()
+ REAL(wp), PARAMETER :: ZETA = 0.015_wp, F1 = 0.4_wp, F2 = 3.0_wp, EI = 2.0e4_wp
+ REAL(wp) :: bb, alpha, z1, z2, zm, fmid
+ CALL CD_HermiteCable_Rayleigh_Pair(ZETA, F1, F2, EI, bb, alpha)
+ z1 = rayleigh_zeta(alpha, bb/EI, F1)
+ z2 = rayleigh_zeta(alpha, bb/EI, F2)
+ fmid = SQRT(F1*F2)
+ zm = rayleigh_zeta(alpha, bb/EI, fmid)
+ WRITE (*, '(A,2ES11.3,A,2ES12.4,A,ES12.4)') 'M5: Bb, alpha ', bb, alpha, '; zeta at f1, f2 ', z1, z2, &
+ '; at sqrt(f1 f2) ', zm
+ CALL require(ABS(z1 - ZETA) <= 1.0e-14_wp .AND. ABS(z2 - ZETA) <= 1.0e-14_wp, 'M5: zeta at f1 and f2')
+ CALL require(ABS(zm - 2.0_wp*ZETA*fmid/(F1 + F2)) <= 1.0e-14_wp, 'M5: the minimum between them')
+ CALL require(rayleigh_zeta(alpha, bb/EI, 0.99_wp*fmid) > zm .AND. rayleigh_zeta(alpha, bb/EI, 1.01_wp*fmid) > zm, &
+ 'M5: sqrt(f1 f2) is the minimum')
+ END SUBROUTINE check_pair
+
+ PURE REAL(wp) FUNCTION rayleigh_zeta(alpha, beta, f)
+ !! alpha/(2 omega) + beta omega/2 at omega = 2 pi f
+ REAL(wp), INTENT(IN) :: alpha, beta, f
+ rayleigh_zeta = alpha/(4.0_wp*PI*f) + beta*PI*f
+ END FUNCTION rayleigh_zeta
+
+END PROGRAM test_hermite_mass_damping
diff --git a/tests/test_hermite_mass_damping_dynamic.f90 b/tests/test_hermite_mass_damping_dynamic.f90
new file mode 100644
index 00000000..955d09c5
--- /dev/null
+++ b/tests/test_hermite_mass_damping_dynamic.f90
@@ -0,0 +1,170 @@
+! File: tests/test_hermite_mass_damping_dynamic.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_mass_damping_dynamic
+ !! Free decays of modes 1, 2 and 3 of a weightless, pinned-pinned finite-EI cable with Rayleigh
+ !! damping: the mass-proportional transverse damping alpha (CD_HermiteCable_Dyn_Set_Mass_Damping)
+ !! and the bending damping Bb (CD_HermiteCable_Dyn_Set_Bending_Damping), generalised-alpha with
+ !! rho_inf = 1 (no numerical damping), 200 steps a period over 12 periods. For the mode
+ !! sin(k x), k = n pi/L, of frequency omega^2 = (EI k^4 + T k^2)/m the damping ratio is
+ !! zeta = alpha/(2 omega) + omega Bb/(2 EI) * EI k^2/(EI k^2 + T),
+ !! alpha acting on the whole modal mass (the cable's own) and Bb on the bending share.
+ !! R1 alpha alone on a tensioned cable: modes 1 and 3 decay at alpha/(2 omega) to 0.25 %;
+ !! R2 Bb alone on the same cable: modes 1 and 3 at the bending-share ratio to 0.25 %;
+ !! R3 both: the sum, to 0.25 %;
+ !! R4 the two-frequency pair (CD_HermiteCable_Rayleigh_Pair, the EI|-zeta|f1|f2 deck form) on
+ !! a cable without tension, f1 and f2 the frequencies of modes 1 and 3: both decay at the
+ !! target zeta to 0.25 %, and mode 2, between them, at the lower Rayleigh ratio to 0.25 %;
+ !! R5 a negative coefficient or a wrong length is refused, and an all-zero array keeps the
+ !! configuration off.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_HermiteCable, ONLY: CD_HermiteCable_Rayleigh_Pair
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Set_Bending_Damping, &
+ CD_HermiteCable_Dyn_Set_Mass_Damping, CD_HCDYN_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
+ REAL(wp), PARAMETER :: LL = 20.0_wp, EA = 1.0e8_wp, EI = 1.0e5_wp, RHOA = 10.0_wp, TENS = 1.0e4_wp
+ REAL(wp), PARAMETER :: ZT = 0.02_wp
+ INTEGER, PARAMETER :: NE = 40, NN = NE + 1, NDOF = 6*NN, MID = NE/2 + 1, QUARTER = NE/4 + 1
+ INTEGER :: nfail = 0
+ REAL(wp) :: alpha, bb, f1, f3
+
+ ! R1-R3: the tensioned cable; alpha and Bb each give zeta ZT to mode 1 in their own share
+ alpha = 2.0_wp*ZT*omega(1, TENS)
+ bb = 2.0_wp*ZT*EI/omega(1, TENS)
+ CALL decay_case('R1 alpha alone', TENS, 1, alpha, 0.0_wp)
+ CALL decay_case('R1 alpha alone', TENS, 3, alpha, 0.0_wp)
+ CALL decay_case('R2 Bb alone', TENS, 1, 0.0_wp, bb)
+ CALL decay_case('R2 Bb alone', TENS, 3, 0.0_wp, bb)
+ CALL decay_case('R3 alpha and Bb', TENS, 1, alpha, bb)
+ CALL decay_case('R3 alpha and Bb', TENS, 3, alpha, bb)
+ ! R4: the pair holding ZT at the frequencies of modes 1 and 3 of the cable without tension
+ f1 = omega(1, 0.0_wp)/(2.0_wp*PI)
+ f3 = omega(3, 0.0_wp)/(2.0_wp*PI)
+ CALL CD_HermiteCable_Rayleigh_Pair(ZT, f1, f3, EI, bb, alpha)
+ CALL decay_case('R4 zeta at f1 and f3', 0.0_wp, 1, alpha, bb, ZT)
+ CALL decay_case('R4 zeta at f1 and f3', 0.0_wp, 3, alpha, bb, ZT)
+ CALL decay_case('R4 zeta at f1 and f3', 0.0_wp, 2, alpha, bb)
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: Hermite Rayleigh damping dynamic decay'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ PURE REAL(wp) FUNCTION omega(n, tens)
+ INTEGER, INTENT(IN) :: n
+ REAL(wp), INTENT(IN) :: tens
+ REAL(wp) :: k
+ k = REAL(n, wp)*PI/LL
+ omega = SQRT((EI*k**4 + tens*k**2)/RHOA)
+ END FUNCTION omega
+
+ SUBROUTINE setup(model, tens, n, a0)
+ !! The cable along x, pinned at both ends, at rest in its mode n of amplitude a0 (z).
+ TYPE(CD_HermiteCableDynType), INTENT(OUT) :: model
+ REAL(wp), INTENT(IN) :: tens, a0
+ INTEGER, INTENT(IN) :: n
+ REAL(wp) :: l0(NE), ea_(NE), ei_(NE), rho(NE), w(NE), q(NDOF), eps, lt, x, kn
+ INTEGER :: k, es
+ CHARACTER(512) :: em
+ eps = tens/EA; lt = (1.0_wp + eps)*LL
+ kn = REAL(n, wp)*PI/lt
+ l0 = LL/REAL(NE, wp); ea_ = EA; ei_ = EI; rho = RHOA; w = 0.0_wp
+ DO k = 1, NN
+ x = lt*REAL(k - 1, wp)/REAL(NE, wp)
+ q(6*k - 5:6*k) = [x, 0.0_wp, a0*SIN(kn*x), (1.0_wp + eps), 0.0_wp, (1.0_wp + eps)*a0*kn*COS(kn*x)]
+ END DO
+ CALL CD_HermiteCable_Dyn_Init(model, l0, ea_, ei_, rho, w, q, [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3], &
+ -1.0e4_wp, 0.0_wp, 1.0_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'init: '//TRIM(em))
+ END SUBROUTINE setup
+
+ SUBROUTINE decay_case(label, tens, n, alpha_c, bb_c, zeta_target)
+ CHARACTER(*), INTENT(IN) :: label
+ REAL(wp), INTENT(IN) :: tens, alpha_c, bb_c
+ INTEGER, INTENT(IN) :: n
+ REAL(wp), INTENT(IN), OPTIONAL :: zeta_target
+ TYPE(CD_HermiteCableDynType) :: model
+ REAL(wp) :: kk, om, share, zeta_expect, dt, z, zprev, zprev2, peaks(200), tpk(200), delta, zeta_meas, res, sgn
+ INTEGER :: m, k, np, es, it, node
+ CHARACTER(512) :: em
+ CHARACTER(16) :: tag
+ kk = REAL(n, wp)*PI/LL
+ om = omega(n, tens)
+ share = EI*kk**2/(EI*kk**2 + tens)
+ zeta_expect = alpha_c/(2.0_wp*om) + om*bb_c/(2.0_wp*EI)*share
+ WRITE (tag, '(A,I0)') ', mode ', n
+ CALL setup(model, tens, n, 1.0e-3_wp)
+ IF (alpha_c > 0.0_wp) THEN
+ CALL CD_HermiteCable_Dyn_Set_Mass_Damping(model, [(alpha_c, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, label//TRIM(tag)//': set alpha: '//TRIM(em))
+ END IF
+ IF (bb_c > 0.0_wp) THEN
+ CALL CD_HermiteCable_Dyn_Set_Bending_Damping(model, [(bb_c, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK, label//TRIM(tag)//': set Bb: '//TRIM(em))
+ END IF
+ ! an antinode of the mode: midspan for modes 1 and 3 (sign -1 for mode 3), the quarter for mode 2
+ node = MID
+ IF (n == 2) node = QUARTER
+ sgn = SIGN(1.0_wp, SIN(kk*model%q(6*(node - 1) + 1)))
+ dt = (2.0_wp*PI/om)/200.0_wp
+ np = 0; zprev = sgn*model%q(6*(node - 1) + 3); zprev2 = zprev
+ DO m = 1, 200*12
+ CALL CD_HermiteCable_Dyn_Step(model, dt, 50, 1.0e-10_wp, es, em, it, res)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL require(.FALSE., label//TRIM(tag)//': step failed: '//TRIM(em)); RETURN
+ END IF
+ z = sgn*model%q(6*(node - 1) + 3)
+ ! a positive peak of the antinode deflection (parabolic refinement of the sampled peak)
+ IF (m >= 2 .AND. zprev > zprev2 .AND. zprev >= z .AND. zprev > 0.0_wp .AND. np < SIZE(peaks)) THEN
+ np = np + 1
+ peaks(np) = zprev - 0.125_wp*(z - zprev2)**2/(z - 2.0_wp*zprev + zprev2)
+ tpk(np) = dt*REAL(m - 1, wp)
+ END IF
+ zprev2 = zprev; zprev = z
+ END DO
+ CALL require(np >= 8, label//TRIM(tag)//': enough peaks')
+ IF (np < 8) RETURN
+ delta = LOG(peaks(2)/peaks(np))/REAL(np - 2, wp)
+ zeta_meas = delta/SQRT(4.0_wp*PI*PI + delta*delta)
+ WRITE (*, '(A,A,F7.4,A,ES11.4,A,ES11.4,A,ES10.2,A,F8.5)') label//TRIM(tag), ': bending share ', share, &
+ ', zeta expected ', zeta_expect, ', measured ', zeta_meas, ', rel. error ', &
+ (zeta_meas - zeta_expect)/zeta_expect, ', period ratio ', (tpk(np) - tpk(2))/REAL(np - 2, wp)*om/(2.0_wp*PI)
+ CALL require(ABS(zeta_meas - zeta_expect) <= 2.5e-3_wp*zeta_expect, &
+ label//TRIM(tag)//': decay matches zeta to 0.25 %')
+ IF (PRESENT(zeta_target)) THEN
+ WRITE (*, '(A,ES11.4,A,ES10.2)') label//TRIM(tag)//': target zeta ', zeta_target, ', measured rel. error ', &
+ (zeta_meas - zeta_target)/zeta_target
+ CALL require(ABS(zeta_meas - zeta_target) <= 2.5e-3_wp*zeta_target, &
+ label//TRIM(tag)//': the target zeta to 0.25 %')
+ END IF
+ END SUBROUTINE decay_case
+
+ SUBROUTINE check_refusals()
+ TYPE(CD_HermiteCableDynType) :: model
+ INTEGER :: es, k
+ CHARACTER(512) :: em
+ CALL setup(model, TENS, 1, 0.02_wp)
+ CALL CD_HermiteCable_Dyn_Set_Mass_Damping(model, [(-1.0_wp, k=1, NE)], es, em)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'finite and non-negative') > 0, 'R5: negative alpha refused')
+ CALL CD_HermiteCable_Dyn_Set_Mass_Damping(model, [(1.0_wp, k=1, NE - 1)], es, em)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'length ne') > 0, 'R5: wrong length refused')
+ CALL CD_HermiteCable_Dyn_Set_Mass_Damping(model, [(0.5_wp, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK .AND. model%has_mass_damping, 'R5: a positive alpha switches it on')
+ CALL CD_HermiteCable_Dyn_Set_Mass_Damping(model, [(0.0_wp, k=1, NE)], es, em)
+ CALL require(es == CD_HCDYN_OK .AND. .NOT. model%has_mass_damping, 'R5: all-zero alpha keeps it off')
+ END SUBROUTINE check_refusals
+
+END PROGRAM test_hermite_mass_damping_dynamic
diff --git a/tests/test_hermite_node_reaction.f90 b/tests/test_hermite_node_reaction.f90
index 9f4f49e8..823e95c8 100644
--- a/tests/test_hermite_node_reaction.f90
+++ b/tests/test_hermite_node_reaction.f90
@@ -11,7 +11,10 @@ PROGRAM test_hermite_node_reaction
!! attachments; finite, rigid or no end connections), at scattered states;
!! B. the maintained IEA-15 MW mixed mooring example through the OpenFAST aggregate, along a
!! coupled surge and heave trajectory in a current, and after a fairlead transfer without
- !! a step (the state the OpenFAST CalcOutput evaluates).
+ !! a step (the state the OpenFAST CalcOutput evaluates);
+ !! C. hand-built cables with the nodal twist (rigid bending ends, End A held in torsion and
+ !! End B held or on a torsional spring, torsional damping), at scattered states: the
+ !! reaction and the rigid ends' connection moment equal the full assembly's.
USE CableDyn_Precision, ONLY: wp
USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
CD_HermiteCable_Dyn_Reaction, CD_HermiteCable_Dyn_Set_Contact, &
@@ -20,7 +23,10 @@ PROGRAM test_hermite_node_reaction
CD_HermiteCable_Dyn_Set_Drag, CD_HermiteCable_Dyn_Set_AddedMass, &
CD_HermiteCable_Dyn_Set_Waves, CD_HermiteCable_Dyn_Set_Held_Fluid, &
CD_HermiteCable_Dyn_Set_EndConnection, CD_HermiteCable_Dyn_End, &
+ CD_HermiteCable_Dyn_Set_Torsion, CD_HermiteCable_Dyn_EndConnection_Moment, &
CD_HCDYN_OK
+ USE CableDyn_HermiteTorsion, ONLY: CD_HermiteTorsionType, CD_HermiteTorsion_Line, CD_HermiteTorsion_Unwrap, &
+ CD_HTORS_OK
USE CableDyn_EndConnection, ONLY: CD_ENDCONN_FINITE, CD_ENDCONN_RIGID
USE CableDyn_Line, ONLY: CD_Nodal_Seabed_Stiffness, CD_LINE_OK
USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_NMovingPoints, &
@@ -39,12 +45,15 @@ PROGRAM test_hermite_node_reaction
CALL case_hand_built(waves=.FALSE., mode=CD_ENDCONN_FINITE)
CALL case_hand_built(waves=.FALSE., mode=CD_ENDCONN_RIGID)
CALL case_hand_built(waves=.TRUE., mode=-1)
+ CALL case_nodal_twist(spring_b=.FALSE.)
+ CALL case_nodal_twist(spring_b=.TRUE.)
IF (COMMAND_ARGUMENT_COUNT() >= 1) CALL case_mixed_example()
IF (nfail > 0) THEN
WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
ERROR STOP 1
END IF
- WRITE (*, '(A,I0,A)') 'PASS: node reactions equal the full assembly bit for bit (', ncompared, ' nodes)'
+ WRITE (*, '(A,I0,A)') 'PASS: node reactions and end moments equal the full assembly bit for bit (', &
+ ncompared, ' nodes)'
CONTAINS
@@ -205,6 +214,105 @@ SUBROUTINE case_hand_built(waves, mode)
CALL CD_HermiteCable_Dyn_End(m)
END SUBROUTINE case_hand_built
+ SUBROUTINE case_nodal_twist(spring_b)
+ !! A 16-element cable along +x between held ends with Rigid bending connections and the nodal
+ !! twist (polar inertia, torsional damping, an imposed twist), End B held in torsion or on a
+ !! torsional spring, with drag in a current and added mass: at the rest state and at scattered
+ !! states (positions, velocities, accelerations and twist angles and rates), the node reaction
+ !! at every node and the connection moment at both ends equal the full assembly's.
+ LOGICAL, INTENT(IN) :: spring_b
+ INTEGER, PARAMETER :: NE = 16, NN = NE + 1, NDOF = 6*NN
+ REAL(wp), PARAMETER :: L = 1.5_wp, PI_L = 3.14159265358979323846_wp
+ TYPE(CD_HermiteCableDynType) :: m
+ TYPE(CD_HermiteTorsionType) :: tors
+ REAL(wp) :: l0(NE), diam(NE), q(NDOF), g(NDOF), raw, s, span, mo_full(3), mo_node(3)
+ REAL(wp), ALLOCATABLE :: r_saved(:), tw_saved(:)
+ INTEGER :: i, k, trial, es, es2, iend
+ CHARACTER(512) :: em
+ CHARACTER(32) :: label
+
+ WRITE (label, '(A,L1)') 'C spring_b=', spring_b
+ l0 = L
+ diam = 0.12_wp
+ span = L*REAL(NE, wp)
+ q = 0.0_wp
+ DO i = 1, NN
+ ! along +x, bowed in y with the end tangents along +x (as the rigid connections hold them)
+ s = REAL(i - 1, wp)*L
+ q(6*i - 5) = s
+ q(6*i - 4) = 0.3_wp*SIN(PI_L*s/span)**2
+ q(6*i - 2) = 1.0_wp
+ q(6*i - 1) = 0.3_wp*(PI_L/span)*SIN(2.0_wp*PI_L*s/span)
+ END DO
+ CALL CD_HermiteCable_Dyn_Init(m, l0, [(2.0e6_wp, k=1, NE)], [(500.0_wp, k=1, NE)], [(20.0_wp, k=1, NE)], &
+ [(0.0_wp, k=1, NE)], q, [1, 2, 3, NDOF - 5, NDOF - 4, NDOF - 3], -100.0_wp, &
+ 0.0_wp, 0.5_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, TRIM(label)//': init: '//TRIM(em))
+ IF (es /= CD_HCDYN_OK) RETURN
+ CALL CD_HermiteCable_Dyn_Set_EndConnection(m, [0.0_wp, 0.0_wp], &
+ RESHAPE([1.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp], [3, 2]), &
+ es, em, connection_mode=[CD_ENDCONN_RIGID, CD_ENDCONN_RIGID])
+ CALL require(es == CD_HCDYN_OK, TRIM(label)//': end connections: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_Set_Drag(m, 1025.0_wp, diam, [(1.2_wp, k=1, NE)], [(0.008_wp, k=1, NE)], 0.0_wp, &
+ [0.4_wp, 0.3_wp, 0.0_wp], es, em)
+ CALL require(es == CD_HCDYN_OK, TRIM(label)//': drag: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_Set_AddedMass(m, 1025.0_wp, diam, [(1.0_wp, k=1, NE)], [(0.1_wp, k=1, NE)], 0.0_wp, &
+ es, em)
+ CALL require(es == CD_HCDYN_OK, TRIM(label)//': added mass: '//TRIM(em))
+ tors%active = .TRUE.
+ tors%phi = 0.7_wp
+ tors%ends = RESHAPE([1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, &
+ 0.0_wp, 0.0_wp, 1.0_wp], [3, 4])
+ tors%end_compliance = 0.0_wp
+ IF (spring_b) tors%end_compliance(2) = 2.0e-4_wp
+ ALLOCATE (tors%gj(NE), tors%irn(NE), tors%bt(NE))
+ tors%gj = 3.0e3_wp
+ tors%irn = 0.05_wp
+ tors%bt = 40.0_wp
+ CALL CD_HermiteTorsion_Line(q, l0, tors%ends, raw, g, es, em)
+ CALL require(es == CD_HTORS_OK, TRIM(label)//': seed twist: '//TRIM(em))
+ tors%theta = CD_HermiteTorsion_Unwrap(raw, 0.0_wp)
+ tors%has_theta = .TRUE.
+ CALL CD_HermiteCable_Dyn_Set_Torsion(m, tors, es, em)
+ CALL require(es == CD_HCDYN_OK, TRIM(label)//': torsion: '//TRIM(em))
+ CALL require(m%tw_active, TRIM(label)//': the polar inertia installs the nodal twist')
+ IF (nfail > 0) RETURN
+
+ DO trial = 0, 6
+ IF (trial > 0) THEN
+ ! scattered state: positions within +-2 cm and tangent handles within +-0.02, velocities
+ ! and accelerations of order 1, twist angles within +-0.3 rad and their rates of order 1
+ DO i = 1, NDOF
+ m%q(i) = q(i) + 0.02_wp*uniform()
+ m%v(i) = uniform()
+ m%a(i) = 2.0_wp*uniform()
+ END DO
+ DO i = 1, NN
+ m%tw_phi(i) = m%tw_phi(i) + 0.3_wp*uniform()
+ m%tw_w(i) = uniform()
+ END DO
+ m%t = 0.41_wp*REAL(trial, wp)
+ END IF
+ CALL compare_nodes(m, TRIM(label)//MERGE(' rest ', ' scattered', trial == 0), [(i, i=1, NN)])
+ DO iend = 1, 2
+ k = MERGE(1, NN, iend == 1)
+ CALL CD_HermiteCable_Dyn_EndConnection_Moment(m, k, mo_full, es, em, full_assembly=.TRUE.)
+ CALL require(es == CD_HCDYN_OK, TRIM(label)//': full moment: '//TRIM(em))
+ r_saved = m%ws_R
+ tw_saved = [m%tw_me, m%tw_tsum]
+ CALL CD_HermiteCable_Dyn_EndConnection_Moment(m, k, mo_node, es2, em)
+ CALL require(es2 == CD_HCDYN_OK, TRIM(label)//': node moment: '//TRIM(em))
+ CALL require(same_bits(mo_node, mo_full), TRIM(label)//': end moment equals the full one')
+ CALL require(same_bits(m%ws_R, r_saved) .AND. same_bits([m%tw_me, m%tw_tsum], tw_saved), &
+ TRIM(label)//': end moment leaves the scratch untouched')
+ IF (.NOT. same_bits(mo_node, mo_full)) WRITE (*, '(A,I0,3ES24.16/A,3ES24.16)') ' node ', k, mo_node, &
+ ' full ', mo_full
+ ncompared = ncompared + 1
+ END DO
+ END DO
+ CALL CD_HermiteCable_Dyn_End(m)
+ END SUBROUTINE case_nodal_twist
+
SUBROUTINE case_mixed_example()
!! The mixed mooring example (EI = 0 chains and a grounded finite-EI power cable with contact,
!! friction, drag and added mass, host fluid held per step) along 4 s of coupled surge and
diff --git a/tests/test_hermite_tangent_predictor.f90 b/tests/test_hermite_tangent_predictor.f90
new file mode 100644
index 00000000..6b36f549
--- /dev/null
+++ b/tests/test_hermite_tangent_predictor.f90
@@ -0,0 +1,225 @@
+! File: tests/test_hermite_tangent_predictor.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_tangent_predictor
+ !! The Newton predictor of a finite-EI step and the stretch mode of the nodal tangents
+ !! (CableDyn_HermiteCableDynamic, dyn_step_core). A nodal tangent m = dr/ds carries the line's
+ !! stiffest motion, its stretch (EA against the tangent's small consistent mass, here omega ~
+ !! 8e3 rad/s, omega dt ~ 300 and 600); with little numerical damping it keeps ringing at the offset
+ !! it starts from, and the committed velocity and acceleration of that mode are far larger than
+ !! the motion it makes. The constant-acceleration and Newmark guesses extrapolated them and carried
+ !! the tangents across zero, and Newton converged to the root with every tangent reversed (each
+ !! element folded into a Z along its chord, 2.4e8 J of strain energy against 3.5 J), from which the
+ !! march failed a few steps on. A guess that changes the length of a free tangent by more than a
+ !! quarter of it now holds that tangent at its committed value, and a step that still ends with a
+ !! tangent turned by 90 degrees or more fails.
+ !!
+ !! The line: a weightless taut line (20 m, 10 elements, D 0.1 m, 8.1 kg/m, EA 5e7 N, EI 1e3 N m^2,
+ !! 3.8 kN, no added mass), pinned at both ends in a 0.3 m/s cross current, Cd 1.2, and the VIV lift
+ !! (Cl 0.8, cF 0.18, dF 0.08, running RMS window 0.25 s), under which it locks in at about 0.63 Hz
+ !! with a mid-span A/D of 0.56-0.57 (the lock-in case of the long-run VIV checks). Its seed is the
+ !! straight line with unit tangents, while the elements are stretched by T/EA = 7.6e-5: the tangent
+ !! stretch mode starts 7.6e-5 off its balance (|a| = 4.9e3 1/s^2 on the tangents). The reference
+ !! is the same line seeded with tangents of length 1 + T/EA (balanced), which every predictor ran
+ !! before and runs unchanged. 20 cycles of the nominal shedding period D/(cF U) = 1.85 s (37 s).
+ !!
+ !! Gates, for rho_inf 0.5, 0.8, 0.9 and 1 at 25 and 50 steps per cycle:
+ !! * G1 every step of the unit-tangent seed converges (before: at rho_inf 0.8, 0.9 and 1 the run
+ !! failed at step 5, 13, 4 (25 steps per cycle) and 10, 7, 6 (50), each after steps on the
+ !! reversed root; at 25 steps per cycle and rho_inf 0.5 it ran through reversed roots to a
+ !! mid-span A/D of 5.7);
+ !! * G2 its largest strain energy stays within 1.5 times the reference's (measured at most 1.07;
+ !! the reversed root has 3e7 times it);
+ !! * G3 its largest mid-span cross-flow displacement is the reference's within 2 % (measured at
+ !! most 0.09 %), so the ringing tangent stretch does not change the response;
+ !! * G2 and G3 are not applied at rho_inf 1 and 25 steps per cycle (21 per response period): with
+ !! no numerical damping the unit seed's undamped stretch ringing leaves a near-Nyquist velocity
+ !! of about 27 % of the VIV velocity, and equally consistent second-order VIV updates then land
+ !! +0.8 % to +10 % from the converged z max/D 0.5639 (this one +4.7 %, Es 1.51 times), so that
+ !! cell measures the VIV update's treatment of the spurious velocity, not the predictor; G1 and
+ !! G4 apply there;
+ !! * G7 from 50 steps per cycle the response converges to the reference with either seed: the
+ !! unit seed at rho_inf 1 and 50 steps per cycle is within 0.5 % of the converged z max/D
+ !! 0.5639 (measured 0.5632; 0.5639 from 200 steps per cycle on);
+ !! * G4 it takes at most 8 Newton iterations per step on average and no step more than 30 (the deck
+ !! default budget; measured at most 6.2 and 21, at 25 steps per cycle and rho_inf 1; before,
+ !! the first step alone took 21 at 50 steps per cycle and rho_inf 1, now 3);
+ !! * G5 the same line without the lift at 50 steps per cycle and rho_inf 1 (before: failed at step
+ !! 38 after steps on the reversed root): every step converges, the largest strain energy is
+ !! within 1.5 times the reference's (measured 1.09) and the mid-span in-line deflection at the end
+ !! within 1 % (measured to 4 digits);
+ !! * G6 the same no-lift line kept in its plane (r_z and m_z fixed at every node, the planar
+ !! constraint pattern): the guard applies to the free tangent components of a partly
+ !! constrained node, so it runs as G5 (before: the guard skipped every node with a fixed
+ !! tangent component, and the reversed-root check stopped the run).
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
+ CD_HermiteCable_Dyn_Set_Drag, CD_HermiteCable_Dyn_Set_VIV, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Energy, &
+ CD_HermiteCable_Dyn_End, CD_HCDYN_OK
+ IMPLICIT NONE
+
+ REAL(wp), PARAMETER :: RHOW = 1025.0_wp, D = 0.1_wp, CF = 0.18_wp, DF = 0.08_wp, U = 0.3_wp
+ REAL(wp), PARAMETER :: EA = 5.0e7_wp, TENS = 3.8e3_wp
+ INTEGER, PARAMETER :: NCYC = 20
+ !> The converged largest mid-span cross-flow displacement over D of the lifted line (G7): the
+ !> fine-step value (200 to 800 steps per cycle), the same for rho_inf 0.8 with either seed and for
+ !> rho_inf 1 with the balanced seed (0.56389 to 0.56398).
+ REAL(wp), PARAMETER :: Z_CONV = 0.5639_wp
+
+ !> One run: whether every step converged, the largest strain energy, the largest mid-span
+ !> cross-flow displacement, the mid-span in-line deflection at the end, the mean iterations.
+ TYPE :: run_result
+ LOGICAL :: ok = .FALSE.
+ INTEGER :: nstep = 0
+ INTEGER :: max_iters = 0
+ REAL(wp) :: es_max = 0.0_wp, z_max = 0.0_wp, y_end = 0.0_wp, iters = 0.0_wp
+ END TYPE run_result
+
+ INTEGER :: nfail = 0, ir, ip
+ REAL(wp), PARAMETER :: RHOS(4) = [0.5_wp, 0.8_wp, 0.9_wp, 1.0_wp]
+ INTEGER, PARAMETER :: NPERS(2) = [25, 50]
+ TYPE(run_result) :: unit, ref
+ CHARACTER(64) :: lab
+
+ DO ip = 1, SIZE(NPERS)
+ DO ir = 1, SIZE(RHOS)
+ WRITE (lab, '(A,F4.2,A,I0,A)') 'rho_inf ', RHOS(ir), ', ', NPERS(ip), ' steps per cycle'
+ CALL run(NPERS(ip), RHOS(ir), .TRUE., .FALSE., 1.0_wp, unit)
+ CALL run(NPERS(ip), RHOS(ir), .TRUE., .FALSE., 1.0_wp + TENS/EA, ref)
+ CALL report(lab, unit, ref)
+ CALL require(ref%ok, 'reference '//TRIM(lab)//': every step converges')
+ CALL require(unit%ok, 'G1 '//TRIM(lab)//': every step of the unit-tangent seed converges')
+ IF (.NOT. (unit%ok .AND. ref%ok)) CYCLE
+ IF (RHOS(ir) == 1.0_wp .AND. NPERS(ip) == 25) THEN
+ ! G2 and G3 do not apply here (see the header): at rho_inf 1 and 21 steps per response
+ ! period the ringing stretch leaves a near-Nyquist velocity of about 27 % of the VIV velocity,
+ ! and the response measures the VIV update's treatment of it, not the predictor
+ WRITE (*, '(2X,A)') TRIM(lab)//': G2 and G3 not applied (unresolved ringing velocity)'
+ ELSE
+ CALL require(unit%es_max <= 1.5_wp*ref%es_max, 'G2 '//TRIM(lab)//': the strain energy stays bounded')
+ CALL require(ABS(unit%z_max - ref%z_max) <= 0.02_wp*ref%z_max, &
+ 'G3 '//TRIM(lab)//': the cross-flow response is the balanced seed''s')
+ END IF
+ IF (RHOS(ir) == 1.0_wp .AND. NPERS(ip) == 50) THEN
+ WRITE (*, '(2X,A,F8.5,A,F8.5)') TRIM(lab)//': unit-seed z max/D ', unit%z_max/D, ' against the converged ', &
+ Z_CONV
+ CALL require(ABS(unit%z_max/D - Z_CONV) <= 5.0e-3_wp*Z_CONV, &
+ 'G7 '//TRIM(lab)//': the unit-seed response is the converged one')
+ END IF
+ CALL require(unit%iters <= 8.0_wp .AND. unit%max_iters <= 30, &
+ 'G4 '//TRIM(lab)//': Newton converges in a few iterations')
+ END DO
+ END DO
+ CALL run(50, 1.0_wp, .FALSE., .FALSE., 1.0_wp, unit)
+ CALL run(50, 1.0_wp, .FALSE., .FALSE., 1.0_wp + TENS/EA, ref)
+ CALL report('no lift, rho_inf 1.00, 50 steps per cycle', unit, ref)
+ CALL no_lift_gates('G5 no lift', unit, ref)
+ CALL run(50, 1.0_wp, .FALSE., .TRUE., 1.0_wp, unit)
+ CALL run(50, 1.0_wp, .FALSE., .TRUE., 1.0_wp + TENS/EA, ref)
+ CALL report('planar, no lift, rho_inf 1.00, 50 steps per cycle', unit, ref)
+ CALL no_lift_gates('G6 planar no lift', unit, ref)
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: the predictor holds the ringing tangent stretch'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE no_lift_gates(label, a, b)
+ CHARACTER(*), INTENT(IN) :: label
+ TYPE(run_result), INTENT(IN) :: a, b
+ CALL require(b%ok .AND. a%ok, label//': every step converges')
+ IF (.NOT. (b%ok .AND. a%ok)) RETURN
+ CALL require(a%es_max <= 1.5_wp*b%es_max, label//': the strain energy stays bounded')
+ CALL require(ABS(a%y_end - b%y_end) <= 0.01_wp*ABS(b%y_end), &
+ label//': the in-line deflection is the balanced seed''s')
+ END SUBROUTINE no_lift_gates
+
+ SUBROUTINE report(label, a, b)
+ CHARACTER(*), INTENT(IN) :: label
+ TYPE(run_result), INTENT(IN) :: a, b
+ WRITE (*, '(2X,A,A,I0,A,L1,A,3ES11.3,F6.2,I4,A,3ES11.3,F6.2,I4)') TRIM(label), ': unit seed steps ', a%nstep, &
+ ' ok ', a%ok, ' (Es max, z max/D, y end, mean and max iterations) ', a%es_max, a%z_max/D, a%y_end, a%iters, &
+ a%max_iters, &
+ '; balanced ', b%es_max, b%z_max/D, b%y_end, b%iters, b%max_iters
+ END SUBROUTINE report
+
+ SUBROUTINE run(nper, rho_inf, with_lift, planar, m0, res)
+ !! The taut line from its straight seed with tangents of length m0, over NCYC nominal cycles;
+ !! planar fixes r_z and m_z at every node (the line moves in the plane of the current).
+ INTEGER, INTENT(IN) :: nper
+ REAL(wp), INTENT(IN) :: rho_inf, m0
+ LOGICAL, INTENT(IN) :: with_lift, planar
+ TYPE(run_result), INTENT(OUT) :: res
+ INTEGER, PARAMETER :: NE = 10, NN = NE + 1, MIDN = NE/2 + 1
+ REAL(wp), PARAMETER :: SPAN = 20.0_wp, Z0 = -50.0_wp, MLIN = 8.1_wp
+ TYPE(CD_HermiteCableDynType) :: hm
+ REAL(wp) :: seed(6*NN), l0(NE), eav(NE), eiv(NE), rhoa(NE), wv(NE), hd(NE), hn(NE), ht(NE)
+ REAL(wp) :: cl(NE), cfv(NE), dfv(NE), dt, ek, es_
+ INTEGER :: i, n, es, its, nit
+ INTEGER, ALLOCATABLE :: fixed(:)
+ CHARACTER(1024) :: em
+ dt = D/(CF*U)/REAL(nper, wp)
+ l0 = SPAN/REAL(NE, wp)/(1.0_wp + TENS/EA)
+ eav = EA; rhoa = MLIN; eiv = 1.0e3_wp; wv = 0.0_wp
+ seed = 0.0_wp
+ DO i = 1, NN
+ seed(6*(i - 1) + 1) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ seed(6*(i - 1) + 3) = Z0
+ seed(6*(i - 1) + 4) = m0
+ END DO
+ fixed = [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3]
+ IF (planar) THEN
+ fixed = [1, 2, 3, 6]
+ DO i = 2, NN - 1
+ fixed = [fixed, 6*(i - 1) + 3, 6*(i - 1) + 6]
+ END DO
+ fixed = [fixed, 6*NE + 1, 6*NE + 2, 6*NE + 3, 6*NE + 6]
+ END IF
+ CALL CD_HermiteCable_Dyn_Init(hm, l0, eav, eiv, rhoa, wv, seed, fixed, -1.0e4_wp, 0.0_wp, rho_inf, es, em)
+ IF (es == CD_HCDYN_OK) THEN
+ hd = D; hn = 1.2_wp; ht = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_Drag(hm, RHOW, hd, hn, ht, 0.0_wp, [0.0_wp, U, 0.0_wp], es, em)
+ END IF
+ IF (es == CD_HCDYN_OK .AND. with_lift) THEN
+ cl = 0.8_wp; cfv = CF; dfv = DF
+ CALL CD_HermiteCable_Dyn_Set_VIV(hm, cl, cfv, dfv, 0.25_wp, es, em)
+ END IF
+ CALL require(es == CD_HCDYN_OK, 'the line sets up: '//TRIM(em))
+ IF (es /= CD_HCDYN_OK) RETURN
+ nit = 0
+ res%ok = .TRUE.
+ DO n = 1, nper*NCYC
+ CALL CD_HermiteCable_Dyn_Step(hm, dt, 50, 1.0e-8_wp, es, em, iters_out=its)
+ IF (es /= CD_HCDYN_OK) THEN
+ res%ok = .FALSE.
+ WRITE (*, '(A,I0,A)') ' step ', n, ': '//TRIM(em)
+ EXIT
+ END IF
+ res%nstep = n
+ nit = nit + its
+ res%max_iters = MAX(res%max_iters, its)
+ CALL CD_HermiteCable_Dyn_Energy(hm, ek, es_, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ res%ok = .FALSE.
+ EXIT
+ END IF
+ res%es_max = MAX(res%es_max, es_)
+ res%z_max = MAX(res%z_max, ABS(hm%q(6*(MIDN - 1) + 3) - Z0))
+ END DO
+ res%y_end = hm%q(6*(MIDN - 1) + 2)
+ res%iters = REAL(nit, wp)/REAL(MAX(1, res%nstep), wp)
+ CALL CD_HermiteCable_Dyn_End(hm)
+ END SUBROUTINE run
+
+END PROGRAM test_hermite_tangent_predictor
diff --git a/tests/test_hermite_viv.f90 b/tests/test_hermite_viv.f90
index 698b4534..a53c1da6 100644
--- a/tests/test_hermite_viv.f90
+++ b/tests/test_hermite_viv.f90
@@ -19,7 +19,14 @@ PROGRAM test_hermite_viv
!! * at 60 s the mid-span cross-flow amplitude is above 0.3 D with the lift and below 0.01 D
!! without it;
!! * a snapshot taken mid-run and restored replays the following steps bit for bit (state and
- !! phase), and the recovering step equals the plain step when no step fails.
+ !! phase), and the recovering step equals the plain step when no step fails;
+ !! * the residual's round-off floor: the same line hung vertically from 50 m to 150 m depth,
+ !! from rest with the lift, at dt 2.5e-5 s. The inertia takes the acceleration
+ !! (q - q_n)/(beta dt^2) - ... from coordinates stored to their last bits, so its residual
+ !! cannot be settled below their rounding, which grows like 1/dt^2: the first step stagnated
+ !! at 2.4 times the tolerance 1e-8 through its 50-iteration budget and failed. Each step stops
+ !! on that floor, and the cross-flow displacement at 0.02 s matches the same line's at
+ !! dt 1e-3 s within 1 %.
USE CableDyn_Precision, ONLY: wp
USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
CD_HermiteCable_Dyn_Set_Drag, CD_HermiteCable_Dyn_Set_AddedMass, &
@@ -132,6 +139,9 @@ PROGRAM test_hermite_viv
CALL require(k > 100, 'the recovering step equals the plain step')
CALL CD_HermiteCable_Dyn_End(model)
+ ! ---- the inertia's round-off floor at a small time step ----
+ CALL check_inertia_floor()
+
IF (nfail > 0) THEN
WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
ERROR STOP 1
@@ -200,6 +210,54 @@ REAL(wp) FUNCTION run_amplitude(m) RESULT(amp)
amp = 0.5_wp*(zmax - zmin)
END FUNCTION run_amplitude
+ SUBROUTINE check_inertia_floor()
+ !! The line hung vertically from 50 m to 150 m depth in the cross current along y (its lift
+ !! along x), from rest: 800 steps of 2.5e-5 s against 20 of 1e-3 s, the mid-span cross-flow
+ !! displacement at 0.02 s.
+ REAL(wp), PARAMETER :: T_END = 0.02_wp
+ REAL(wp) :: dx(2), step_dt(2), res, seed(6*(NE + 1)), l0(NE), eav(NE), eiv(NE), wv(NE), rhoa(NE), &
+ hd(NE), hn(NE), ht(NE)
+ INTEGER :: run, n, it, i, xmid
+ step_dt = [2.5e-5_wp, 1.0e-3_wp]
+ xmid = 6*(NE/2) + 1 ! r_x of the mid-span node
+ seed = 0.0_wp
+ DO i = 1, NE + 1
+ seed(6*(i - 1) + 3) = -50.0_wp - SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ seed(6*(i - 1) + 6) = -1.0_wp
+ END DO
+ l0 = SPAN/REAL(NE, wp)/(1.0_wp + TENS/EA)
+ eav = EA; eiv = EI; rhoa = MLIN
+ wv = (MLIN - RHOW*0.25_wp*PI*D**2)*GACC
+ hd = D; ht = 0.0_wp
+ DO run = 1, 2
+ CALL CD_HermiteCable_Dyn_Init(model, l0, eav, eiv, rhoa, wv, seed, [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3], &
+ -200.0_wp, 0.0_wp, 0.5_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'round-off floor, init: '//TRIM(em))
+ hn = 1.2_wp
+ CALL CD_HermiteCable_Dyn_Set_Drag(model, RHOW, hd, hn, ht, 0.0_wp, [0.0_wp, U, 0.0_wp], es, em)
+ CALL require(es == CD_HCDYN_OK, 'round-off floor, drag: '//TRIM(em))
+ hn = 1.0_wp
+ CALL CD_HermiteCable_Dyn_Set_AddedMass(model, RHOW, hd, hn, ht, 0.0_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'round-off floor, added mass: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'round-off floor, VIV: '//TRIM(em))
+ dx(run) = model%q(xmid)
+ DO n = 1, NINT(T_END/step_dt(run))
+ CALL CD_HermiteCable_Dyn_Step(model, step_dt(run), 50, 1.0e-8_wp, es, em, it, res)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL require(.FALSE., 'round-off floor: step failed: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_End(model)
+ RETURN
+ END IF
+ END DO
+ dx(run) = model%q(xmid) - dx(run)
+ CALL CD_HermiteCable_Dyn_End(model)
+ END DO
+ WRITE (*, '(A,ES11.4,A,ES11.4,A)') ' round-off floor: mid-span cross-flow displacement at 0.02 s ', dx(1), &
+ ' m at dt 2.5e-5 s, ', dx(2), ' m at dt 1e-3 s'
+ CALL require(ABS(dx(1) - dx(2)) <= 0.01_wp*ABS(dx(2)), 'round-off floor: the small steps follow the large ones')
+ END SUBROUTINE check_inertia_floor
+
SUBROUTINE require(cond, label)
LOGICAL, INTENT(IN) :: cond
CHARACTER(*), INTENT(IN) :: label
diff --git a/tests/test_hermite_viv_frame.f90 b/tests/test_hermite_viv_frame.f90
new file mode 100644
index 00000000..4d831285
--- /dev/null
+++ b/tests/test_hermite_viv_frame.f90
@@ -0,0 +1,375 @@
+! File: tests/test_hermite_viv_frame.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_viv_frame
+ !! The flow frame of the synchronisation model on the cubic-Hermite cable
+ !! (CD_HermiteCable_Dyn_Set_VIV tf): with a filter time Tf > 0 the motion of the phase (the node's
+ !! velocity relative to its velocity low-pass filtered over Tf), the amplitude estimate and the
+ !! cross-flow damping split take the cable's filtered motion as their frame, so they are the same
+ !! in the cylinder's frame and in the water's.
+ !!
+ !! The pipe: 20 m, 10 elements, D 0.1 m, EI 1000 N m^2, pinned, about 21 kN, its mass that of the
+ !! water it displaces (8.05 kg/m, no net weight), Cd 1.2, Ca 1, Cl 0.8, alone or with an
+ !! amplitude table (Cv 0.8, 0.6, 0.0 and CdAmp 1.0, 1.3, 1.6 at A/D 0, 0.5, 1) and Thorsen's
+ !! cross-flow damping (a, b) = (0.31, 0.89). The flow along y oscillates with amplitude 0.6 m/s
+ !! and period 40 s (KC 240), its amplitude ramped up over the first period; the cross-flow axis
+ !! is z.
+ !! * moving: still water, both ends moved along y with velocity V(t);
+ !! * fixed: the ends held, the water moving at -V(t) (a held fluid field with its acceleration,
+ !! so the Froude-Krylov and added-mass loads act).
+ !! With the pipe's mass equal to the displaced mass, the in-line inertia of the two problems is
+ !! the same ((m + Ca rho A) dV/dt against (1 + Ca) rho A dV/dt); for any other mass they differ by
+ !! the Froude-Krylov term (m - rho A) dV/dt, the inertial force of the moving frame. So the two
+ !! runs differ only where the model depends on the frame.
+ !!
+ !! Gates:
+ !! * F1 the setter refuses tf of the wrong size, a negative or non-finite tf, tf > 0 on an element
+ !! without lift and tf with the wake oscillator; tf on the lift alone installs the frame (nine
+ !! motion statistics, no table); an all-zero tf installs no frame and reproduces the run
+ !! without tf bit for bit;
+ !! * F2 with Tf 0.6 s the moving and the fixed pipe agree, with the tables and with the lift
+ !! alone: the RMS cross-flow response of the mid node over the second period within 1 %, its
+ !! peak within 2 %. The RMS agrees within 0.6 % (measured 0.02 % with the tables and 0.6 % with the
+ !! lift alone), the peak within 0.8 % (0.811 against 0.818 D with the tables), a single extreme
+ !! of the response (with the step-start phase update it ranged 0.811-0.819 D over the builds,
+ !! OpenBLAS kernels and platforms). What is left is the
+ !! filter's lag of the imposed velocity, about omega Tf = 0.094 rad;
+ !! * F3 without the frame they differ: in still water the moving pipe's phase sees no cross-flow
+ !! velocity (r'.e = u.e = 0 across the relative flow), and with the tables it takes Cv and CdAmp
+ !! at A/D 0 and the Morison drag; with the tables the peak response is more than 10 % (measured
+ !! 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;
+ !! * 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, 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, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Snapshot, &
+ CD_HermiteCable_Dyn_Restore, CD_HermiteCable_Dyn_End, CD_HCDYN_OK
+ IMPLICIT NONE
+
+ REAL(wp), PARAMETER :: PI = 3.141592653589793_wp
+ REAL(wp), PARAMETER :: RHOW = 1025.0_wp, D = 0.1_wp, EA = 5.0e7_wp, EI = 1.0e3_wp, TENS = 2.1e4_wp
+ REAL(wp), PARAMETER :: SPAN = 20.0_wp, DT = 0.01_wp, U0 = 0.6_wp, TP = 40.0_wp, TF = 0.6_wp
+ REAL(wp), PARAMETER :: MLIN = RHOW*0.25_wp*PI*D*D
+ INTEGER, PARAMETER :: NE = 10, NN = NE + 1, MID = 6*(NE/2), NSTEP = NINT(2.0_wp*TP/DT)
+ ! the agreement of the moving and the fixed pipe with the flow frame (F2)
+ REAL(wp), PARAMETER :: TOL_F2 = 0.01_wp, TOL_F2_PEAK = 0.02_wp
+
+ TYPE(CD_HermiteCableDynType) :: model, twin
+ REAL(wp) :: cl(NE), cf(NE), df(NE), amp(3, CD_VIV_AMP_MAXP, NE), cdy(2, NE), tf0(NE), tfv(NE)
+ INTEGER :: ampn(NE)
+ REAL(wp) :: pk_mf, rms_mf, pk_ff, rms_ff, pk_m0, rms_m0, pk_f0, rms_f0
+ INTEGER :: es, nfail, k, it
+ LOGICAL :: tables
+ CHARACTER(12) :: lab
+ CHARACTER(1024) :: em
+
+ nfail = 0
+ cl = 0.8_wp; cf = 0.18_wp; df = 0.08_wp
+ amp = 0.0_wp
+ amp(:, 1, :) = SPREAD([0.0_wp, 0.8_wp, 1.0_wp], 2, NE)
+ amp(:, 2, :) = SPREAD([0.5_wp, 0.6_wp, 1.3_wp], 2, NE)
+ amp(:, 3, :) = SPREAD([1.0_wp, 0.0_wp, 1.6_wp], 2, NE)
+ ampn = 3
+ cdy(1, :) = 0.31_wp; cdy(2, :) = 0.89_wp
+ tf0 = 0.0_wp
+ tfv = TF
+
+ ! ---- F1 refusals; an all-zero tf is no frame ----
+ CALL build(model)
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, tf=tfv(1:NE - 1))
+ CALL require(es /= CD_HCDYN_OK, 'F1: tf of the wrong size is refused')
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, tf=-tfv)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'must be >= 0') > 0, 'F1: a negative tf is refused: '//TRIM(em))
+ BLOCK
+ REAL(wp) :: bad(NE)
+ REAL(wp) :: cl2(NE)
+ bad = tfv
+ bad(4) = IEEE_VALUE(1.0_wp, IEEE_QUIET_NAN)
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, tf=bad)
+ CALL require(es /= CD_HCDYN_OK, 'F1: a non-finite tf is refused')
+ cl2 = cl
+ cl2(3) = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl2, cf, df, 2.0_wp, es, em, tf=tfv)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'only where cl > 0') > 0, &
+ 'F1: tf > 0 on an element without lift is refused: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 2.0_wp, es, em, &
+ wake=RESHAPE([(0.2_wp, 0.3_wp, 12.0_wp, k=1, NE)], [3, NE]), tf=tf0)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'wake(4, :)') > 0, 'F1: tf with the wake oscillator is refused: '// &
+ TRIM(em))
+ END BLOCK
+ CALL require(.NOT. model%has_viv .AND. .NOT. model%viv_frame, 'F1: a refused call installs nothing')
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 2.0_wp, es, em, tf=tfv)
+ CALL require(es == CD_HCDYN_OK .AND. model%viv_frame .AND. .NOT. model%has_viv_amp .AND. &
+ SIZE(model%viv_ms, 1) == CD_VIV_NMS_FRAME + 1, 'F1: the frame installs on the lift alone: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, cdy=cdy, tf=tf0)
+ CALL require(es == CD_HCDYN_OK .AND. .NOT. model%viv_frame .AND. SIZE(model%viv_ms, 1) == 7, &
+ 'F1: an all-zero tf installs no frame: '//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)
+ CALL require(es == CD_HCDYN_OK, 'F1: the twin without tf installs: '//TRIM(em))
+ DO k = 1, 600
+ CALL advance(model, k, .TRUE.)
+ CALL advance(twin, k, .TRUE.)
+ IF (es /= CD_HCDYN_OK) EXIT
+ IF (ANY(model%q /= twin%q) .OR. ANY(model%viv_phi /= twin%viv_phi) .OR. ANY(model%viv_ms /= twin%viv_ms)) EXIT
+ END DO
+ CALL require(k > 600, 'F1: an all-zero tf reproduces the run without tf bit for bit')
+ CALL CD_HermiteCable_Dyn_End(model)
+ CALL CD_HermiteCable_Dyn_End(twin)
+
+ ! ---- F2 and F3 the two frames, with and without the flow frame, with and without the tables ----
+ DO it = 1, 2
+ tables = it == 1
+ lab = MERGE(' (tables) ', ' (lift only)', tables)
+ CALL run_case(.TRUE., tfv, tables, pk_mf, rms_mf)
+ CALL run_case(.FALSE., tfv, tables, pk_ff, rms_ff)
+ CALL run_case(.TRUE., tf0, tables, pk_m0, rms_m0)
+ CALL run_case(.FALSE., tf0, tables, pk_f0, rms_f0)
+ WRITE (*, '(A,2F9.4,A,2F9.4)') ' F2'//lab//' with Tf: moving peak, RMS A/D ', pk_mf/D, rms_mf/D, '; fixed ', &
+ pk_ff/D, rms_ff/D
+ WRITE (*, '(A,2F9.4,A,2F9.4)') ' F3'//lab//' without: moving peak, RMS A/D ', pk_m0/D, rms_m0/D, '; fixed ', &
+ pk_f0/D, rms_f0/D
+ CALL require(pk_ff > 0.2_wp*D, 'F2: the fixed pipe locks in'//lab)
+ CALL require(ABS(pk_mf/pk_ff - 1.0_wp) <= TOL_F2_PEAK .AND. ABS(rms_mf/rms_ff - 1.0_wp) <= TOL_F2, &
+ 'F2: with the flow frame the moving and the fixed pipe agree'//lab)
+ CALL require(ABS(pk_m0/pk_f0 - 1.0_wp) > MERGE(0.10_wp, 0.0_wp, tables) .AND. &
+ ABS(rms_m0/rms_f0 - 1.0_wp) > MERGE(0.15_wp, 0.04_wp, tables), &
+ 'F3: without it the moving pipe responds otherwise'//lab)
+ END DO
+
+ ! ---- F4 snapshot replay with the filtered velocity ----
+ BLOCK
+ REAL(wp), ALLOCATABLE :: q_ref(:, :), ms_ref(:, :, :)
+ INTEGER :: s
+ 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=tfv)
+ CALL require(es == CD_HCDYN_OK .AND. model%viv_frame .AND. SIZE(model%viv_ms, 1) == CD_VIV_NMS_FRAME + 1, &
+ 'F4: the frame installs: '//TRIM(em))
+ DO s = 1, 1500
+ CALL advance(model, s, .TRUE.)
+ END DO
+ CALL require(MAXVAL(ABS(model%viv_ms(8, :))) > 0.1_wp*U0, 'F4: the filtered velocity follows the motion')
+ CALL CD_HermiteCable_Dyn_Snapshot(model, es, em)
+ CALL require(es == CD_HCDYN_OK, 'F4: snapshot: '//TRIM(em))
+ ALLOCATE (q_ref(SIZE(model%q), 200), ms_ref(CD_VIV_NMS_FRAME + 1, 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, 'F4: 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, 'F4: the restored snapshot replays the state and the filtered velocity bit for bit')
+ 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
+ END IF
+ WRITE (*, '(A)') 'PASS: the flow frame of the synchronisation model on the cubic-Hermite cable'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE build(m)
+ !! The pinned taut pipe along x at 10 m depth in still water, pretensioned through its
+ !! unstretched length, with drag and the normal added mass.
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: m
+ REAL(wp) :: seed(6*NN), l0(NE), eav(NE), eiv(NE), wv(NE), rhoa(NE), hd(NE), hn(NE), ht(NE)
+ INTEGER :: i
+ seed = 0.0_wp
+ DO i = 1, NN
+ seed(6*(i - 1) + 1) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ seed(6*(i - 1) + 3) = -10.0_wp
+ seed(6*(i - 1) + 4) = 1.0_wp
+ END DO
+ l0 = SPAN/REAL(NE, wp)/(1.0_wp + TENS/EA)
+ eav = EA; eiv = EI; rhoa = MLIN; wv = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Init(m, l0, eav, eiv, rhoa, wv, seed, end_dofs(), -200.0_wp, 0.0_wp, 0.5_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'init: '//TRIM(em))
+ hd = D; hn = 1.2_wp; ht = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_Drag(m, RHOW, hd, hn, ht, 0.0_wp, [0.0_wp, 0.0_wp, 0.0_wp], es, em)
+ CALL require(es == CD_HCDYN_OK, 'drag: '//TRIM(em))
+ hn = 1.0_wp
+ CALL CD_HermiteCable_Dyn_Set_AddedMass(m, RHOW, hd, hn, ht, 0.0_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'added mass: '//TRIM(em))
+ END SUBROUTINE build
+
+ PURE FUNCTION end_dofs() RESULT(fixed)
+ INTEGER :: fixed(6)
+ fixed = [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3]
+ END FUNCTION end_dofs
+
+ SUBROUTINE imposed(t, y, v, a)
+ !! The imposed motion along y: V = U0 r(t) sin(omega t), r = (1 - cos(pi t/TP))/2 over the
+ !! first period and 1 after it; y its integral (exact), a its derivative.
+ REAL(wp), INTENT(IN) :: t
+ REAL(wp), INTENT(OUT) :: y, v, a
+ REAL(wp) :: om, p, r, dr
+ om = 2.0_wp*PI/TP
+ p = PI/TP
+ IF (t < TP) THEN
+ r = 0.5_wp*(1.0_wp - COS(p*t))
+ dr = 0.5_wp*p*SIN(p*t)
+ ! int_0^t (1 - cos(p s)) sin(om s)/2 ds with om = 2 p
+ y = U0*0.5_wp*((1.0_wp - COS(om*t))/om - (0.5_wp*(1.0_wp - COS(3.0_wp*p*t))/(3.0_wp*p) + &
+ 0.5_wp*(1.0_wp - COS(p*t))/p))
+ ELSE
+ r = 1.0_wp
+ dr = 0.0_wp
+ y = U0*0.5_wp*(-(0.5_wp*(1.0_wp - COS(3.0_wp*PI))/(3.0_wp*p) + 0.5_wp*(1.0_wp - COS(PI))/p)) + &
+ U0*(COS(om*TP) - COS(om*t))/om
+ END IF
+ v = U0*r*SIN(om*t)
+ a = U0*(dr*SIN(om*t) + r*om*COS(om*t))
+ END SUBROUTINE imposed
+
+ SUBROUTINE advance(m, s, moving)
+ !! Step s (to t = s DT) of the moving pipe (ends prescribed) or of the fixed pipe (the held
+ !! field at the step's mid time, -V and -dV/dt).
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: m
+ INTEGER, INTENT(IN) :: s
+ LOGICAL, INTENT(IN) :: moving
+ REAL(wp) :: y, v, a, pq(6), pv(6), pa(6), fu(3, NN), fa(3, NN), wl(NN)
+ INTEGER :: i
+ IF (moving) THEN
+ CALL imposed(REAL(s, wp)*DT, y, v, a)
+ pq = [0.0_wp, y, -10.0_wp, SPAN, y, -10.0_wp]
+ pv = [0.0_wp, v, 0.0_wp, 0.0_wp, v, 0.0_wp]
+ pa = [0.0_wp, a, 0.0_wp, 0.0_wp, a, 0.0_wp]
+ CALL CD_HermiteCable_Dyn_Step(m, DT, 50, 1.0e-8_wp, es, em, pres_dofs=end_dofs(), pres_q=pq, pres_v=pv, &
+ pres_a=pa)
+ ELSE
+ CALL imposed((REAL(s, wp) - 0.5_wp)*DT, y, v, a)
+ DO i = 1, NN
+ fu(:, i) = [0.0_wp, -v, 0.0_wp]
+ fa(:, i) = [0.0_wp, -a, 0.0_wp]
+ END DO
+ wl = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_Held_Fluid(m, fu, fa, wl, es, em)
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL require(.FALSE., 'held field: '//TRIM(em)); RETURN
+ END IF
+ CALL CD_HermiteCable_Dyn_Step(m, DT, 50, 1.0e-8_wp, es, em)
+ END IF
+ IF (es /= CD_HCDYN_OK) CALL require(.FALSE., 'step: '//TRIM(em))
+ END SUBROUTINE advance
+
+ 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, &
+ tf_cycle=cyc)
+ ELSE
+ CALL CD_HermiteCable_Dyn_Set_VIV(m, cl, cf, df, 2.0_wp, es, em, tf=tfe)
+ END IF
+ CALL require(es == CD_HCDYN_OK, 'VIV: '//TRIM(em))
+ pk = 0.0_wp
+ s2 = 0.0_wp
+ n = 0
+ DO s = 1, NSTEP
+ CALL advance(m, s, moving)
+ IF (es /= CD_HCDYN_OK) EXIT
+ IF (s <= NSTEP/2) CYCLE
+ z = m%q(MID + 3) + 10.0_wp
+ pk = MAX(pk, ABS(z))
+ s2 = s2 + z*z
+ n = n + 1
+ END DO
+ rms = SQRT(s2/REAL(MAX(n, 1), wp))
+ CALL CD_HermiteCable_Dyn_End(m)
+ END SUBROUTINE run_case
+
+END PROGRAM test_hermite_viv_frame
diff --git a/tests/test_hermite_viv_inline.f90 b/tests/test_hermite_viv_inline.f90
new file mode 100644
index 00000000..63acaff8
--- /dev/null
+++ b/tests/test_hermite_viv_inline.f90
@@ -0,0 +1,336 @@
+! File: tests/test_hermite_viv_inline.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_hermite_viv_inline
+ !! In-line VIV on the cubic-Hermite cable (CD_HermiteCable_Dyn_Set_VIV clx, il_alpha; Ulveseter,
+ !! Thorsen, Saevik and Larsen, Mar. Struct. 60, 2018): a second shedding force
+ !! 1/2 rho D C_vx cos(phi_x) U v_n along the relative normal flow, its phase slaved to twice the
+ !! cross-flow shedding rate, d phi_x/dt = 2 (d phi/dt) [1 + alpha sin(phi_xd - phi_x)].
+ !!
+ !! The line is test_hermite_viv's: 100 m taut, pinned, 20 elements, D 0.1 m, in a 0.15 m/s
+ !! current along y, so the cross-flow lift acts along z and the in-line force along y.
+ !!
+ !! Gates:
+ !! * I1 the setter refuses clx without il_alpha, mismatched sizes, a negative clx, alpha >= 1 and
+ !! an in-line coefficient on an element without the cross-flow lift; an all-zero clx installs
+ !! no in-line state; the in-line phase starts at twice the cross-flow phase;
+ !! * I2 the element load: a straight element at rest across the current carries
+ !! U^2 l0 (k_x1 + k_x2)/2 along the flow; the in-line part adds to the cross-flow one; its
+ !! Jacobians match central differences on a curved, moving element;
+ !! * I3 an all-zero clx reproduces the cross-flow-only run bit for bit;
+ !! * I4 at rest the committed node load carries the in-line force along y, absent without it;
+ !! * I5 in lock-in the in-line response at the quarter span oscillates at twice the cross-flow
+ !! frequency of the mid span, and is larger than the cross-flow-only run's;
+ !! * I6 a snapshot taken mid-run and restored replays the following steps bit for bit (state and
+ !! both phases), and the recovering step equals the plain step.
+ USE CableDyn_Precision, ONLY: wp
+ 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_VIV_Node_Lift, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Step_Recovering, &
+ CD_HermiteCable_Dyn_Snapshot, CD_HermiteCable_Dyn_Restore, &
+ CD_HermiteCable_Dyn_End, CD_HermiteCable_VIV_Lift_Element, CD_HCDYN_OK
+ IMPLICIT NONE
+
+ REAL(wp), PARAMETER :: PI = 3.141592653589793_wp
+ REAL(wp), PARAMETER :: RHOW = 1025.0_wp, GACC = 9.80665_wp
+ REAL(wp), PARAMETER :: D = 0.1_wp, MLIN = 8.10_wp, EA = 5.0e7_wp, EI = 1.0_wp, TENS = 5.0e4_wp
+ REAL(wp), PARAMETER :: SPAN = 100.0_wp, U = 0.15_wp, DT = 0.02_wp, CVX = 0.85_wp, ALPHA = 0.15_wp
+ INTEGER, PARAMETER :: NE = 20
+
+ TYPE(CD_HermiteCableDynType) :: model, twin
+ REAL(wp), ALLOCATABLE :: cl(:), cf(:), df(:), clx(:), al(:), q_ref(:, :), phi_ref(:, :), phx_ref(:, :)
+ REAL(wp) :: lift(3, NE + 1)
+ INTEGER :: es, nfail, k, mid, quarter
+ CHARACTER(1024) :: em
+
+ nfail = 0
+ mid = 6*(NE/2) ! base index of the mid-span node
+ quarter = 6*(NE/4) ! and of the quarter-span node
+ ALLOCATE (cl(NE), cf(NE), df(NE), clx(NE), al(NE))
+ cl = 0.8_wp; cf = 0.18_wp; df = 0.08_wp; clx = CVX; al = ALPHA
+
+ ! ---- I1 refusals and the start ----
+ CALL build(model)
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=clx)
+ CALL require(es /= CD_HCDYN_OK, 'I1: clx without il_alpha is refused')
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=clx(1:NE - 1), il_alpha=al(1:NE - 1))
+ CALL require(es /= CD_HCDYN_OK, 'I1: mismatched in-line arrays are refused')
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=-clx, il_alpha=al)
+ CALL require(es /= CD_HCDYN_OK, 'I1: a negative clx is refused')
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=al + 1.0_wp)
+ CALL require(es /= CD_HCDYN_OK, 'I1: alpha >= 1 is refused')
+ BLOCK
+ REAL(wp) :: cl2(NE)
+ cl2 = cl
+ cl2(3) = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl2, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=al)
+ CALL require(es /= CD_HCDYN_OK .AND. INDEX(em, 'cross-flow') > 0, &
+ 'I1: an in-line coefficient without the cross-flow lift is refused: '//TRIM(em))
+ END BLOCK
+ CALL require(.NOT. model%has_viv .AND. .NOT. model%has_viv_il, 'I1: a refused call installs nothing')
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=0.0_wp*clx, il_alpha=al)
+ CALL require(es == CD_HCDYN_OK .AND. model%has_viv .AND. .NOT. model%has_viv_il, &
+ 'I1: an all-zero clx installs the cross-flow VIV only')
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=al)
+ CALL require(es == CD_HCDYN_OK .AND. model%has_viv_il, 'I1: in-line VIV installs: '//TRIM(em))
+ CALL require(ALL(ABS(model%vil_phi - MODULO(2.0_wp*model%viv_phi, 2.0_wp*PI)) <= 1.0e-12_wp), &
+ 'I1: the in-line phase starts at twice the cross-flow phase')
+ CALL require(ALL(ABS(model%vil_k - 0.5_wp*RHOW*D*CVX) <= 1.0e-12_wp), 'I1: the in-line scale is 1/2 rho D C_vx')
+
+ ! ---- I4 the committed node load at rest: in-line along y, cross-flow along z ----
+ CALL CD_HermiteCable_Dyn_VIV_Node_Lift(model, lift, es, em)
+ CALL require(es == CD_HCDYN_OK, 'I4: node lift: '//TRIM(em))
+ BLOCK
+ REAL(wp) :: lift0(3, NE + 1), ref_y, term, scale
+ INTEGER :: e
+ ! the in-line force of each (stretched) element at rest: U^2 (SPAN/NE) (k_x1 + k_x2)/2 along y;
+ ! the spread start phases nearly cancel in the sum, so the tolerance scales with its terms
+ ref_y = 0.0_wp
+ scale = 0.0_wp
+ DO e = 1, NE
+ term = U*U*(SPAN/REAL(NE, wp))*0.5_wp*model%vil_k(e)*(COS(model%vil_phi(e)) + COS(model%vil_phi(e + 1)))
+ ref_y = ref_y + term
+ scale = scale + ABS(term)
+ END DO
+ CALL require(ABS(SUM(lift(2, :)) - ref_y) <= 1.0e-12_wp*scale .AND. MAXVAL(ABS(lift(2, :))) > 1.0e-2_wp, &
+ 'I4: the node load carries the in-line force along the flow')
+ CALL twin_without_il(twin)
+ CALL CD_HermiteCable_Dyn_VIV_Node_Lift(twin, lift0, es, em)
+ CALL require(MAXVAL(ABS(lift0(2, :))) <= 1.0e-12_wp .AND. &
+ MAXVAL(ABS(lift0(3, :) - lift(3, :))) <= 1.0e-12_wp*MAXVAL(ABS(lift0(3, :))), &
+ 'I4: without in-line VIV no force along y, the same cross-flow lift')
+ CALL CD_HermiteCable_Dyn_End(twin)
+ END BLOCK
+
+ ! ---- I2 element load and Jacobians ----
+ CALL check_element()
+
+ ! ---- I3 an all-zero clx is the cross-flow-only run ----
+ CALL CD_HermiteCable_Dyn_End(model)
+ CALL build(model)
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=0.0_wp*clx, il_alpha=al)
+ CALL twin_without_il(twin)
+ DO k = 1, 300
+ CALL advance(model, 1, .FALSE.)
+ CALL advance(twin, 1, .FALSE.)
+ IF (ANY(model%q /= twin%q) .OR. ANY(model%viv_phi /= twin%viv_phi)) EXIT
+ END DO
+ CALL require(k > 300, 'I3: an all-zero clx reproduces the cross-flow-only run bit for bit')
+ CALL CD_HermiteCable_Dyn_End(model)
+ CALL CD_HermiteCable_Dyn_End(twin)
+
+ ! ---- I5 lock-in: the in-line response at twice the cross-flow frequency ----
+ BLOCK
+ REAL(wp) :: fy, fx, ax_il, ax_cf, ay
+ CALL build(model)
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=al)
+ CALL run_response(model, fy, fx, ay, ax_il)
+ CALL CD_HermiteCable_Dyn_End(model)
+ CALL twin_without_il(twin)
+ CALL run_response(twin, fy, fx, ay, ax_cf)
+ CALL CD_HermiteCable_Dyn_End(twin)
+ CALL build(model)
+ CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=al)
+ CALL run_response(model, fy, fx, ay, ax_il)
+ WRITE (*, '(A,F7.4,A,F7.4,A,F7.3)') ' I5: cross-flow ', fy, ' Hz, in-line ', fx, ' Hz, ratio ', fx/fy
+ WRITE (*, '(A,F8.4,A,F8.4,A,F8.4)') ' I5: CF amplitude/D ', ay/D, ', IL amplitude/D ', ax_il/D, &
+ ', IL amplitude/D without in-line VIV ', ax_cf/D
+ CALL require(ay > 0.3_wp*D, 'I5: the line locks in cross-flow')
+ CALL require(ABS(fx/fy - 2.0_wp) <= 0.15_wp, 'I5: the in-line response is at twice the cross-flow frequency')
+ CALL require(ax_il > 2.0_wp*ax_cf, 'I5: the in-line force raises the in-line response')
+ END BLOCK
+
+ ! ---- I6 snapshot replay and the recovering step ----
+ CALL CD_HermiteCable_Dyn_Snapshot(model, es, em)
+ CALL require(es == CD_HCDYN_OK, 'I6: snapshot: '//TRIM(em))
+ ALLOCATE (q_ref(SIZE(model%q), 100), phi_ref(NE + 1, 100), phx_ref(NE + 1, 100))
+ DO k = 1, 100
+ CALL advance(model, 1, .FALSE.)
+ q_ref(:, k) = model%q
+ phi_ref(:, k) = model%viv_phi
+ phx_ref(:, k) = model%vil_phi
+ END DO
+ CALL CD_HermiteCable_Dyn_Restore(model, es, em)
+ CALL require(es == CD_HCDYN_OK, 'I6: restore: '//TRIM(em))
+ DO k = 1, 100
+ CALL advance(model, 1, .FALSE.)
+ IF (ANY(model%q /= q_ref(:, k)) .OR. ANY(model%viv_phi /= phi_ref(:, k)) .OR. &
+ ANY(model%vil_phi /= phx_ref(:, k))) EXIT
+ END DO
+ CALL require(k > 100, 'I6: the restored snapshot replays the state and both phases bit for bit')
+ CALL CD_HermiteCable_Dyn_Restore(model, es, em)
+ DO k = 1, 100
+ CALL advance(model, 1, .TRUE.)
+ IF (ANY(model%q /= q_ref(:, k)) .OR. ANY(model%viv_phi /= phi_ref(:, k)) .OR. &
+ ANY(model%vil_phi /= phx_ref(:, k))) EXIT
+ END DO
+ CALL require(k > 100, 'I6: the recovering step equals the plain step')
+ CALL CD_HermiteCable_Dyn_End(model)
+
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: in-line VIV on the cubic-Hermite cable'
+
+CONTAINS
+
+ SUBROUTINE build(m)
+ !! The pinned taut line along x, pretensioned through its unstretched length, with the current
+ !! along y (drag) and the normal added mass.
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: m
+ REAL(wp) :: seed(6*(NE + 1)), l0(NE), eav(NE), eiv(NE), wv(NE), rhoa(NE), hd(NE), hn(NE), ht(NE)
+ INTEGER :: fixed(6), i
+ seed = 0.0_wp
+ DO i = 1, NE + 1
+ seed(6*(i - 1) + 1) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ seed(6*(i - 1) + 3) = -50.0_wp
+ seed(6*(i - 1) + 4) = 1.0_wp
+ END DO
+ l0 = SPAN/REAL(NE, wp)/(1.0_wp + TENS/EA)
+ eav = EA; eiv = EI; rhoa = MLIN
+ wv = (MLIN - RHOW*0.25_wp*PI*D**2)*GACC
+ fixed = [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3]
+ CALL CD_HermiteCable_Dyn_Init(m, l0, eav, eiv, rhoa, wv, seed, fixed, -200.0_wp, 0.0_wp, 0.5_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'init: '//TRIM(em))
+ hd = D; hn = 1.2_wp; ht = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_Drag(m, RHOW, hd, hn, ht, 0.0_wp, [0.0_wp, U, 0.0_wp], es, em)
+ CALL require(es == CD_HCDYN_OK, 'drag: '//TRIM(em))
+ hn = 1.0_wp
+ CALL CD_HermiteCable_Dyn_Set_AddedMass(m, RHOW, hd, hn, ht, 0.0_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'added mass: '//TRIM(em))
+ END SUBROUTINE build
+
+ SUBROUTINE twin_without_il(m)
+ !! The same line with the cross-flow VIV only.
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: m
+ CALL build(m)
+ CALL CD_HermiteCable_Dyn_Set_VIV(m, cl, cf, df, 0.25_wp, es, em)
+ CALL require(es == CD_HCDYN_OK, 'cross-flow VIV: '//TRIM(em))
+ END SUBROUTINE twin_without_il
+
+ SUBROUTINE advance(m, n, recovering)
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: m
+ INTEGER, INTENT(IN) :: n
+ LOGICAL, INTENT(IN) :: recovering
+ INTEGER :: s
+ DO s = 1, n
+ IF (recovering) THEN
+ CALL CD_HermiteCable_Dyn_Step_Recovering(m, DT, 50, 1.0e-8_wp, es, em)
+ ELSE
+ CALL CD_HermiteCable_Dyn_Step(m, DT, 50, 1.0e-8_wp, es, em)
+ END IF
+ IF (es /= CD_HCDYN_OK) THEN
+ CALL require(.FALSE., 'step: '//TRIM(em)); RETURN
+ END IF
+ END DO
+ END SUBROUTINE advance
+
+ SUBROUTINE run_response(m, fy, fx, ay, ax)
+ !! March 100 s and, over 50-100 s, the dominant frequencies of the mid-span cross-flow (z)
+ !! and quarter-span in-line (y) motions (the peak of a direct Fourier scan of the detrended
+ !! records) and the amplitudes, half the peak-to-peak excursions.
+ TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: m
+ REAL(wp), INTENT(OUT) :: fy, fx, ay, ax
+ INTEGER, PARAMETER :: NS = NINT(100.0_wp/DT), N0 = NINT(50.0_wp/DT)
+ REAL(wp) :: zrec(NS - N0), yrec(NS - N0)
+ INTEGER :: s
+ DO s = 1, NS
+ CALL advance(m, 1, .FALSE.)
+ IF (es /= CD_HCDYN_OK) EXIT
+ IF (s <= N0) CYCLE
+ zrec(s - N0) = m%q(mid + 3)
+ yrec(s - N0) = m%q(quarter + 2)
+ END DO
+ ay = 0.5_wp*(MAXVAL(zrec) - MINVAL(zrec))
+ ax = 0.5_wp*(MAXVAL(yrec) - MINVAL(yrec))
+ fy = peak_frequency(zrec)
+ fx = peak_frequency(yrec)
+ END SUBROUTINE run_response
+
+ REAL(wp) FUNCTION peak_frequency(x) RESULT(fpk)
+ !! The frequency of the largest Fourier amplitude of x - mean(x) on 0.05-2 Hz (0.002 Hz grid).
+ REAL(wp), INTENT(IN) :: x(:)
+ REAL(wp) :: xm(SIZE(x)), f, best, re, im, tt
+ INTEGER :: i, j
+ xm = x - SUM(x)/REAL(SIZE(x), wp)
+ best = -1.0_wp
+ fpk = 0.0_wp
+ DO j = 0, 975
+ f = 0.05_wp + 0.002_wp*REAL(j, wp)
+ re = 0.0_wp; im = 0.0_wp
+ DO i = 1, SIZE(x)
+ tt = REAL(i, wp)*DT
+ re = re + xm(i)*COS(2.0_wp*PI*f*tt)
+ im = im + xm(i)*SIN(2.0_wp*PI*f*tt)
+ END DO
+ IF (re*re + im*im > best) THEN
+ best = re*re + im*im
+ fpk = f
+ END IF
+ END DO
+ END FUNCTION peak_frequency
+
+ SUBROUTINE check_element()
+ !! I2: the element load at rest across the current, additivity, and the Jacobians against
+ !! central differences on a curved, moving element.
+ REAL(wp) :: qe(12), ve(12), fl(12), f_cf(12), f_il(12), djq(12, 12), djv(12, 12), fp(12), fm(12)
+ REAL(wp) :: fdq(12, 12), fdv(12, 12), kn(2), kx(2), le, h, uu(3)
+ INTEGER :: j
+ le = 5.0_wp
+ uu = [0.0_wp, U, 0.0_wp]
+ kn = [0.0_wp, 0.0_wp]
+ kx = [30.0_wp, 50.0_wp]
+ ! straight along x at rest, unit tangents
+ qe = 0.0_wp
+ qe(4) = 1.0_wp; qe(7) = le; qe(10) = 1.0_wp
+ ve = 0.0_wp
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, kn, fl, ErrStat=es, ErrMsg=em, kx_node=kx)
+ CALL require(es == CD_HCDYN_OK, 'I2: element: '//TRIM(em))
+ CALL require(ABS(fl(2) + fl(8) - U*U*le*0.5_wp*(kx(1) + kx(2))) <= 1.0e-12_wp*U*U*le*kx(2) .AND. &
+ ABS(fl(1) + fl(7)) + ABS(fl(3) + fl(9)) <= 1.0e-12_wp*U*U*le*kx(2), &
+ 'I2: a straight element at rest carries U^2 l0 (k_x1 + k_x2)/2 along the flow')
+ ! curved and moving, off the flow plane
+ qe = [0.1_wp, -0.2_wp, -10.0_wp, 0.9_wp, 0.3_wp, 0.2_wp, 4.8_wp, 0.4_wp, -9.6_wp, 1.0_wp, -0.2_wp, 0.15_wp]
+ ve = [0.02_wp, -0.05_wp, 0.08_wp, 0.01_wp, 0.02_wp, -0.03_wp, -0.04_wp, 0.06_wp, 0.03_wp, 0.0_wp, -0.01_wp, &
+ 0.02_wp]
+ uu = [0.05_wp, U, -0.02_wp]
+ kn = [20.0_wp, -15.0_wp]
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, kn, f_cf, ErrStat=es, ErrMsg=em)
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, [0.0_wp, 0.0_wp], f_il, ErrStat=es, ErrMsg=em, &
+ kx_node=kx)
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, kn, fl, djq, djv, es, em, kx_node=kx)
+ CALL require(MAXVAL(ABS(fl - f_cf - f_il)) <= 1.0e-12_wp*MAXVAL(ABS(fl)), &
+ 'I2: the in-line load adds to the cross-flow one')
+ h = 1.0e-6_wp
+ DO j = 1, 12
+ qe(j) = qe(j) + h
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, kn, fp, ErrStat=es, ErrMsg=em, kx_node=kx)
+ qe(j) = qe(j) - 2.0_wp*h
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, kn, fm, ErrStat=es, ErrMsg=em, kx_node=kx)
+ qe(j) = qe(j) + h
+ fdq(:, j) = (fp - fm)/(2.0_wp*h)
+ ve(j) = ve(j) + h
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, kn, fp, ErrStat=es, ErrMsg=em, kx_node=kx)
+ ve(j) = ve(j) - 2.0_wp*h
+ CALL CD_HermiteCable_VIV_Lift_Element(qe, ve, le, uu, 0.0_wp, kn, fm, ErrStat=es, ErrMsg=em, kx_node=kx)
+ ve(j) = ve(j) + h
+ fdv(:, j) = (fp - fm)/(2.0_wp*h)
+ END DO
+ WRITE (*, '(A,ES10.2,A,ES10.2)') ' I2: Jacobian errors, position ', MAXVAL(ABS(djq - fdq))/MAXVAL(ABS(fdq)), &
+ ', velocity ', MAXVAL(ABS(djv - fdv))/MAXVAL(ABS(fdv))
+ CALL require(MAXVAL(ABS(djq - fdq)) <= 1.0e-6_wp*MAXVAL(ABS(fdq)), 'I2: position Jacobian matches differences')
+ CALL require(MAXVAL(ABS(djv - fdv)) <= 1.0e-6_wp*MAXVAL(ABS(fdv)), 'I2: velocity Jacobian matches differences')
+ END SUBROUTINE check_element
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (.NOT. cond) THEN
+ WRITE (*, '(A,A)') 'MISMATCH: ', label
+ nfail = nfail + 1
+ END IF
+ END SUBROUTINE require
+
+END PROGRAM test_hermite_viv_inline
diff --git a/tests/test_hermite_wave_forcing.f90 b/tests/test_hermite_wave_forcing.f90
index 113b18cc..8144df58 100644
--- a/tests/test_hermite_wave_forcing.f90
+++ b/tests/test_hermite_wave_forcing.f90
@@ -18,7 +18,10 @@ PROGRAM test_hermite_wave_forcing
!! warmup), with bounded nonzero amplitude, every step converging, and the model clock
!! advancing by n dt,
!! D fail-closed: Set_Waves pre-init / without any hydro config / bad height/period/depth /
- !! mismatched drag-vs-added-mass waterlines; partial wave arguments to the drag element.
+ !! mismatched drag-vs-added-mass waterlines; partial wave arguments to the drag element;
+ !! E SURFACE BAND IN WAVES: a short vertical element moved through the instantaneous surface
+ !! in steps of D/2000: the FK load and the wave drag change by under 0.2 % of their largest
+ !! value per step (a point above the surface inside the band takes the field at the surface).
USE CableDyn_Precision, ONLY: wp
USE CableDyn_Hydro, ONLY: CD_Airy_Wave_Kinematics_Precomputed, CD_Solve_Dispersion_Wavenumber, CD_HYDRO_OK
USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
@@ -42,6 +45,7 @@ PROGRAM test_hermite_wave_forcing
CALL check_crest_wetting()
CALL check_wave_response()
CALL check_fail_closed()
+ CALL check_band_continuity()
IF (nfail > 0) THEN
WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
@@ -62,6 +66,40 @@ SUBROUTINE wave_omk(om, k)
CALL require(es == CD_HYDRO_OK, 'dispersion solve: '//TRIM(em))
END SUBROUTINE wave_omk
+ SUBROUTINE check_band_continuity()
+ !! E: the FK load and the wave drag of an element moved through the instantaneous surface.
+ REAL(wp) :: qe(12), ve(12), om, k, eta, uw(3), aw(3), f0(12), f1(12), d0(12), d1(12), fj(12, 12)
+ REAL(wp) :: dz, z0, jfk, jdr, mfk, mdr
+ INTEGER :: es, i
+ CHARACTER(300) :: em
+ CALL wave_omk(om, k)
+ CALL CD_Airy_Wave_Kinematics_Precomputed(0.0_wp, 0.0_wp, -1.0_wp, 0.9_wp, WVH, om, k, WVDEP, 0.0_wp, .TRUE., &
+ eta, uw, aw, es, em)
+ ve = 0.0_wp
+ dz = DIAM/2000.0_wp
+ jfk = 0.0_wp; jdr = 0.0_wp; mfk = 0.0_wp; mdr = 0.0_wp
+ DO i = 0, 16000
+ ! a straight vertical element of length 0.2 m, its foot at z0 (from eta - 0.3 to eta + 0.1)
+ z0 = eta - 0.3_wp + REAL(i, wp)*dz ! 16000 steps of D/2000 = 0.4 m
+ qe = [0.0_wp, 0.0_wp, z0, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, z0 + 0.2_wp, 0.0_wp, 0.0_wp, 1.0_wp]
+ CALL CD_HermiteCable_FK_Element(qe, 0.2_wp, 0.0_wp, RHOW, DIAM, CAN, CAT, WVH, om, k, WVDEP, 0.0_wp, 0.9_wp, &
+ f1, fj, es, em)
+ CALL CD_HermiteCable_Drag_Element(qe, ve, 0.2_wp, [0.0_wp, 0.0_wp, 0.0_wp], 0.0_wp, RHOW, DIAM, CDN, CDT, d1, &
+ ErrStat=es, ErrMsg=em, wv_h=WVH, wv_om=om, wv_k=k, wv_depth=WVDEP, &
+ wv_dir=0.0_wp, wv_t=0.9_wp)
+ IF (i > 0) THEN
+ jfk = MAX(jfk, nan_max_abs(f1 - f0))
+ jdr = MAX(jdr, nan_max_abs(d1 - d0))
+ END IF
+ mfk = MAX(mfk, nan_max_abs(f1)); mdr = MAX(mdr, nan_max_abs(d1))
+ f0 = f1; d0 = d1
+ END DO
+ WRITE (*, '(A,2ES10.3)') ' [surface band, waves] largest change per step / largest load, FK and drag: ', &
+ jfk/mfk, jdr/mdr
+ CALL require(mfk > 0.0_wp .AND. jfk < 2.0e-3_wp*mfk, 'E: the FK load is continuous through the wave surface')
+ CALL require(mdr > 0.0_wp .AND. jdr < 2.0e-3_wp*mdr, 'E: the wave drag is continuous through the wave surface')
+ END SUBROUTINE check_band_continuity
+
SUBROUTINE check_fk_element_quadrature()
!! FK element vs an independent 400-point trapezoid integral of the analytic per-length FK force
!! along a straight submerged element (deformed length = reference here).
diff --git a/tests/test_hfmf_mirror.f90 b/tests/test_hfmf_mirror.f90
index b6c67360..472b8d54 100644
--- a/tests/test_hfmf_mirror.f90
+++ b/tests/test_hfmf_mirror.f90
@@ -18,13 +18,21 @@ PROGRAM test_hfmf_mirror
!! identically built cable, re-pack -- bit-identical buffers, and the line clock
!! carries the restart time;
!! 4) wrong-sized / non-finite buffers, a non-orthogonal parent orientation and a
- !! non-finite time fail closed.
+ !! 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;
+ !! 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, &
CD_HFMF_UnpackMirror, CD_HFMF_FrictionMirrorSize, CD_HFMF_ForceMirrorSize, &
- CD_HFMF_BoundaryMirrorSize, &
+ 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
@@ -106,6 +114,85 @@ PROGRAM test_hfmf_mirror
CALL CD_HFMF_UnpackMirror(twin, buf, IEEE_VALUE(1.0_wp, IEEE_QUIET_NAN), es, em)
CALL require(es == CD_HFMF_BADINPUT, 'non-finite restart time fails closed')
+ ! (5) the in-line VIV block
+ BLOCK
+ REAL(wp), ALLOCATABLE :: cl(:), cf(:), df(:), clx(:), al(:), vb(:), vb2(:)
+ INTEGER :: ne, nn, kv
+ buf(1) = 0.0_wp
+ ne = cable%line%ne
+ nn = cable%line%nn
+ ALLOCATE (cl(ne), cf(ne), df(ne), clx(ne), al(ne))
+ cl = 0.8_wp; cf = 0.18_wp; df = 0.08_wp; clx = 0.85_wp; al = 0.15_wp
+ CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, cl, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=al)
+ CALL require(es == CD_HCDYN_OK, 'in-line VIV on the cable: '//TRIM(em))
+ CALL CD_HermiteCable_Dyn_Set_VIV(twin%line, cl, cf, df, 0.25_wp, es, em, clx=clx, il_alpha=al)
+ CALL require(es == CD_HCDYN_OK, 'in-line VIV on the twin: '//TRIM(em))
+ CALL require(CD_HFMF_VIVMirrorSize(cable) == 8*nn + 1, 'VIV block with in-line VIV: 8 nn + 1 values')
+ 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 in-line VIV: '//TRIM(em))
+ ! the in-line block: phase then mean squares, just before the (absent) torsion block
+ kv = SIZE(vb) - CD_HFMF_TorsionMirrorSize(cable) - 3*nn
+ CALL require(nan_max_abs(vb(kv + 1:kv + nn) - cable%line%vil_phi) <= 0.0_wp, &
+ 'the in-line phase follows the cross-flow block')
+ DO i = 1, 3*nn
+ vb(kv + i) = vb(kv + i) + 1.0e-3_wp*REAL(i, wp)
+ END DO
+ 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 in-line VIV: '//TRIM(em))
+ CALL require(nan_max_abs(twin%line%vil_phi - vb(kv + 1:kv + nn)) <= 0.0_wp .AND. &
+ nan_max_abs(twin%line%vil_phi_eval - twin%line%vil_phi) <= 0.0_wp .AND. &
+ nan_max_abs(twin%line%ws_recovery_vil_ms - twin%line%vil_ms) <= 0.0_wp, &
+ 'the in-line phase and its step copies reload')
+ CALL CD_HFMF_PackMirror(twin, vb2, es, em)
+ CALL require(nan_max_abs(vb2 - vb) <= 0.0_wp, 'the in-line VIV block round-trips bit-identically')
+ vb(kv + nn + 1) = -1.0_wp
+ CALL CD_HFMF_UnpackMirror(twin, vb, 3.0_wp, es, em)
+ CALL require(es == CD_HFMF_BADINPUT .AND. INDEX(em, 'in-line') > 0, &
+ '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_load_power_deck.f90 b/tests/test_load_power_deck.f90
new file mode 100644
index 00000000..bd2ff570
--- /dev/null
+++ b/tests/test_load_power_deck.f90
@@ -0,0 +1,330 @@
+! File: tests/test_load_power_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_load_power_deck
+ !! The load power channels VIVPow, DragPow and DampPow ( the line total in W, N per unit
+ !! length about node J in W/m) on the in-line VIV deck of tests/test_viv_inline_deck.f90: a taut
+ !! line, 100 m pinned at 50 m depth in a uniform 0.15 m/s current along y, Cl 0.8, ClX 0.85.
+ !! Locked in, the energy the line holds only oscillates, so over 50-100 s
+ !! mean(VIVPow + DragPow + DampPow) = 0
+ !! to the window's change of energy.
+ !! P1 the finite-EI cable: the VIV loads put power in, the drag takes it out, the damping power
+ !! is never positive, and the three balance within 1 % of the VIV power;
+ !! P2 the per-length channels of all 51 nodes, times their half-element lengths, sum to the
+ !! line total;
+ !! P3 the same line as an EI = 0 line (the single-line march) balances within 1 % and puts in
+ !! the cable's VIV power within 2 %;
+ !! P4 the EI = 0 line split at a free point into two lines (the multi-line system) balances
+ !! within 1 % over both lines;
+ !! P5 malformed channels, an unknown line, node 0 and a node past the end are refused;
+ !! P6 a row evaluates a line's node powers once for all its load power channels: a channel
+ !! read alone (DampPow1 of the cable, DragPow1 of the EI = 0 line, DampPow2 of the system)
+ !! takes the same values, to the printed digits, as among the line's other power channels
+ !! (P1, P3, P4), and they change from row to row.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ INTEGER, PARAMETER :: NSEG = 50
+ REAL(wp), PARAMETER :: LEN0 = 99.9001_wp
+ INTEGER :: nfail = 0
+
+ CALL write_current('lpd_current.dat')
+ CALL check_cable()
+ CALL check_ei0()
+ CALL check_system()
+ CALL check_refusals()
+ CALL check_shared('P6 finite-EI cable', 'lpd_cab', '1.0', 'DampPow1', .FALSE., 4, 4)
+ CALL check_shared('P6 EI = 0 line', 'lpd_ei0', '0.0', 'DragPow1', .FALSE., 3, 3)
+ CALL check_shared('P6 system', 'lpd_sys', '0.0', 'DampPow2', .TRUE., 6, 7)
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: load power channel gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the load power deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_deck(path, ei, channels, split, tmax)
+ !! channels: the OUTPUTS rows, ';'-separated; split: the EI = 0 line as two lines joined at
+ !! a free point at mid-span.
+ CHARACTER(*), INTENT(IN) :: path, ei, channels
+ LOGICAL, INTENT(IN) :: split
+ REAL(wp), INTENT(IN) :: tmax
+ INTEGER :: u, i0, i1
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'load power deck gate: taut line with in-line VIV in a uniform current'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ WRITE (u, '(A)') 'TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx Cl dF cF'
+ WRITE (u, '(A)') '(name) (m) (kg/m) (N) (N-s/-) (-) (-) (-) (-) (-) (-) (-) (-)'
+ WRITE (u, '(A)') 'riser 0.10 10.0 5.0e7 -0.8 '//ei//' 1.2 1.0 0.0 0.0 0.8 0.08 0.18'
+ WRITE (u, '(A)') '----------------------- POINTS ----------------------------------------------'
+ WRITE (u, '(A)') 'ID Attachment X Y Z M V CdA CA'
+ WRITE (u, '(A)') '(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)'
+ WRITE (u, '(A)') '1 Coupled 0.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ IF (split) WRITE (u, '(A)') '3 Free 50.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID LineType AttachA AttachB UnstrLen NumSegs Outputs'
+ WRITE (u, '(A)') '(#) (name) (#) (#) (m) (-) (-)'
+ IF (split) THEN
+ WRITE (u, '(A)') '1 riser 1 3 49.95005 25 -'
+ WRITE (u, '(A)') '2 riser 3 2 49.95005 25 -'
+ ELSE
+ WRITE (u, '(A)') '1 riser 1 2 99.900100 50 -'
+ END IF
+ WRITE (u, '(A)') '----------------------- VIV -------------------------------------------------'
+ WRITE (u, '(A)') 'TypeName ClX alpha'
+ WRITE (u, '(A)') '(name) (-) (-)'
+ WRITE (u, '(A)') 'riser 0.85 0.15'
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '0.01 dtM'
+ WRITE (u, '(A)') '100.0 WtrDpth'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') 'lpd_current.dat WaterKin'
+ WRITE (u, '(A)') '0.25 VIVrmsWindow'
+ WRITE (u, '(A,F8.3,A)') ' ', tmax, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ i0 = 1
+ DO
+ i1 = INDEX(channels(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(channels(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') channels(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, ncol, tab, n)
+ !! The rows of a deck's main output file (time and ncol channels) from 50 s on.
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER, INTENT(IN) :: ncol
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(8192) :: rec
+ REAL(wp) :: row(ncol + 1)
+ INTEGER :: u, ios
+ ALLOCATE (tab(ncol + 1, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ READ (rec, *) row
+ IF (row(1) < 50.0_wp - 1.0e-9_wp) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ tab(:, n) = row
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ SUBROUTINE balance(label, tab, n, lines, p_viv)
+ !! The mean of the three powers over the window (columns 2-4 of a line, lines in a row) and
+ !! the balance check; p_viv returns the mean VIV power.
+ CHARACTER(*), INTENT(IN) :: label
+ REAL(wp), INTENT(IN) :: tab(:, :)
+ INTEGER, INTENT(IN) :: n, lines
+ REAL(wp), INTENT(OUT) :: p_viv
+ REAL(wp) :: m(3)
+ INTEGER :: k, j
+ m = 0.0_wp
+ DO j = 1, lines
+ DO k = 1, 3
+ m(k) = m(k) + SUM(tab(1 + 3*(j - 1) + k, 1:n))/REAL(n, wp)
+ END DO
+ END DO
+ p_viv = m(1)
+ WRITE (*, '(2A,3F10.4,A,ES10.2)') label, ': mean VIVPow, DragPow, DampPow [W] ', m, &
+ ', balance/VIV ', SUM(m)/m(1)
+ CALL require(m(1) > 0.0_wp .AND. m(2) < 0.0_wp, label//': the VIV loads put power in, the drag takes it out')
+ CALL require(ABS(SUM(m)) <= 0.01_wp*m(1), label//': the powers balance within 1 % of the VIV power')
+ DO j = 1, lines
+ CALL require(ALL(tab(1 + 3*j, 1:n) <= 0.0_wp), label//': the damping power is never positive')
+ END DO
+ END SUBROUTINE balance
+
+ SUBROUTINE check_cable()
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ REAL(wp) :: pv, trib, s, sabs
+ INTEGER :: n, j, k
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CHARACTER(4096) :: chans
+ CALL write_deck('lpd_cab.dat', '1.0', 'VIVPow1;DragPow1;DampPow1;DampPow1N26', .FALSE., 100.0_wp)
+ CALL run('lpd_cab.dat', 'lpd_cab', ok, msg)
+ CALL require(ok, 'P1: the finite-EI deck runs: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('lpd_cab.out', 4, tab, n)
+ CALL require(n > 1000, 'P1: the run wrote its rows')
+ IF (n <= 1000) RETURN
+ CALL balance('P1 finite-EI cable', tab, n, 1, pv)
+ CALL require(ALL(tab(5, 1:n) <= 0.0_wp), 'P1: the damping power per length is never positive')
+ ! P2: every node's power per length, times its half elements, sums to the line total
+ chans = 'VIVPow1'
+ DO j = 1, NSEG + 1
+ chans = TRIM(chans)//';VIVPow1N'//TRIM(int_text(j))
+ END DO
+ CALL write_deck('lpd_nodes.dat', '1.0', TRIM(chans), .FALSE., 52.0_wp)
+ CALL run('lpd_nodes.dat', 'lpd_nodes', ok, msg)
+ CALL require(ok, 'P2: the all-node deck runs: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('lpd_nodes.out', NSEG + 2, tab, n)
+ CALL require(n > 100, 'P2: the run wrote its rows')
+ IF (n <= 100) RETURN
+ DO k = 1, n
+ s = 0.0_wp
+ sabs = 0.0_wp
+ DO j = 1, NSEG + 1
+ trib = LEN0/REAL(NSEG, wp)
+ IF (j == 1 .OR. j == NSEG + 1) trib = 0.5_wp*trib
+ s = s + tab(2 + j, k)*trib
+ sabs = sabs + ABS(tab(2 + j, k))*trib
+ END DO
+ IF (ABS(s - tab(2, k)) > 1.0e-5_wp*MAX(sabs, 1.0e-12_wp)) THEN
+ CALL require(.FALSE., 'P2: the per-length powers sum to the line total')
+ EXIT
+ END IF
+ END DO
+ END SUBROUTINE check_cable
+
+ SUBROUTINE check_ei0()
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ REAL(wp) :: pv0, pvf
+ INTEGER :: n
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('lpd_ei0.dat', '0.0', 'VIVPow1;DragPow1;DampPow1', .FALSE., 100.0_wp)
+ CALL run('lpd_ei0.dat', 'lpd_ei0', ok, msg)
+ CALL require(ok, 'P3: the EI = 0 deck runs: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('lpd_ei0.out', 3, tab, n)
+ CALL require(n > 1000, 'P3: the run wrote its rows')
+ IF (n <= 1000) RETURN
+ CALL balance('P3 EI = 0 line', tab, n, 1, pv0)
+ CALL read_out('lpd_cab.out', 4, tab, n)
+ IF (n <= 1000) RETURN
+ pvf = SUM(tab(2, 1:n))/REAL(n, wp)
+ CALL require(ABS(pv0/pvf - 1.0_wp) <= 0.02_wp, 'P3: the EI = 0 line takes the cable''s VIV power within 2 %')
+ END SUBROUTINE check_ei0
+
+ SUBROUTINE check_system()
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ REAL(wp) :: pv
+ INTEGER :: n
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('lpd_sys.dat', '0.0', 'VIVPow1;DragPow1;DampPow1;VIVPow2;DragPow2;DampPow2', .TRUE., 100.0_wp)
+ CALL run('lpd_sys.dat', 'lpd_sys', ok, msg)
+ CALL require(ok, 'P4: the two-line deck runs: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('lpd_sys.out', 6, tab, n)
+ CALL require(n > 1000, 'P4: the run wrote its rows')
+ IF (n <= 1000) RETURN
+ CALL balance('P4 two EI = 0 lines and a free point', tab, n, 2, pv)
+ END SUBROUTINE check_system
+
+ SUBROUTINE check_shared(label, root, ei, channel, split, ncol, col)
+ !! Channel `channel` read alone against column `col` of the earlier run `root` (ncol channels),
+ !! which evaluated it among the line's other load power channels, over the rows from 50 s.
+ CHARACTER(*), INTENT(IN) :: label, root, ei, channel
+ LOGICAL, INTENT(IN) :: split
+ INTEGER, INTENT(IN) :: ncol, col
+ REAL(wp), ALLOCATABLE :: tab(:, :), one(:, :)
+ INTEGER :: n, n1
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('lpd_one.dat', ei, channel, split, 52.0_wp)
+ CALL run('lpd_one.dat', 'lpd_one', ok, msg)
+ CALL require(ok, label//': the one-channel deck runs: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('lpd_one.out', 1, one, n1)
+ CALL read_out(root//'.out', ncol, tab, n)
+ CALL require(n1 > 100 .AND. n >= n1, label//': the runs wrote their rows')
+ IF (.NOT. (n1 > 100 .AND. n >= n1)) RETURN
+ CALL require(ALL(one(1, 1:n1) == tab(1, 1:n1)) .AND. ALL(one(2, 1:n1) == tab(col, 1:n1)), &
+ label//': the channel alone equals the channel among the line''s power channels')
+ CALL require(ANY(one(2, 2:n1) /= one(2, 1)), label//': the channel changes from row to row')
+ END SUBROUTINE check_shared
+
+ SUBROUTINE check_refusals()
+ CALL refused('VIVPow0', 'bad load power channel', 'line 0')
+ CALL refused('DragPow7', 'bad load power channel', 'an unknown line')
+ CALL refused('DampPowx', 'bad load power channel', 'a channel without a line id')
+ CALL refused('VIVPow1N0', 'node numbers start at 1', 'node 0')
+ CALL refused('DragPow1N52', 'exceeds line node count', 'a node past End B')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE refused(channel, needle, what)
+ CHARACTER(*), INTENT(IN) :: channel, needle, what
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('lpd_bad.dat', '1.0', channel, .FALSE., 1.0_wp)
+ CALL run('lpd_bad.dat', 'lpd_bad', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, needle) > 0, 'P5: '//what//' is refused: '//TRIM(msg))
+ END SUBROUTINE refused
+
+ FUNCTION int_text(i) RESULT(s)
+ INTEGER, INTENT(IN) :: i
+ CHARACTER(:), ALLOCATABLE :: s
+ CHARACTER(16) :: b
+ WRITE (b, '(I0)') i
+ s = TRIM(b)
+ END FUNCTION int_text
+
+END PROGRAM test_load_power_deck
diff --git a/tests/test_model.f90 b/tests/test_model.f90
index a16f32e5..c1daee6a 100644
--- a/tests/test_model.f90
+++ b/tests/test_model.f90
@@ -9,6 +9,7 @@ PROGRAM test_model
!! at rest, prescribed fairlead motion advances through the model boundary, and
!! End releases the model cleanly.
USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_VIV, ONLY: CD_VIV_AMP_MAXP
USE CableDyn_Bathymetry, ONLY: CD_BathymetryType, CD_Init_Bathymetry, CD_End_Bathymetry, CD_BATHY_OK
USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_EI0_SUBSTEPS_OFF
USE CableDyn_SeabedContact, ONLY: CD_SEABED_CONTACT_BLEND
@@ -53,7 +54,8 @@ PROGRAM test_model
CALL case_resolved_substeps()
CALL case_substep_paths()
CALL case_substep_snap_only()
- CALL case_substeps_restore_viv_state()
+ CALL case_substeps_restore_viv_state(.FALSE.)
+ CALL case_substeps_restore_viv_state(.TRUE.)
CALL case_coupled_load_sign()
CALL case_coupled_motion_update()
CALL case_external_load_update()
@@ -1721,7 +1723,7 @@ SUBROUTINE case_damping_model_load()
CALL require(es == CD_MODEL_OK, 'damping:end')
END SUBROUTINE case_damping_model_load
- SUBROUTINE case_substeps_restore_viv_state()
+ SUBROUTINE case_substeps_restore_viv_state(inline)
!! The rotation-resolved sub-stepping of a line carrying VIV: a 10 m taut line in a 0.5 m/s
!! cross current with Cl 0.8 on every element, End B heaved by 1 m over 2 s so that its
!! chords turn by more than a degree per 0.02 s step. Solving the first sub-stepped pass
@@ -1729,14 +1731,19 @@ SUBROUTINE case_substeps_restore_viv_state()
!! nothing bit for bit, the shedding phases and running mean squares included; a failing
!! sub-step (TEST-ONLY sub_test_fail) returns the plain step, and the run then equals the
!! run with ei0_substeps off bit for bit. Without the VIV state in the sub-step slots the
- !! sub-steps advanced the phase again from the plain step's phase.
+ !! sub-steps advanced the phase again from the plain step's phase. inline adds in-line VIV
+ !! (clx 0.85): its phase and mean squares follow the same rules, and a model copy carries them.
+ LOGICAL, INTENT(IN) :: inline
INTEGER, PARAMETER :: NE = 10, NN = NE + 1, NSTEP = 60
REAL(wp), PARAMETER :: DT = 0.02_wp, AMP = 1.0_wp, PER = 2.0_wp
TYPE(CD_ModelType) :: auto_m, rep_m, fb_m, off_m
TYPE(GenAlphaConfig) :: cfg
INTEGER :: conn(2, NE), fixed(6), es, k, n_iter
REAL(wp) :: q0(3*NN), v0(3*NN), f_ext(3*NN), pq(3*NN), pv(3*NN), pa(3*NN), fluid(3, NN), wl(NN)
- REAL(wp) :: l0(NE), ea(NE), rho_a(NE), cl(NE), dia(NE), cf(NE), df(NE), phi0(NN), w, t
+ REAL(wp) :: l0(NE), ea(NE), rho_a(NE), cl(NE), dia(NE), cf(NE), df(NE), phi0(NN), w, t, phx0(NN)
+ REAL(wp) :: tab(3, CD_VIV_AMP_MAXP, NE)
+ INTEGER :: tab_n(NE)
+ INTEGER(KIND(auto_m%sub_stats%events)) :: ev0
LOGICAL :: conv, stalled, all_conv
CHARACTER(200) :: em
@@ -1766,10 +1773,17 @@ SUBROUTINE case_substeps_restore_viv_state()
drag_diameter=0.1_wp, drag_cdn=1.2_wp, drag_cdt=0.0_wp)
CALL require(es == CD_MODEL_OK, 'substep-viv:init: '//TRIM(em))
IF (es /= CD_MODEL_OK) RETURN
- CALL CD_Set_Model_VIV(auto_m, 1025.0_wp, cl, dia, cf, df, 0.25_wp, es, em)
+ IF (inline) THEN
+ CALL CD_Set_Model_VIV(auto_m, 1025.0_wp, cl, dia, cf, df, 0.25_wp, es, em, clx=0.85_wp + 0.0_wp*cl, &
+ il_alpha=0.15_wp + 0.0_wp*cl)
+ ELSE
+ CALL CD_Set_Model_VIV(auto_m, 1025.0_wp, cl, dia, cf, df, 0.25_wp, es, em)
+ END IF
CALL require(es == CD_MODEL_OK, 'substep-viv:viv: '//TRIM(em))
IF (es /= CD_MODEL_OK) RETURN
+ CALL require(auto_m%has_viv_il .EQV. inline, 'substep-viv:in-line installed as asked')
phi0 = auto_m%viv_phi
+ IF (inline) phx0 = auto_m%vil_phi
CALL CD_Copy_Model(auto_m, rep_m, es, em)
rep_m%sub_test_repeat = .TRUE.
CALL CD_Copy_Model(auto_m, fb_m, es, em)
@@ -1807,6 +1821,45 @@ SUBROUTINE case_substeps_restore_viv_state()
CALL require(fb_m%sub_stats%fallbacks > 0 .AND. ALL(fb_m%q == off_m%q) .AND. ALL(fb_m%v == off_m%v) .AND. &
ALL(fb_m%a == off_m%a) .AND. ALL(fb_m%viv_phi == off_m%viv_phi) .AND. &
ALL(fb_m%viv_ms == off_m%viv_ms), 'substep-viv:fallback-is-the-plain-step')
+ IF (inline) THEN
+ CALL require(rep_m%has_viv_il .AND. fb_m%has_viv_il .AND. off_m%has_viv_il, 'substep-viv:copies-carry-in-line')
+ CALL require(ANY(auto_m%vil_phi /= phx0) .AND. ANY(auto_m%vil_ms /= 0.0_wp), 'substep-viv:in-line-states-move')
+ CALL require(ALL(rep_m%vil_phi == auto_m%vil_phi) .AND. ALL(rep_m%vil_ms == auto_m%vil_ms), &
+ 'substep-viv:in-line-restore-is-complete')
+ CALL require(ALL(fb_m%vil_phi == off_m%vil_phi) .AND. ALL(fb_m%vil_ms == off_m%vil_ms), &
+ 'substep-viv:in-line-fallback-is-the-plain-step')
+ END IF
+ IF (.NOT. inline) THEN
+ ! amplitude tables set after the line has stepped grow its VIV motion statistics from 2 to 6
+ ! rows per node at the same node count: the sub-step slots follow on the next sub-stepped steps
+ ! (100 more steps, to t = 3.2 s: the heave repeats the turning of the first 1.2 s)
+ tab = 0.0_wp
+ tab_n = 2
+ DO k = 1, NE
+ tab(:, 1, k) = [0.0_wp, 0.8_wp, 1.0_wp]
+ tab(:, 2, k) = [0.5_wp, 0.4_wp, 1.5_wp]
+ END DO
+ ev0 = auto_m%sub_stats%events
+ CALL CD_Set_Model_VIV(auto_m, 1025.0_wp, cl, dia, cf, df, 0.25_wp, es, em, amp=tab, amp_n=tab_n)
+ CALL require(es == CD_MODEL_OK, 'substep-viv:tables-after-stepping: '//TRIM(em))
+ all_conv = es == CD_MODEL_OK
+ DO k = NSTEP + 1, NSTEP + 100
+ t = REAL(k, wp)*DT
+ pq = q0
+ pv = 0.0_wp
+ pa = 0.0_wp
+ pq(3*NN) = q0(3*NN) + AMP*(1.0_wp - COS(w*t))
+ pv(3*NN) = AMP*w*SIN(w*t)
+ pa(3*NN) = AMP*w*w*COS(w*t)
+ CALL CD_Step_Model(auto_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa)
+ all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv
+ END DO
+ WRITE (*, '(A,I0,A,L1)') ' sub-stepped steps with tables: ', auto_m%sub_stats%events - ev0, &
+ ', converged ', all_conv
+ CALL require(all_conv .AND. auto_m%sub_stats%events > ev0, 'substep-viv:tables-after-stepping-sub-steps')
+ CALL require(SIZE(auto_m%sub_slot(1)%viv_ms, 1) == 7 .AND. SIZE(auto_m%sub_slot(2)%viv_ms, 1) == 7, &
+ 'substep-viv:slots-follow-the-statistics-rows')
+ END IF
CALL CD_End_Model(auto_m, es, em)
CALL CD_End_Model(rep_m, es, em)
CALL CD_End_Model(fb_m, es, em)
diff --git a/tests/test_nodal_twist_dynamic.f90 b/tests/test_nodal_twist_dynamic.f90
index 0a6bcf08..c447791e 100644
--- a/tests/test_nodal_twist_dynamic.f90
+++ b/tests/test_nodal_twist_dynamic.f90
@@ -28,7 +28,12 @@ PROGRAM test_nodal_twist_dynamic
!! carries at most 4e-6 of the peak kinetic energy with an extreme Irn = 1 kg m (6e-8 at
!! 0.02 kg m), below the step's own energy band;
!! R restart: a rolling, torsionally damped run restored from a snapshot, and one rebuilt
- !! from the checkpoint mirror, continue bit-identically.
+ !! from the checkpoint mirror, continue bit-identically;
+ !! F a coupled write that folds the end element (the coupled end, elastic in torsion and
+ !! pinned in bending, translated past its neighbour with its tangent unchanged) is refused
+ !! before anything is written, after a march and after a frame-only transfer (whose
+ !! re-basing keeps the elements at the committed shape); a length change drops the
+ !! configuration the shortcut of the re-basing keeps elements at, and the next step records it.
USE CableDyn_Precision, ONLY: wp
USE CableDyn_EndConnection, ONLY: CD_ENDCONN_RIGID
USE CableDyn_HermiteTorsion, ONLY: CD_HermiteTorsionType, CD_HermiteTorsion_Line, CD_HermiteTorsion_Unwrap, &
@@ -37,11 +42,13 @@ PROGRAM test_nodal_twist_dynamic
CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Energy, &
CD_HermiteCable_Dyn_End, CD_HermiteCable_Dyn_Set_EndConnection, &
CD_HermiteCable_Dyn_Set_Torsion, CD_HermiteCable_Dyn_Torsion_State, &
- CD_HermiteCable_Dyn_Node_Torque, CD_HCDYN_OK
+ CD_HermiteCable_Dyn_Node_Torque, CD_HermiteCable_Dyn_Set_SegmentLength, &
+ CD_HCDYN_OK
USE CableDyn_OpenFAST_HermiteFMF, ONLY: CD_HFMF_ModuleType, CD_HFMF_Init, CD_HFMF_Set_EndConnection, &
CD_HFMF_Set_Torsion, CD_HFMF_UpdateStates, CD_HFMF_CalcOutput, &
CD_HFMF_Snapshot, CD_HFMF_Restore, CD_HFMF_MirrorSize, &
- CD_HFMF_PackMirror, CD_HFMF_UnpackMirror, CD_HFMF_End, CD_HFMF_OK
+ CD_HFMF_PackMirror, CD_HFMF_UnpackMirror, CD_HFMF_End, CD_HFMF_OK, &
+ CD_HFMF_SetCoupledKinematics
IMPLICIT NONE
REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
@@ -61,6 +68,7 @@ PROGRAM test_nodal_twist_dynamic
CALL check_frame_energy()
CALL check_pinned_energy()
CALL check_restart()
+ CALL check_fold_refused()
IF (nfail > 0) THEN
WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
@@ -266,6 +274,58 @@ SUBROUTINE check_quasi_static(label, pinned, compliance)
CALL CD_HFMF_End(cn)
END SUBROUTINE check_quasi_static
+ ! ------------------------------------------------------------------------------------------
+ SUBROUTINE check_fold_refused()
+ !! F: march a bending-pinned line, elastic in torsion, then write the coupled end 0.8 m back
+ !! along the line, past its neighbour 0.5 m away, with the end tangent unchanged: the end
+ !! element folds, and the write is refused with the state untouched. The same after a
+ !! frame-only transfer of the march's last pose.
+ TYPE(CD_HFMF_ModuleType), ALLOCATABLE :: cab
+ REAL(wp) :: q(NDOF), x(3), v(3), a(3), dcm(3, 3), w(3), al(3), phi
+ REAL(wp), ALLOCATABLE :: q0(:), u0(:, :), b0(:)
+ INTEGER :: es, pass
+ LOGICAL :: ok
+ CHARACTER(300) :: em
+ ALLOCATE (cab)
+ CALL line_seed(0.0_wp, 0.0_wp, q)
+ CALL build_cable(cab, q, 1.0_wp, 0.01_wp, 1.0e-10_wp, 0.8_wp, .TRUE., 1.0e-9_wp, 0.05_wp)
+ CALL require(cab%line%tw_active, 'F: the nodal twist is active')
+ CALL march(cab, 0, 20, ok)
+ CALL require(ok, 'F: the march steps')
+ IF (.NOT. ok) RETURN
+ DO pass = 1, 2
+ CALL drive(20, x, v, a, dcm, w, al, phi)
+ IF (pass == 2) THEN
+ ! a frame-only transfer of the committed pose first: it re-bases the reference
+ x = cab%line%q(NDOF - 5:NDOF - 3)
+ CALL CD_HFMF_SetCoupledKinematics(cab, x, v, a, es, em, u_orientation=dcm, &
+ u_angular_velocity=w, u_angular_acceleration=al)
+ CALL require(es == CD_HFMF_OK, 'F: a frame-only transfer of the committed pose: '//TRIM(em))
+ END IF
+ q0 = cab%line%q
+ u0 = cab%line%tw_u
+ b0 = cab%line%tw_beta
+ ! (the coupled node's committed position, node NN; the cable frame is the global one)
+ x = cab%line%q(NDOF - 5:NDOF - 3) - [0.8_wp, 0.0_wp, 0.0_wp]
+ CALL CD_HFMF_SetCoupledKinematics(cab, x, v, a, es, em, u_orientation=dcm, u_angular_velocity=w, &
+ u_angular_acceleration=al)
+ WRITE (*, '(A,I0,A)') 'F fold through the coupled end (pass ', pass, '): '//TRIM(em)
+ CALL require(es /= CD_HFMF_OK, 'F: a write that folds the end element is refused')
+ CALL require(nan_max_abs(cab%line%q - q0) <= 0.0_wp .AND. nan_max_abs(cab%line%tw_beta - b0) <= 0.0_wp &
+ .AND. nan_max_abs(RESHAPE(cab%line%tw_u - u0, [3*NN])) <= 0.0_wp, &
+ 'F: the refused write leaves the line and its twist reference unchanged')
+ END DO
+ ! a length change: the element shapes are no longer those the checks passed at, so the
+ ! recorded configuration is dropped (every element is evaluated) until the next step
+ CALL require(cab%line%tw_rq_ok, 'F: a committed step records its configuration')
+ CALL CD_HermiteCable_Dyn_Set_SegmentLength(cab%line, [NE/2], [0.55_wp], [0.0_wp], es, em)
+ CALL require(es == CD_HCDYN_OK .AND. .NOT. cab%line%tw_rq_ok, &
+ 'F: a length change drops the recorded configuration: '//TRIM(em))
+ CALL march(cab, 20, 21, ok)
+ CALL require(ok .AND. cab%line%tw_rq_ok, 'F: the next step records it again')
+ CALL CD_HFMF_End(cab)
+ END SUBROUTINE check_fold_refused
+
! ------------------------------------------------------------------------------------------
SUBROUTINE check_waves()
!! W: a roll A sin(Omega t) of the coupled end (amplitude ramped in over the first eight
diff --git a/tests/test_static_dry_weight.f90 b/tests/test_static_dry_weight.f90
index 178e9c99..445a0081 100644
--- a/tests/test_static_dry_weight.f90
+++ b/tests/test_static_dry_weight.f90
@@ -51,12 +51,14 @@ PROGRAM test_static_dry_weight
!! march to 1e-4 m (measured 0); with the buoyancy kept above the surface (dev before the
!! dry-weight fix) they moved by 5.5e-3 m.
!! 9. A net-buoyant module (200 kg, 2 m^3) 50 m along a slack finite-EI cable from 20 m below
- !! the surface: in water it lifts its node 4.5 m above the surface, where the dynamics gives
- !! it its weight alone, which sinks it: a point attachment has no static position there.
- !! The static start fails closed and its message names the attachment that crossed the
- !! still-water level. Before, the solves carried the module above and below the surface in
- !! turn until a load step failed, and the message read as a homotopy that stopped (dev
- !! started the module 4.5 m above the surface with its buoyancy and ran).
+ !! the surface: in water it would lift its node 4.5 m above the surface, so it floats. Its
+ !! buoyancy fades over the sphere of its volume (r 0.78 m), and the static start finds it
+ !! inside that band, at the height where the immersed share balances its load; the march
+ !! holds it there over 3 s to 1e-3 m (the dynamics wets the module with the same fraction).
+ !! In 1.5 m, 6 s Airy waves the module rides the surface through its band for 18 s: every
+ !! step converges and it stays within its radius of the instantaneous surface's range.
+ !! Before, a wet/dry switch at the node gave it no static position and the static start
+ !! failed, naming the attachment that crossed the still-water level.
!! A deck whose lines are all submerged is solved once, bit-identically (the example A/B).
USE CableDyn_Precision, ONLY: wp
USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_GetMovingPointMesh, &
@@ -140,7 +142,7 @@ PROGRAM test_static_dry_weight
CALL check(dmax <= 1.0e-4_wp, 'chain between two moving objects across the surface: both start in the march''s '// &
'equilibrium')
- ! 9. a module that would float: no static position, failed by name
+ ! 9. a module that floats: a static position in the surface band, held by the march
CALL floating_module()
IF (nfail > 0) THEN
@@ -479,10 +481,14 @@ END SUBROUTINE body_cable_heave
SUBROUTINE floating_module()
!! Gate 9: a 160 m finite-EI cable (80 elements) from a Coupled point at (0, 0, -20) m to a
- !! Fixed one at (100, 0, -50) m on a 50 m seabed, a 200 kg, 2 m^3 module 50 m along it.
- INTEGER :: u, es
- LOGICAL :: conv
+ !! Fixed one at (100, 0, -50) m on a 50 m seabed, a 200 kg, 2 m^3 module 50 m along it (node
+ !! 26), 3 s of the march.
+ REAL(wp), PARAMETER :: R_SPHERE = 0.7816_wp ! (3 V/(4 pi))^(1/3), V = 2 m^3
+ INTEGER :: u, es, ios
+ LOGICAL :: conv, first
+ REAL(wp) :: row(2), z0, dz_max, z_lo, z_hi
CHARACTER(1024) :: em
+ CHARACTER(4096) :: line
OPEN (NEWUNIT=u, FILE='dry_float.dat', STATUS='replace', ACTION='write')
WRITE (u, '(A)') 'test_static_dry_weight: a net-buoyant module that would float'
WRITE (u, '(A)') '--- LINE TYPES ---'
@@ -505,7 +511,7 @@ SUBROUTINE floating_module()
WRITE (u, '(A)') '--- ATTACHMENTS ---'
WRITE (u, '(A)') 'LineID ArcLength Mass Volume CdA Ca CdAx'
WRITE (u, '(A)') '(-) (m) (kg) (m^3) (m^2) (-) (m^2)'
- WRITE (u, '(A)') '1 50.0 200.0 2.0 0.0 0.0 0.0'
+ WRITE (u, '(A)') '1 50.0 200.0 2.0 1.0 0.5 0.0'
WRITE (u, '(A)') '--- OPTIONS ---'
WRITE (u, '(A)') '9.80665 g'
WRITE (u, '(A)') '1025.0 rhoW'
@@ -513,18 +519,78 @@ SUBROUTINE floating_module()
WRITE (u, '(A)') '3.0e5 cBot'
WRITE (u, '(A)') '0.01 dtM'
WRITE (u, '(A)') '50.0 WtrDpth'
- WRITE (u, '(A)') '0.1 TMax'
+ WRITE (u, '(A)') '3.0 TMax'
WRITE (u, '(A)') '--- OUTPUTS ---'
- WRITE (u, '(A)') 'Point1Fz'
+ WRITE (u, '(A)') 'L1N26pz'
WRITE (u, '(A)') '--- END ---'
CLOSE (u)
CALL CD_Run_Deck_Driver('dry_float.dat', 'dry_float', conv, es, em)
- WRITE (*, '(2A)') ' module that would float: ', TRIM(em)
- CALL check(es /= CD_DECKDRV_OK, 'module that would float: the static start fails closed')
- CALL check(INDEX(em, 'attachment 1 of the line') > 0 .AND. INDEX(em, 'crossed the still-water level') > 0, &
- 'module that would float: the failure names the attachment that crossed the surface')
+ CALL check(es == CD_DECKDRV_OK .AND. conv, 'module that floats: the static start and the march run: '//TRIM(em))
+ IF (es /= CD_DECKDRV_OK) RETURN
+ OPEN (NEWUNIT=u, FILE='dry_float.out', STATUS='old', ACTION='read')
+ first = .TRUE.
+ z0 = 0.0_wp
+ dz_max = 0.0_wp
+ DO
+ READ (u, '(A)', IOSTAT=ios) line
+ IF (ios /= 0) EXIT
+ READ (line, *, IOSTAT=ios) row
+ IF (ios /= 0) CYCLE
+ IF (first) THEN
+ z0 = row(2)
+ first = .FALSE.
+ END IF
+ dz_max = MAX(dz_max, ABS(row(2) - z0))
+ END DO
+ CLOSE (u)
+ WRITE (*, '(A,F9.4,A,ES10.2,A)') ' module that floats: static height ', z0, ' m, largest drift ', dz_max, ' m'
+ CALL check(.NOT. first .AND. ABS(z0) < R_SPHERE, 'module that floats: its static height lies in the surface '// &
+ 'band of its sphere')
+ CALL check(dz_max <= 1.0e-3_wp, 'module that floats: the march holds its static height')
+ ! the same in waves: the module heaves through its band
+ CALL copy_with_waves('dry_float.dat', 'dry_float_wave.dat')
+ CALL CD_Run_Deck_Driver('dry_float_wave.dat', 'dry_float_wave', conv, es, em)
+ CALL check(es == CD_DECKDRV_OK .AND. conv, 'module that floats, in waves: the march runs: '//TRIM(em))
+ IF (es /= CD_DECKDRV_OK) RETURN
+ OPEN (NEWUNIT=u, FILE='dry_float_wave.out', STATUS='old', ACTION='read')
+ z_lo = HUGE(1.0_wp)
+ z_hi = -HUGE(1.0_wp)
+ DO
+ READ (u, '(A)', IOSTAT=ios) line
+ IF (ios /= 0) EXIT
+ READ (line, *, IOSTAT=ios) row
+ IF (ios /= 0) CYCLE
+ z_lo = MIN(z_lo, row(2))
+ z_hi = MAX(z_hi, row(2))
+ END DO
+ CLOSE (u)
+ WRITE (*, '(A,2F9.4,A)') ' module that floats, in waves: height range ', z_lo, z_hi, ' m'
+ CALL check(z_hi - z_lo > 0.5_wp .AND. z_lo > -0.75_wp - R_SPHERE .AND. z_hi < 0.75_wp + R_SPHERE, &
+ 'module that floats, in waves: it heaves with the surface, within its radius of the wave crest '// &
+ 'and trough')
END SUBROUTINE floating_module
+ SUBROUTINE copy_with_waves(src, dst)
+ !! The deck src with 1.5 m, 6 s Airy waves (head-on) and TMax 18 s, written to dst.
+ CHARACTER(*), INTENT(IN) :: src, dst
+ INTEGER :: ui, uo, ios
+ CHARACTER(4096) :: line
+ OPEN (NEWUNIT=ui, FILE=src, STATUS='old', ACTION='read')
+ OPEN (NEWUNIT=uo, FILE=dst, STATUS='replace', ACTION='write')
+ DO
+ READ (ui, '(A)', IOSTAT=ios) line
+ IF (ios /= 0) EXIT
+ IF (TRIM(line) == '3.0 TMax') THEN
+ WRITE (uo, '(A)') '18.0 TMax'
+ WRITE (uo, '(A)') 'airy 1.5 6.0 0.0 waves'
+ ELSE
+ WRITE (uo, '(A)') TRIM(line)
+ END IF
+ END DO
+ CLOSE (ui)
+ CLOSE (uo)
+ END SUBROUTINE copy_with_waves
+
SUBROUTINE two_objects_drift(dmax)
!! Gate 8: the body of gate 7, a 65 m chain (EI = 0, 30 segments) from its point (0, 0, 8) m to
!! a Connect point (3 t) at (-30, 0, -50) m, and an 85 m chain from there to a Fixed point at
diff --git a/tests/test_static_surface_crossing.f90 b/tests/test_static_surface_crossing.f90
new file mode 100644
index 00000000..4eebf048
--- /dev/null
+++ b/tests/test_static_surface_crossing.f90
@@ -0,0 +1,165 @@
+! File: tests/test_static_surface_crossing.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_static_surface_crossing
+ !! Statics of a light finite-EI cable through the free surface in a cross current: a 4.95 m
+ !! laboratory lazy-wave cable (OD 31 mm, 0.919 kg/m, EI 0.217 N m^2, fresh water 2 m deep), its top
+ !! 0.753 m above the surface and clamped vertical, its foot clamped on the floor, five buoyancy
+ !! modules as attachments, in a uniform current across its plane at 0.390-0.410 m/s every 1 mm/s.
+ !! At 0.400 m/s a Gauss point of the element through the surface sits at the waterline in the
+ !! equilibrium; with a wet/dry switch per Gauss point the drag jumped there, the residual had no
+ !! root and every static route stalled (current load stepping stopped at a drag fraction 0.997).
+ !! Gates:
+ !! S1 every speed solves;
+ !! S2 the sideways deflection and the top tension grow monotonically with the speed, and the
+ !! deflection at 0.400 m/s lies within 2 % of a step of the mean of its neighbours.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ INTEGER, PARAMETER :: NS = 21
+ REAL(wp) :: speed(NS), ymax(NS), ttop(NS)
+ INTEGER :: nfail = 0, k
+ LOGICAL :: ok, all_ok
+ CHARACTER(1024) :: msg
+ CHARACTER(64) :: root
+
+ all_ok = .TRUE.
+ DO k = 1, NS
+ speed(k) = 0.390_wp + 0.001_wp*REAL(k - 1, wp)
+ WRITE (root, '(A,I2.2)') 'ssc_', k
+ CALL write_deck(TRIM(root)//'.dat', speed(k))
+ CALL run(TRIM(root)//'.dat', TRIM(root), ok, msg)
+ CALL require(ok, 'S1: the static solve at the speed of case '//TRIM(root)//' converges: '//TRIM(msg))
+ all_ok = all_ok .AND. ok
+ IF (ok) CALL read_static(TRIM(root)//'.static.out', ymax(k), ttop(k))
+ END DO
+ IF (all_ok) THEN
+ WRITE (*, '(A,3F10.5)') 'S2: peak sideways deflection [m] at 0.399/0.400/0.401 m/s: ', ymax(10:12)
+ CALL require(ALL(ymax(2:NS) > ymax(1:NS - 1)) .AND. ALL(ttop(2:NS) > ttop(1:NS - 1)), &
+ 'S2: the deflection and the top tension grow monotonically with the speed')
+ CALL require(ABS(ymax(11) - 0.5_wp*(ymax(10) + ymax(12))) <= 0.02_wp*ABS(ymax(12) - ymax(10)), &
+ 'S2: the deflection at 0.400 m/s lies between its neighbours (no jump)')
+ END IF
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: statics of a cable through the free surface in a cross current'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_deck(path, u)
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), INTENT(IN) :: u
+ INTEGER :: io
+ ! a uniform current across the cable's plane (MoorDyn water-kinematics file, CurrentMod 1)
+ OPEN (NEWUNIT=io, FILE='ssc_current.dat', STATUS='REPLACE', ACTION='WRITE')
+ WRITE (io, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (io, '(A)') 'uniform current along y for the surface-crossing statics gate'
+ WRITE (io, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (io, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (io, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (io, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (io, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (io, '(A)') '2 - X wave input type'
+ WRITE (io, '(A)') '-5, 5, 2 - X wave grid point data'
+ WRITE (io, '(A)') '2 - Y wave input type'
+ WRITE (io, '(A)') '-5, 5, 2 - Y wave grid point data'
+ WRITE (io, '(A)') '2 - Z wave input type'
+ WRITE (io, '(A)') '-2, 0, 2 - Z wave grid point data'
+ WRITE (io, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (io, '(A)') '1 CurrentMod - type of current input'
+ WRITE (io, '(A)') 'z-depth x-current y-current'
+ WRITE (io, '(A)') '(m) (m/s) (m/s)'
+ WRITE (io, '(A,F8.5)') '0.0 0.0 ', u
+ WRITE (io, '(A,F8.5)') '-2.0 0.0 ', u
+ WRITE (io, '(A)') '--------------------- need this line ------------------'
+ CLOSE (io)
+ OPEN (NEWUNIT=io, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (io, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (io, '(A)') 'light lazy-wave cable through the free surface in a cross current (statics)'
+ WRITE (io, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ WRITE (io, '(A)') 'TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t Cl dF cF'
+ WRITE (io, '(A)') '(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-) (-) (-) (-)'
+ WRITE (io, '(A)') 'cab 0.031 0.919 1.0e4 0.0 0.217 1.2 0.0 1.0 0.0 0 0.08 0.18'
+ WRITE (io, '(A)') '----------------------- POINTS ----------------------------------------------'
+ WRITE (io, '(A)') 'ID Attachment X Y Z M V CdA CA'
+ WRITE (io, '(A)') '(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)'
+ WRITE (io, '(A)') '1 Coupled 0.0 0.0 0.753 0 0 0 0'
+ WRITE (io, '(A)') '2 Fixed 2.798 0.0 -1.954 0 0 0 0'
+ WRITE (io, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (io, '(A)') 'ID LineType AttachA AttachB UnstrLen NumSegs Outputs'
+ WRITE (io, '(A)') '(-) (-) (-) (-) (m) (-) (-)'
+ WRITE (io, '(A)') '1 cab 1 2 4.95 100 -'
+ WRITE (io, '(A)') '--------------------- ATTACHMENTS ----------------------------------'
+ WRITE (io, '(A)') 'LineID ArcLength Mass Volume CdA Ca'
+ WRITE (io, '(A)') '(-) (m) (kg) (m^3) (m^2) (-)'
+ WRITE (io, '(A)') '1 3.1432 0.012375 1.237473e-04 0.0034 1.0'
+ WRITE (io, '(A)') '1 3.2299 0.012375 1.237473e-04 0.0034 1.0'
+ WRITE (io, '(A)') '1 3.4845 0.012375 1.237473e-04 0.0034 1.0'
+ WRITE (io, '(A)') '1 3.7516 0.012375 1.237473e-04 0.0034 1.0'
+ WRITE (io, '(A)') '1 4.0420 0.012375 1.237473e-04 0.0034 1.0'
+ WRITE (io, '(A)') '--------------------- END CONNECTIONS -------------------------------'
+ WRITE (io, '(A)') 'LineID End Stiffness EzX EzY EzZ'
+ WRITE (io, '(A)') '(-) (-) (N-m/rad) (-) (-) (-)'
+ WRITE (io, '(A)') '1 B Rigid 0.644 0 -0.765'
+ WRITE (io, '(A)') '1 A Rigid 0 0 -1'
+ WRITE (io, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (io, '(A)') '1000.0 rhoW'
+ WRITE (io, '(A)') '9.80665 g'
+ WRITE (io, '(A)') '2.0 WtrDpth'
+ WRITE (io, '(A)') 'ssc_current.dat WaterKin'
+ WRITE (io, '(A)') '0.001 dtM'
+ WRITE (io, '(A)') '0.002 TMax'
+ WRITE (io, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (io, '(A)') 'FairTen1'
+ WRITE (io, '(A)') 'END'
+ WRITE (io, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (io)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_static(path, ym, t1)
+ !! The largest sideways (y) node position and the tension at the top node of a static table.
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), INTENT(OUT) :: ym, t1
+ CHARACTER(512) :: rec
+ INTEGER :: io, ios, line_id, node
+ REAL(wp) :: v(10)
+ ym = -HUGE(1.0_wp)
+ t1 = 0.0_wp
+ OPEN (NEWUNIT=io, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (io, '(A)') rec
+ READ (io, '(A)') rec
+ READ (io, '(A)') rec
+ DO
+ READ (io, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ READ (rec, *, IOSTAT=ios) line_id, node, v
+ IF (ios /= 0) CYCLE
+ ym = MAX(ym, v(3))
+ IF (node == 1) t1 = v(5)
+ END DO
+ CLOSE (io)
+ END SUBROUTINE read_static
+
+END PROGRAM test_static_surface_crossing
diff --git a/tests/test_system.f90 b/tests/test_system.f90
index f9c35a18..838aa3a1 100644
--- a/tests/test_system.f90
+++ b/tests/test_system.f90
@@ -9,7 +9,8 @@ PROGRAM test_system
USE CableDyn_Precision, ONLY: wp
USE CableDyn_Dynamic, ONLY: GenAlphaConfig
USE CableDyn_Model, ONLY: CD_ModelType, CD_Init_Model, CD_End_Model, CD_MODEL_OK, &
- CD_Get_Model_EndNodeMassDiag
+ CD_Get_Model_EndNodeMassDiag, CD_Set_Model_VIV, CD_Model_VIV_NMS
+ USE CableDyn_VIV, ONLY: CD_VIV_AMP_MAXP
USE CableDyn_System, ONLY: CD_SystemType, CD_SystemPointType, CD_LineEndpointBinding, &
CD_Init_System_From_Models, CD_Init_System_From_Points, CD_End_System, &
CD_System_NLines, CD_System_NCoupledDOF, CD_System_Line_NDOF, &
@@ -47,6 +48,7 @@ PROGRAM test_system
CALL case_dynamic_free_point_zero_density_no_hydro()
CALL case_zero_coupled_map()
CALL case_system_fail_closed()
+ CALL case_viv_layout_snapshot()
IF (nfail > 0) THEN
WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
@@ -1113,6 +1115,77 @@ SUBROUTINE case_system_fail_closed()
CALL require(es == CD_SYSTEM_OK, 'fail:end')
END SUBROUTINE case_system_fail_closed
+ SUBROUTINE case_viv_layout_snapshot()
+ !! The packed VIV state of a line grows with amplitude tables (CD_Model_VIV_NMS rows per
+ !! node): a snapshot taken after a line gains them follows the new size, and a restore of a
+ !! snapshot taken before is refused, with nothing restored.
+ INTEGER, PARAMETER :: NN = 5, NE = 4
+ TYPE(CD_ModelType) :: models(1)
+ TYPE(CD_SystemType) :: system
+ TYPE(GenAlphaConfig) :: cfg
+ INTEGER :: conn(2, NE), fixed(6), es, k, amp_n(NE)
+ REAL(wp) :: q0(3*NN), v0(3*NN), f_ext(3*NN), fluid(3, NN), wl(NN), q_moved(3*NN)
+ REAL(wp) :: l0(NE), ea(NE), rho_a(NE), cl(NE), dia(NE), cf(NE), df(NE), amp(3, CD_VIV_AMP_MAXP, NE)
+ CHARACTER(240) :: em
+
+ DO k = 1, NE
+ conn(:, k) = [k, k + 1]
+ END DO
+ q0 = 0.0_wp
+ DO k = 1, NN
+ q0(3*k - 2) = REAL(k - 1, wp)
+ q0(3*k) = -5.0_wp
+ END DO
+ v0 = 0.0_wp
+ f_ext = 0.0_wp
+ fixed = [1, 2, 3, 3*NN - 2, 3*NN - 1, 3*NN]
+ l0 = 0.99_wp
+ ea = 1.0e6_wp
+ rho_a = 10.0_wp
+ fluid = 0.0_wp
+ fluid(2, :) = 0.5_wp
+ wl = 0.0_wp
+ cl = 0.8_wp
+ dia = 0.1_wp
+ cf = 0.18_wp
+ df = 0.08_wp
+ amp = 0.0_wp
+ amp_n = 2
+ DO k = 1, NE
+ amp(:, 1, k) = [0.0_wp, 0.8_wp, 1.0_wp]
+ amp(:, 2, k) = [0.5_wp, 0.4_wp, 1.5_wp]
+ END DO
+ CALL CD_Init_Model(models(1), q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, cfg, es, em, &
+ fluid_velocity=fluid, drag_waterline_z=wl, drag_rho=1025.0_wp, &
+ drag_diameter=0.1_wp, drag_cdn=1.2_wp, drag_cdt=0.0_wp)
+ CALL require(es == CD_MODEL_OK, 'viv-layout:init-line: '//TRIM(em))
+ CALL CD_Set_Model_VIV(models(1), 1025.0_wp, cl, dia, cf, df, 0.25_wp, es, em)
+ CALL require(es == CD_MODEL_OK, 'viv-layout:viv: '//TRIM(em))
+ CALL CD_Init_System_From_Models(system, models, es, em)
+ CALL require(es == CD_SYSTEM_OK, 'viv-layout:init-system: '//TRIM(em))
+ CALL CD_End_Model(models(1), es, em)
+ IF (.NOT. CD_System_Is_Initialized(system)) RETURN
+
+ CALL CD_System_Snapshot(system, es, em)
+ CALL require(es == CD_SYSTEM_OK, 'viv-layout:snapshot-without-tables: '//TRIM(em))
+ CALL CD_Set_Model_VIV(system%lines(1), 1025.0_wp, cl, dia, cf, df, 0.25_wp, es, em, amp=amp, amp_n=amp_n)
+ CALL require(es == CD_MODEL_OK .AND. CD_Model_VIV_NMS(system%lines(1)) == 7, 'viv-layout:tables: '//TRIM(em))
+ q_moved = system%lines(1)%q
+ q_moved(8) = q_moved(8) + 0.01_wp
+ system%lines(1)%q = q_moved
+ CALL CD_System_Restore(system, es, em)
+ CALL require(es == CD_SYSTEM_BADINPUT .AND. INDEX(em, 'VIV configuration') > 0, &
+ 'viv-layout:restore-across-layouts-refused: '//TRIM(em))
+ CALL require(ALL(system%lines(1)%q == q_moved), 'viv-layout:nothing-restored')
+ CALL CD_System_Snapshot(system, es, em)
+ CALL require(es == CD_SYSTEM_OK .AND. SIZE(system%snap_viv) == 8*NN, 'viv-layout:snapshot-resized: '//TRIM(em))
+ system%lines(1)%viv_ms(5, 3) = 0.25_wp
+ CALL CD_System_Restore(system, es, em)
+ CALL require(es == CD_SYSTEM_OK .AND. system%lines(1)%viv_ms(5, 3) == 0.0_wp, &
+ 'viv-layout:restore-with-tables: '//TRIM(em))
+ CALL CD_End_System(system, es, em)
+ END SUBROUTINE case_viv_layout_snapshot
+
SUBROUTINE require(cond, label)
LOGICAL, INTENT(IN) :: cond
CHARACTER(*), INTENT(IN) :: label
diff --git a/tests/test_viv_amplitude_deck.f90 b/tests/test_viv_amplitude_deck.f90
new file mode 100644
index 00000000..6f2af922
--- /dev/null
+++ b/tests/test_viv_amplitude_deck.f90
@@ -0,0 +1,300 @@
+! File: tests/test_viv_amplitude_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_amplitude_deck
+ !! Amplitude-dependent VIV coefficients on a deck (the optional VIV AMPLITUDE section, rows
+ !! TypeName AD Cv [CdAmp]; the amplitude estimate of Thorsen et al. 2016, Eq. 8 and 9): the taut
+ !! cable of the wake-oscillator gate (100 m, D 0.1 m, 50 kN, pinned at 50 m depth, 50 elements)
+ !! with the synchronisation lift Cl 0.8 in a uniform 0.15 m/s current along y, as a finite-EI
+ !! cable (EI 1 N m^2) and as an EI = 0 line, each run checked on both line kinds:
+ !! A1 a table that gives Cv = Cl and CdAmp = 1 at every amplitude is the deck without the
+ !! section, to the printed digits;
+ !! A2 the amplitude channel VIVAmp1N26 at mid-span follows the half peak-to-peak cross-flow
+ !! displacement of the steady response there within 1 % (it projects the velocity across
+ !! the ambient flow, as Thorsen et al.: across the relative flow, which turns with the
+ !! response velocity, it read 16 % low at this A/D of 0.68);
+ !! A3 a table whose Cv falls from Cl at A/D 0.1 to zero at A/D AD_ZERO, below the free response
+ !! of the constant-Cl deck, holds the steady response between those two amplitudes;
+ !! A4 a table with Cv 0 and CdAmp 2 at every amplitude (no lift, twice the drag) settles at the
+ !! static in-line mid-span offset of the deck with Cd 2.4, within 0.5 %, at rest;
+ !! A5 refusals by name: a malformed or non-numeric row, an unknown type, a type without the
+ !! synchronisation lift, rows of different columns, A/D not increasing, values out of range,
+ !! a one-row table, more than 32 rows, and the VIVAmp channel on a line without a table.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: D = 0.1_wp, AD_ZERO = 0.3_wp
+ INTEGER :: nfail = 0
+
+ CALL write_current('vad_current.dat')
+ CALL check_kind('1.0', 'finite-EI')
+ CALL check_kind('0.0', 'EI = 0')
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: VIV amplitude deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the VIV amplitude deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_deck(path, amp_rows, tmax, ei, cl, amp_channel, cd)
+ !! amp_rows: the VIV AMPLITUDE section's data rows, ';'-separated ('' for no section); ei the
+ !! type's EI, cl its LINE TYPES Cl (default 0.8), cd its Cd (default 1.2); amp_channel adds
+ !! VIVAmp1N26 to the outputs (default: with a section).
+ CHARACTER(*), INTENT(IN) :: path, amp_rows, ei
+ REAL(wp), INTENT(IN) :: tmax
+ CHARACTER(*), INTENT(IN), OPTIONAL :: cl, cd
+ LOGICAL, INTENT(IN), OPTIONAL :: amp_channel
+ CHARACTER(32) :: cl_col, cd_col
+ INTEGER :: u, i0, i1
+ LOGICAL :: with_amp
+ cl_col = '0.8'
+ IF (PRESENT(cl)) cl_col = cl
+ cd_col = '1.2'
+ IF (PRESENT(cd)) cd_col = cd
+ with_amp = LEN_TRIM(amp_rows) > 0
+ IF (PRESENT(amp_channel)) with_amp = amp_channel
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'VIV amplitude deck gate: taut cable in a uniform current'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ 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 '//TRIM(ei)//' '//TRIM(cd_col)// &
+ ' 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'
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ 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 (LEN_TRIM(amp_rows) > 0) THEN
+ WRITE (u, '(A)') '----------------------- VIV AMPLITUDE ---------------------------------------'
+ WRITE (u, '(A)') 'TypeName AD Cv CdAmp'
+ WRITE (u, '(A)') '(-) (-) (-) (-)'
+ i0 = 1
+ DO
+ i1 = INDEX(amp_rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(amp_rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') amp_rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '0.01 dtM'
+ WRITE (u, '(A)') '100.0 WtrDpth'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') 'vad_current.dat WaterKin'
+ WRITE (u, '(A,F8.3,A)') ' ', tmax, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (u, '(A)') 'L1N26PZ'
+ WRITE (u, '(A)') 'L1N26PY'
+ IF (with_amp) WRITE (u, '(A)') 'VIVAmp1N26'
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, ncol, tab, n)
+ !! The rows (time and ncol - 1 channels) of a deck's main output file.
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER, INTENT(IN) :: ncol
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(1024) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(ncol, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ REAL(wp) FUNCTION window_mean(tab, n, row, t0) RESULT(m)
+ REAL(wp), INTENT(IN) :: tab(:, :), t0
+ INTEGER, INTENT(IN) :: n, row
+ LOGICAL :: keep(n)
+ keep = tab(1, 1:n) >= t0
+ m = SUM(PACK(tab(row, 1:n), keep))/REAL(MAX(1, COUNT(keep)), wp)
+ END FUNCTION window_mean
+
+ REAL(wp) FUNCTION window_ad(tab, n, t0) RESULT(ad)
+ !! Half peak-to-peak mid-span cross-flow displacement over D from t0 on.
+ REAL(wp), INTENT(IN) :: tab(:, :), t0
+ INTEGER, INTENT(IN) :: n
+ LOGICAL :: keep(n)
+ REAL(wp), ALLOCATABLE :: z(:)
+ keep = tab(1, 1:n) >= t0
+ z = PACK(tab(2, 1:n), keep)
+ ad = 0.5_wp*(MAXVAL(z) - MINVAL(z))/D
+ END FUNCTION window_ad
+
+ SUBROUTINE check_kind(ei, label)
+ CHARACTER(*), INTENT(IN) :: ei, label
+ CHARACTER(16) :: tag
+ REAL(wp), ALLOCATABLE :: tn(:, :), ti(:, :), tl(:, :), tg(:, :), tc(:, :)
+ INTEGER :: nn, ni, nl, ng, nc
+ REAL(wp) :: ad_n, ad_i, amp_i, ad_l, amp_l, y_g, y_static, amp_g
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ tag = MERGE('fe', 'e0', ei /= '0.0')
+ CALL write_deck('vad_'//TRIM(tag)//'_none.dat', '', 100.0_wp, ei)
+ CALL run('vad_'//TRIM(tag)//'_none.dat', 'vad_'//TRIM(tag)//'_none', ok, msg)
+ CALL require(ok, 'A1 ('//label//'): the deck without the section runs: '//TRIM(msg))
+ CALL write_deck('vad_'//TRIM(tag)//'_ident.dat', 'riser 0.0 0.8 1.0;riser 1.0 0.8 1.0', 100.0_wp, ei)
+ CALL run('vad_'//TRIM(tag)//'_ident.dat', 'vad_'//TRIM(tag)//'_ident', ok, msg)
+ CALL require(ok, 'A1 ('//label//'): the identity-table deck runs: '//TRIM(msg))
+ CALL write_deck('vad_'//TRIM(tag)//'_limit.dat', 'riser 0.0 0.8;riser 0.1 0.8;riser 0.3 0.0', 100.0_wp, ei)
+ CALL run('vad_'//TRIM(tag)//'_limit.dat', 'vad_'//TRIM(tag)//'_limit', ok, msg)
+ CALL require(ok, 'A3 ('//label//'): the falling-Cv deck runs: '//TRIM(msg))
+ CALL write_deck('vad_'//TRIM(tag)//'_drag.dat', 'riser 0.0 0.0 2.0;riser 1.0 0.0 2.0', 100.0_wp, ei)
+ CALL run('vad_'//TRIM(tag)//'_drag.dat', 'vad_'//TRIM(tag)//'_drag', ok, msg)
+ CALL require(ok, 'A4 ('//label//'): the Cv 0, CdAmp 2 deck runs: '//TRIM(msg))
+ CALL write_deck('vad_'//TRIM(tag)//'_cd24.dat', '', 0.1_wp, ei, cd='2.4')
+ CALL run('vad_'//TRIM(tag)//'_cd24.dat', 'vad_'//TRIM(tag)//'_cd24', ok, msg)
+ CALL require(ok, 'A4 ('//label//'): the Cd 2.4 deck runs: '//TRIM(msg))
+ CALL read_out('vad_'//TRIM(tag)//'_cd24.out', 3, tc, nc)
+ CALL read_out('vad_'//TRIM(tag)//'_none.out', 3, tn, nn)
+ CALL read_out('vad_'//TRIM(tag)//'_ident.out', 4, ti, ni)
+ CALL read_out('vad_'//TRIM(tag)//'_limit.out', 4, tl, nl)
+ CALL read_out('vad_'//TRIM(tag)//'_drag.out', 4, tg, ng)
+ CALL require(nn > 5000 .AND. ni == nn .AND. nl == nn .AND. ng == nn, 'A1 ('//label//'): the runs wrote '// &
+ 'matching rows')
+ IF (.NOT. (nn > 5000 .AND. ni == nn .AND. nl == nn .AND. ng == nn)) RETURN
+ ! A1: the identity table
+ CALL require(ALL(ti(1:3, 1:ni) == tn(1:3, 1:nn)), 'A1 ('//label//'): Cv = Cl and CdAmp 1 is the deck '// &
+ 'without the section')
+ ! A2: the amplitude estimate against the response
+ ad_n = window_ad(tn, nn, 60.0_wp)
+ ad_i = window_ad(ti, ni, 60.0_wp)
+ amp_i = window_mean(ti, ni, 4, 60.0_wp)/D
+ WRITE (*, '(A,3F8.4)') 'A2 ('//label//'): A/D constant Cl, identity table, its VIVAmp/D: ', ad_n, ad_i, amp_i
+ CALL require(ad_i > 0.05_wp .AND. ABS(amp_i/ad_i - 1.0_wp) <= 0.01_wp, 'A2 ('//label//'): VIVAmp follows '// &
+ 'the response amplitude within 1 %')
+ ! A3: self-limiting
+ ad_l = window_ad(tl, nl, 60.0_wp)
+ amp_l = window_mean(tl, nl, 4, 60.0_wp)/D
+ WRITE (*, '(A,2F8.4)') 'A3 ('//label//'): falling-Cv A/D and VIVAmp/D: ', ad_l, amp_l
+ CALL require(ad_n > AD_ZERO, 'A3 ('//label//'): the constant-Cl response exceeds the zero of the table')
+ CALL require(ABS(amp_l/ad_l - 1.0_wp) <= 0.01_wp, 'A3 ('//label//'): VIVAmp follows it within 1 %')
+ CALL require(ad_l > 0.1_wp .AND. ad_l < AD_ZERO, 'A3 ('//label//'): the falling Cv holds the response '// &
+ 'inside its falling range')
+ ! A4: the drag factor, on the mid-span in-line offset from the line between the ends (y = 0)
+ CALL require(nc >= 1, 'A4 ('//label//'): the Cd 2.4 deck wrote its static row')
+ IF (nc < 1) RETURN
+ y_static = tc(3, 1)
+ y_g = window_mean(tg, ng, 3, 80.0_wp)
+ amp_g = window_mean(tg, ng, 4, 80.0_wp)/D
+ WRITE (*, '(A,2F10.6,ES11.3)') 'A4 ('//label//'): Cd 2.4 static, Cv 0 CdAmp 2 final offsets [m], '// &
+ 'VIVAmp/D: ', y_static, y_g, amp_g
+ CALL require(y_static > 0.0_wp .AND. ABS(y_g/y_static - 1.0_wp) <= 0.005_wp, 'A4 ('//label//'): CdAmp 2 '// &
+ 'settles at the offset of Cd 2.4')
+ CALL require(window_ad(tg, ng, 80.0_wp) < 1.0e-3_wp .AND. amp_g < 1.0e-2_wp, 'A4 ('//label//'): at rest, '// &
+ 'without lift')
+ END SUBROUTINE check_kind
+
+ SUBROUTINE check_refusals()
+ CHARACTER(2048) :: many
+ INTEGER :: k
+ CALL refused('riser 0.0 0.8 1.0 2.0', 'TypeName AD Cv [CdAmp]', 'a row of five columns')
+ CALL refused('riser 0.0;riser 1.0', 'TypeName AD Cv [CdAmp]', 'a row of two columns')
+ CALL refused('riser 0.0 x;riser 1.0 0.8', 'plain numbers', 'a non-numeric Cv')
+ CALL refused('cable 0.0 0.8;cable 1.0 0.8', 'undefined LINE TYPE', 'an unknown type')
+ CALL refused('riser 0.0 0.8;riser 1.0 0.8', 'give the type LINE TYPES Cl > 0', 'a type without lift', &
+ cl='0.0')
+ CALL refused('riser 0.0 0.8 1.0;riser 1.0 0.8', 'same columns', 'rows of different columns')
+ CALL refused('riser 0.5 0.8;riser 0.5 0.6', 'increase strictly in AD', 'a repeated AD')
+ CALL refused('riser -0.1 0.8;riser 1.0 0.8', 'AD >= 0, Cv >= 0 and CdAmp > 0', 'a negative AD')
+ CALL refused('riser 0.0 -0.8;riser 1.0 0.8', 'AD >= 0, Cv >= 0 and CdAmp > 0', 'a negative Cv')
+ CALL refused('riser 0.0 0.8 0.0;riser 1.0 0.8 1.0', 'AD >= 0, Cv >= 0 and CdAmp > 0', 'a zero CdAmp')
+ CALL refused('riser 0.0 0.8', 'at least two', 'a one-row table')
+ many = ''
+ DO k = 0, 32
+ WRITE (many(LEN_TRIM(many) + 1:), '(A,F5.2,A)') 'riser ', 0.01_wp*REAL(k, wp), ' 0.8;'
+ END DO
+ many(LEN_TRIM(many):LEN_TRIM(many)) = ' '
+ CALL refused(TRIM(many), 'more than 32', 'a table of 33 rows')
+ CALL refused('', 'has no VIV AMPLITUDE table', 'VIVAmp on a line without a table', amp_channel=.TRUE.)
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE refused(rows, needle, what, cl, amp_channel)
+ CHARACTER(*), INTENT(IN) :: rows, needle, what
+ CHARACTER(*), INTENT(IN), OPTIONAL :: cl
+ LOGICAL, INTENT(IN), OPTIONAL :: amp_channel
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ IF (PRESENT(cl)) THEN
+ CALL write_deck('vad_bad.dat', rows, 1.0_wp, '1.0', cl=cl)
+ ELSE IF (PRESENT(amp_channel)) THEN
+ CALL write_deck('vad_bad.dat', rows, 1.0_wp, '1.0', amp_channel=amp_channel)
+ ELSE
+ CALL write_deck('vad_bad.dat', rows, 1.0_wp, '1.0')
+ END IF
+ CALL run('vad_bad.dat', 'vad_bad', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, needle) > 0, 'A5: '//what//' is refused: '//TRIM(msg))
+ END SUBROUTINE refused
+
+END PROGRAM test_viv_amplitude_deck
diff --git a/tests/test_viv_amplitude_kernel.f90 b/tests/test_viv_amplitude_kernel.f90
new file mode 100644
index 00000000..385b60c3
--- /dev/null
+++ b/tests/test_viv_amplitude_kernel.f90
@@ -0,0 +1,241 @@
+! File: tests/test_viv_amplitude_kernel.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_amplitude_kernel
+ !! The cross-flow amplitude estimate of Thorsen et al. (2016, Eq. 8 and 9; CD_VIV_Amplitude_Update)
+ !! and the amplitude tables (CD_VIV_Table, CD_VIV_Check_Amp_Table):
+ !! K1 a sinusoidal cross-flow velocity y' = om y0 cos(om t + p) with a step that does not divide
+ !! the period: after the first half cycle the half-cycle amplitude is y0 within 3e-6 relative
+ !! (the trapezoidal (om dt)^2/12 is 1.9e-6),
+ !! halving the step cuts the error about four times (trapezoidal travel, interpolated
+ !! crossings), and the smoothed amplitude follows Eq. 9 (within 1e-9 of y0 after 400 steps);
+ !! K2 a velocity that touches zero without changing sign ends no half cycle, a velocity that
+ !! changes sign does, also through a sample at exactly zero (the travel is signed);
+ !! K3 a growing oscillation y0(t) = a t: each half-cycle value is the mean amplitude of its half
+ !! cycle (within 0.1 % from the sixth period, the extremes then within that of a t);
+ !! K4 the table interpolates linearly and holds its end values; a one-row table is constant;
+ !! a NaN argument stays inside the table (NaN back, or the one row);
+ !! K5 the table check refuses each bad table by name and accepts a good one.
+ USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_VALUE, IEEE_QUIET_NAN, IEEE_IS_NAN
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_VIV, ONLY: CD_VIV_Amplitude_Update, CD_VIV_Table, CD_VIV_Check_Amp_Table, CD_VIV_AMP_MAXP, &
+ CD_VIV_AMP_KDT
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
+ INTEGER :: nfail = 0
+
+ CALL check_sinusoid()
+ CALL check_touch()
+ CALL check_growth()
+ CALL check_table()
+ CALL check_tables_validated()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: VIV amplitude estimate and tables'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE run_sinusoid(dt, nstep, y0, err, smooth_err)
+ !! The largest relative error of the half-cycle amplitude over the run after the first two
+ !! crossings, and the final error of the smoothed one.
+ REAL(wp), INTENT(IN) :: dt, y0
+ INTEGER, INTENT(IN) :: nstep
+ REAL(wp), INTENT(OUT) :: err, smooth_err
+ REAL(wp), PARAMETER :: om = 2.0_wp*PI/1.3_wp, ph = 0.4_wp
+ REAL(wp) :: st(4), y_half
+ INTEGER :: i, ncross
+ st = 0.0_wp
+ st(4) = om*y0*COS(ph)
+ err = 0.0_wp
+ ncross = 0
+ y_half = 0.0_wp
+ DO i = 1, nstep
+ CALL CD_VIV_Amplitude_Update(st, om*y0*COS(om*REAL(i, wp)*dt + ph), dt)
+ IF (st(2) /= y_half) THEN
+ ncross = ncross + 1
+ y_half = st(2)
+ IF (ncross > 1) err = MAX(err, ABS(st(2)/y0 - 1.0_wp))
+ END IF
+ END DO
+ smooth_err = ABS(st(3)/y0 - 1.0_wp)
+ CALL require(ncross > 10, 'K1: the sinusoid crosses zero')
+ END SUBROUTINE run_sinusoid
+
+ SUBROUTINE check_sinusoid()
+ REAL(wp) :: e1, e2, s1, s2
+ CALL run_sinusoid(1.0e-3_wp, 13000, 0.07_wp, e1, s1)
+ CALL run_sinusoid(0.5e-3_wp, 26000, 0.07_wp, e2, s2)
+ WRITE (*, '(A,2ES11.3,A,F6.2)') 'K1: half-cycle error at dt, dt/2: ', e1, e2, '; ratio ', e1/e2
+ CALL require(e1 <= 3.0e-6_wp, 'K1: the half-cycle amplitude is y0 within 3e-6')
+ CALL require(e1/e2 > 3.0_wp .AND. e1/e2 < 5.0_wp, 'K1: the error is second order in the step')
+ CALL require(s1 <= 1.0e-5_wp .AND. s2 <= 1.0e-5_wp, 'K1: the smoothed amplitude settles on y0')
+ CALL check_smoothing()
+ END SUBROUTINE check_sinusoid
+
+ SUBROUTINE check_smoothing()
+ !! Eq. 9 per step: y0s_n+1 = y0s_n + k_a dt (y0 - y0s_n) with the half-cycle amplitude held.
+ REAL(wp) :: st(4), expect
+ INTEGER :: i
+ st = [0.0_wp, 0.5_wp, 0.0_wp, 1.0_wp]
+ expect = 0.0_wp
+ DO i = 1, 400
+ CALL CD_VIV_Amplitude_Update(st, 1.0_wp, 1.0e-3_wp)
+ expect = expect + CD_VIV_AMP_KDT*(0.5_wp - expect)
+ END DO
+ CALL require(st(3) == expect, 'K1: the smoothing is Eq. 9 step by step')
+ CALL require(ABS(st(3) - 0.5_wp) <= 1.0e-9_wp, 'K1: and reaches the held amplitude')
+ CALL require(st(2) == 0.5_wp, 'K1: no crossing, the half-cycle amplitude is held')
+ END SUBROUTINE check_smoothing
+
+ SUBROUTINE check_touch()
+ REAL(wp) :: st(4)
+ st = [0.0_wp, 0.25_wp, 0.25_wp, 1.0_wp]
+ CALL CD_VIV_Amplitude_Update(st, 0.0_wp, 0.1_wp)
+ CALL CD_VIV_Amplitude_Update(st, 1.0_wp, 0.1_wp)
+ CALL require(st(2) == 0.25_wp, 'K2: touching zero without a sign change ends no half cycle')
+ CALL require(ABS(st(1) - 0.1_wp) <= 1.0e-15_wp, 'K2: the travel keeps accumulating')
+ CALL CD_VIV_Amplitude_Update(st, -1.0_wp, 0.1_wp)
+ ! the crossing halfway through the step: travel 0.1 + 0.025 before it, half of it the amplitude
+ CALL require(ABS(st(2) - 0.0625_wp) <= 1.0e-15_wp, 'K2: a sign change ends the half cycle at the crossing')
+ CALL require(ABS(st(1) + 0.025_wp) <= 1.0e-15_wp, 'K2: the rest of the step starts the next one, signed')
+ CALL check_zero_samples()
+ END SUBROUTINE check_touch
+
+ SUBROUTINE check_zero_samples()
+ !! A triangular velocity sampled on its zeros, 0 1 2 1 0 -1 -2 -1 0 ... with dt 0.5: every
+ !! reversal passes through a sample at zero, and each half cycle travels 2 (exact for the
+ !! trapezoidal rule on a piecewise-linear velocity), so y0 = 1; a touch (1 0 1) ends none.
+ REAL(wp), PARAMETER :: wave(8) = [1.0_wp, 2.0_wp, 1.0_wp, 0.0_wp, -1.0_wp, -2.0_wp, -1.0_wp, 0.0_wp]
+ REAL(wp) :: st(4), s_before
+ INTEGER :: i, n_half
+ LOGICAL :: all_one
+ st = 0.0_wp
+ n_half = 0
+ all_one = .TRUE.
+ DO i = 1, 8*5
+ s_before = st(1)
+ CALL CD_VIV_Amplitude_Update(st, wave(MOD(i - 1, 8) + 1), 0.5_wp)
+ ! a half cycle ends where the signed travel changes sign
+ IF (s_before*st(1) < 0.0_wp) THEN
+ n_half = n_half + 1
+ all_one = all_one .AND. st(2) == 1.0_wp
+ END IF
+ END DO
+ CALL require(n_half == 9 .AND. all_one, 'K2: each reversal through a sample at zero ends a half cycle, y0 = 1')
+ CALL require(st(1) == -2.0_wp .AND. st(4) == 0.0_wp, 'K2: the run ends on a zero sample, its half cycle open')
+ st = [0.75_wp, 0.5_wp, 0.5_wp, 0.0_wp]
+ CALL CD_VIV_Amplitude_Update(st, 1.0_wp, 0.5_wp)
+ CALL require(st(2) == 0.5_wp .AND. st(1) == 1.0_wp, 'K2: a touch through a zero sample (+, 0, +) ends none')
+ st = [0.75_wp, 0.5_wp, 0.5_wp, 0.0_wp]
+ CALL CD_VIV_Amplitude_Update(st, -1.0_wp, 0.5_wp)
+ CALL require(st(2) == 0.375_wp .AND. st(1) == -0.25_wp, 'K2: a reversal through it (+, 0, -) ends one there')
+ END SUBROUTINE check_zero_samples
+
+ SUBROUTINE check_growth()
+ !! y = a t sin(om t): y' = a sin(om t) + a t om cos(om t). Between crossings of y' the travel
+ !! is |y(t2) - y(t1)|, half of which is the mean of the two extreme amplitudes.
+ REAL(wp), PARAMETER :: om = 2.0_wp*PI, a = 0.01_wp, dt = 1.0e-4_wp
+ REAL(wp) :: st(4), y_half, t, yd, t_prev_cross, y_prev_ext, err
+ INTEGER :: i, ncross
+ st = 0.0_wp
+ st(4) = 0.0_wp
+ y_half = 0.0_wp
+ ncross = 0
+ err = 0.0_wp
+ t_prev_cross = 0.0_wp
+ y_prev_ext = 0.0_wp
+ DO i = 1, 100000
+ t = REAL(i, wp)*dt
+ yd = a*SIN(om*t) + a*t*om*COS(om*t)
+ CALL CD_VIV_Amplitude_Update(st, yd, dt)
+ IF (st(2) /= y_half) THEN
+ ncross = ncross + 1
+ y_half = st(2)
+ ! the extreme just passed is at about the crossing time; its |y| = a t
+ IF (ncross > 10) err = MAX(err, ABS(st(2)/(0.5_wp*(a*t + y_prev_ext)) - 1.0_wp))
+ y_prev_ext = a*t
+ END IF
+ END DO
+ WRITE (*, '(A,ES11.3)') 'K3: growing oscillation, largest error of the half-cycle mean amplitude: ', err
+ CALL require(ncross > 15 .AND. err <= 1.0e-3_wp, &
+ 'K3: each half-cycle value is the mean amplitude of the half cycle')
+ END SUBROUTINE check_growth
+
+ SUBROUTINE check_table()
+ REAL(wp) :: xs(3), ys(3), nan, y
+ xs = [0.0_wp, 0.4_wp, 0.8_wp]
+ ys = [0.5_wp, 1.0_wp, 0.0_wp]
+ CALL require(CD_VIV_Table(-1.0_wp, xs, ys) == 0.5_wp, 'K4: held below the first row')
+ CALL require(CD_VIV_Table(0.0_wp, xs, ys) == 0.5_wp, 'K4: the first row')
+ CALL require(ABS(CD_VIV_Table(0.2_wp, xs, ys) - 0.75_wp) <= 1.0e-15_wp, 'K4: linear between rows')
+ CALL require(CD_VIV_Table(0.4_wp, xs, ys) == 1.0_wp, 'K4: an interior row')
+ CALL require(ABS(CD_VIV_Table(0.7_wp, xs, ys) - 0.25_wp) <= 1.0e-15_wp, 'K4: linear on the falling side')
+ CALL require(CD_VIV_Table(5.0_wp, xs, ys) == 0.0_wp, 'K4: held beyond the last row')
+ CALL require(CD_VIV_Table(3.0_wp, xs(1:1), ys(1:1)) == 0.5_wp, 'K4: a one-row table is constant')
+ ! A NaN amplitude (a diverged run) stays inside the table: NaN back, or the one row.
+ nan = IEEE_VALUE(nan, IEEE_QUIET_NAN)
+ y = CD_VIV_Table(nan, xs, ys)
+ CALL require(IEEE_IS_NAN(y), 'K4: a NaN amplitude gives NaN')
+ CALL require(CD_VIV_Table(nan, xs(1:1), ys(1:1)) == 0.5_wp, 'K4: a one-row table is constant at NaN')
+ END SUBROUTINE check_table
+
+ SUBROUTINE check_tables_validated()
+ REAL(wp) :: amp(3, CD_VIV_AMP_MAXP, 2), cl(2)
+ INTEGER :: n(2)
+ CHARACTER(160) :: msg
+ CALL good(amp, n, cl)
+ CALL CD_VIV_Check_Amp_Table(amp, n, cl, msg)
+ CALL require(LEN_TRIM(msg) == 0, 'K5: a good table passes: '//TRIM(msg))
+ CALL good(amp, n, cl)
+ amp(1, 2, 1) = 0.0_wp
+ CALL bad(amp, n, cl, 'increase strictly', 'a repeated A/D')
+ CALL good(amp, n, cl)
+ amp(1, 1, 1) = -0.1_wp
+ CALL bad(amp, n, cl, 'A/D >= 0', 'a negative A/D')
+ CALL good(amp, n, cl)
+ amp(2, 2, 1) = -0.1_wp
+ CALL bad(amp, n, cl, 'C_v >= 0', 'a negative C_v')
+ CALL good(amp, n, cl)
+ amp(3, 1, 1) = 0.0_wp
+ CALL bad(amp, n, cl, 'drag factor > 0', 'a zero drag factor')
+ CALL good(amp, n, cl)
+ cl(1) = 0.0_wp
+ CALL bad(amp, n, cl, 'needs the cross-flow lift', 'a table on an element without lift')
+ CALL good(amp, n, cl)
+ n(1) = CD_VIV_AMP_MAXP + 1
+ CALL bad(amp, n, cl, '0 to 32 rows', 'too many rows')
+ CALL good(amp, n, cl)
+ CALL CD_VIV_Check_Amp_Table(amp(:, 1:4, :), n, cl, msg)
+ CALL require(INDEX(msg, 'shapes') > 0, 'K5: a table of the wrong shape is refused: '//TRIM(msg))
+ END SUBROUTINE check_tables_validated
+
+ SUBROUTINE good(amp, n, cl)
+ REAL(wp), INTENT(OUT) :: amp(:, :, :), cl(:)
+ INTEGER, INTENT(OUT) :: n(:)
+ amp = 0.0_wp
+ amp(:, 1, 1) = [0.0_wp, 0.8_wp, 1.0_wp]
+ amp(:, 2, 1) = [0.5_wp, 0.0_wp, 2.0_wp]
+ n = [2, 0]
+ cl = [0.8_wp, 0.0_wp]
+ END SUBROUTINE good
+
+ SUBROUTINE bad(amp, n, cl, needle, what)
+ REAL(wp), INTENT(IN) :: amp(:, :, :), cl(:)
+ INTEGER, INTENT(IN) :: n(:)
+ CHARACTER(*), INTENT(IN) :: needle, what
+ CHARACTER(160) :: msg
+ CALL CD_VIV_Check_Amp_Table(amp, n, cl, msg)
+ CALL require(INDEX(msg, needle) > 0, 'K5: '//what//' is refused: '//TRIM(msg))
+ END SUBROUTINE bad
+
+END PROGRAM test_viv_amplitude_kernel
diff --git a/tests/test_viv_cf_damping_deck.f90 b/tests/test_viv_cf_damping_deck.f90
new file mode 100644
index 00000000..19447922
--- /dev/null
+++ b/tests/test_viv_cf_damping_deck.f90
@@ -0,0 +1,280 @@
+! File: tests/test_viv_cf_damping_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_cf_damping_deck
+ !! The split drag of a VIV DAMPING row (TypeName a b [c]: Morison in line, 1/2 rho D [C_dy |w_y| +
+ !! c Cdn |w|] w_y across the ambient flow, C_dy = a + b y0/D of Thorsen et al. 2016) on the taut
+ !! finite-EI cable of the VIV amplitude gate (100 m, D 0.1 m, 50 kN, Cl 0.8, 0.15 m/s along y):
+ !! D1 `0 0 1` with a table of Cv = Cl and drag factor 1 is the deck without the section (the
+ !! split recombines Morison's drag to round-off, test_viv_cf_damping_kernel K3), to 1e-4 of
+ !! the response: the VIV phase carries the round-off over 40 s, 1.5e-8 in a Release build and
+ !! 1.5e-5 in a Debug one;
+ !! D2 `0 0 1` with Cv 0 and drag factor 2 (no lift, the in-line drag doubled, the cross-flow
+ !! drag Morison's) settles at the static in-line offset of the deck with Cd 2.4, within 0.5 %;
+ !! D3 Thorsen's form `0.31 0.89` replaces the cross-flow drag by the quadratic damping, weaker at
+ !! this amplitude: the steady cross-flow response is larger than with Morison's drag;
+ !! D4 the energy ledger closes with the split: over the steady window the mean of VIVPow1 +
+ !! DragPow1 + DampPow1 is within 1 % of the mean VIV power;
+ !! D5 refusals by name: a row without its table, an EI = 0 line, a malformed row, a negative
+ !! coefficient, a type named twice, an undefined type.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: D = 0.1_wp
+ CHARACTER(*), PARAMETER :: NEUTRAL = 'riser 0.0 0.8 1.0;riser 1.0 0.8 1.0'
+ INTEGER :: nfail = 0
+
+ CALL write_current('vcd_current.dat')
+ CALL check_identity()
+ CALL check_inline_amplification()
+ CALL check_thorsen()
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: VIV cross-flow damping deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the VIV cross-flow damping deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_rows(u, rows)
+ INTEGER, INTENT(IN) :: u
+ CHARACTER(*), INTENT(IN) :: rows
+ INTEGER :: i0, i1
+ i0 = 1
+ DO
+ i1 = INDEX(rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END SUBROUTINE write_rows
+
+ SUBROUTINE write_deck(path, amp_rows, damp_rows, tmax, ei, cd, power)
+ !! amp_rows/damp_rows: the VIV AMPLITUDE and VIV DAMPING data rows, ';'-separated ('' for no
+ !! section); ei the type's EI (default 1.0), cd its Cd (default 1.2); power adds the load-power
+ !! channels.
+ CHARACTER(*), INTENT(IN) :: path, amp_rows, damp_rows
+ REAL(wp), INTENT(IN) :: tmax
+ CHARACTER(*), INTENT(IN), OPTIONAL :: ei, cd
+ LOGICAL, INTENT(IN), OPTIONAL :: power
+ CHARACTER(32) :: ei_col, cd_col
+ INTEGER :: u
+ ei_col = '1.0'
+ IF (PRESENT(ei)) ei_col = ei
+ cd_col = '1.2'
+ IF (PRESENT(cd)) cd_col = cd
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'VIV cross-flow damping deck gate: taut cable in a uniform current'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ 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 '//TRIM(ei_col)//' '//TRIM(cd_col)// &
+ ' 1.0 0.0 0.0 0.8 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'
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ 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 (LEN_TRIM(amp_rows) > 0) THEN
+ WRITE (u, '(A)') '----------------------- VIV AMPLITUDE ---------------------------------------'
+ WRITE (u, '(A)') 'TypeName AD Cv CdAmp'
+ WRITE (u, '(A)') '(-) (-) (-) (-)'
+ CALL write_rows(u, amp_rows)
+ END IF
+ IF (LEN_TRIM(damp_rows) > 0) THEN
+ WRITE (u, '(A)') '----------------------- VIV DAMPING -----------------------------------------'
+ WRITE (u, '(A)') 'TypeName a b c'
+ WRITE (u, '(A)') '(-) (-) (-) (-)'
+ CALL write_rows(u, damp_rows)
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '0.01 dtM'
+ WRITE (u, '(A)') '100.0 WtrDpth'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') 'vcd_current.dat WaterKin'
+ WRITE (u, '(A,F8.3,A)') ' ', tmax, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (u, '(A)') 'L1N26PZ'
+ WRITE (u, '(A)') 'L1N26PY'
+ IF (PRESENT(power)) THEN
+ IF (power) THEN
+ WRITE (u, '(A)') 'VIVPow1'
+ WRITE (u, '(A)') 'DragPow1'
+ WRITE (u, '(A)') 'DampPow1'
+ END IF
+ END IF
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, tab, n, ncol)
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ INTEGER, INTENT(IN) :: ncol
+ CHARACTER(1024) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(ncol, 40000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ SUBROUTINE check_identity()
+ REAL(wp), ALLOCATABLE :: ta(:, :), tb(:, :)
+ INTEGER :: na, nb
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ REAL(wp) :: dz
+ CALL write_deck('vcd_morison.dat', NEUTRAL, '', 40.0_wp)
+ CALL run('vcd_morison.dat', 'vcd_morison', ok, msg)
+ CALL require(ok, 'D1: the Morison deck runs: '//TRIM(msg))
+ CALL write_deck('vcd_split.dat', NEUTRAL, 'riser 0 0 1', 40.0_wp)
+ CALL run('vcd_split.dat', 'vcd_split', ok, msg)
+ CALL require(ok, 'D1: the split deck runs: '//TRIM(msg))
+ CALL read_out('vcd_morison.out', ta, na, 3)
+ CALL read_out('vcd_split.out', tb, nb, 3)
+ IF (na /= nb .OR. na < 100) THEN
+ CALL require(.FALSE., 'D1: both runs wrote the same rows'); RETURN
+ END IF
+ dz = MAXVAL(ABS(ta(2:3, :na) - tb(2:3, :nb)))/MAXVAL(ABS(ta(2, :na) - ta(2, 1)))
+ WRITE (*, '(A,ES10.2)') 'D1 0 0 1 against Morison: max response difference / CF range ', dz
+ ! the split and recombined drag differ by round-off, which the VIV phase dynamics carry over 40 s
+ CALL require(dz <= 1.0e-4_wp, 'D1: the split with c = 1 recombines Morison''s drag')
+ END SUBROUTINE check_identity
+
+ SUBROUTINE check_inline_amplification()
+ REAL(wp), ALLOCATABLE :: ta(:, :), tb(:, :)
+ INTEGER :: na, nb
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ REAL(wp) :: ya, yb
+ CALL write_deck('vcd_amp2.dat', 'riser 0.0 0.0 2.0;riser 1.0 0.0 2.0', 'riser 0 0 1', 30.0_wp)
+ CALL run('vcd_amp2.dat', 'vcd_amp2', ok, msg)
+ CALL require(ok, 'D2: the in-line amplification deck runs: '//TRIM(msg))
+ CALL write_deck('vcd_cd24.dat', 'riser 0.0 0.0 1.0;riser 1.0 0.0 1.0', '', 30.0_wp, cd='2.4')
+ CALL run('vcd_cd24.dat', 'vcd_cd24', ok, msg)
+ CALL require(ok, 'D2: the Cd 2.4 deck runs: '//TRIM(msg))
+ CALL read_out('vcd_amp2.out', ta, na, 3)
+ CALL read_out('vcd_cd24.out', tb, nb, 3)
+ IF (na < 10 .OR. nb < 10) RETURN
+ ya = ta(3, na) - 0.0_wp
+ yb = tb(3, nb) - 0.0_wp
+ WRITE (*, '(A,2ES14.6)') 'D2 in-line offset, split with CdAmp 2 and Cd 2.4: ', ya, yb
+ CALL require(ABS(ya - yb) <= 5.0e-3_wp*ABS(yb), 'D2: the in-line drag alone is amplified')
+ END SUBROUTINE check_inline_amplification
+
+ SUBROUTINE check_thorsen()
+ REAL(wp), ALLOCATABLE :: ta(:, :), tb(:, :)
+ INTEGER :: na, nb, i0
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ REAL(wp) :: am, aq, pv, ps
+ CALL write_deck('vcd_q.dat', NEUTRAL, 'riser 0.31 0.89', 90.0_wp, power=.TRUE.)
+ CALL run('vcd_q.dat', 'vcd_q', ok, msg)
+ CALL require(ok, 'D3: the Thorsen deck runs: '//TRIM(msg))
+ CALL read_out('vcd_q.out', ta, na, 6)
+ CALL read_out('vcd_morison.out', tb, nb, 3)
+ IF (na < 100 .OR. nb < 100) RETURN
+ i0 = na - 2000
+ aq = 0.5_wp*(MAXVAL(ta(2, i0:na)) - MINVAL(ta(2, i0:na)))/D
+ am = 0.5_wp*(MAXVAL(tb(2, nb - 1000:nb)) - MINVAL(tb(2, nb - 1000:nb)))/D
+ WRITE (*, '(A,F8.4,A,F8.4)') 'D3 steady A/D with Thorsen''s damping ', aq, ', with Morison''s ', am
+ CALL require(aq > 1.02_wp*am, 'D3: the quadratic cross-flow damping is weaker at this amplitude')
+ pv = SUM(ta(4, i0:na))/REAL(na - i0 + 1, wp)
+ ps = SUM(ta(4, i0:na) + ta(5, i0:na) + ta(6, i0:na))/REAL(na - i0 + 1, wp)
+ WRITE (*, '(A,2ES12.4)') 'D4 mean VIV power and mean VIV + drag + damping power: ', pv, ps
+ CALL require(pv > 0.0_wp .AND. ABS(ps) <= 1.0e-2_wp*pv, 'D4: the load powers balance with the split drag')
+ END SUBROUTINE check_thorsen
+
+ SUBROUTINE refuse(label, amp_rows, damp_rows, expect, ei)
+ CHARACTER(*), INTENT(IN) :: label, amp_rows, damp_rows, expect
+ CHARACTER(*), INTENT(IN), OPTIONAL :: ei
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ IF (PRESENT(ei)) THEN
+ CALL write_deck('vcd_refuse.dat', amp_rows, damp_rows, 0.0_wp, ei=ei)
+ ELSE
+ CALL write_deck('vcd_refuse.dat', amp_rows, damp_rows, 0.0_wp)
+ END IF
+ CALL run('vcd_refuse.dat', 'vcd_refuse', ok, msg)
+ WRITE (*, '(A)') 'D5 '//label//': '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, expect) > 0, 'D5: '//label)
+ END SUBROUTINE refuse
+
+ SUBROUTINE check_refusals()
+ CALL refuse('no amplitude table', '', 'riser 0.31 0.89', 'give the type Cl > 0 and a VIV AMPLITUDE table')
+ CALL refuse('an EI = 0 line', NEUTRAL, 'riser 0.31 0.89', 'acts on finite-EI cables (EI > 0) only', ei='0.0')
+ CALL refuse('a malformed row', NEUTRAL, 'riser 0.31', 'rows must be: TypeName a b [c]')
+ CALL refuse('a negative coefficient', NEUTRAL, 'riser -0.1 0.89', 'needs a, b and c >= 0')
+ CALL refuse('a type named twice', NEUTRAL, 'riser 0.31 0.89;riser 0 0 1', 'twice')
+ CALL refuse('an undefined type', NEUTRAL, 'cable 0.31 0.89', 'undefined LINE TYPE')
+ END SUBROUTINE check_refusals
+
+END PROGRAM test_viv_cf_damping_deck
diff --git a/tests/test_viv_cf_damping_kernel.f90 b/tests/test_viv_cf_damping_kernel.f90
new file mode 100644
index 00000000..e23bb4c5
--- /dev/null
+++ b/tests/test_viv_cf_damping_kernel.f90
@@ -0,0 +1,150 @@
+! File: tests/test_viv_cf_damping_kernel.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_cf_damping_kernel
+ !! The split drag of Thorsen et al. (2016) per unit length (CD_Morison_Drag_Split_Per_Length_Jac):
+ !! K1 a point at rest in a steady flow: the split force is Morison's, whatever cdy (w = U e_x);
+ !! K2 a cross-flow velocity y' across the flow: the cross-flow force is
+ !! 1/2 rho D cdy |w_y| w_y (w_y = -y'), the in-line force Morison's with the full |w|, and
+ !! the blend beta = U^2/(U^2 + u_ref^2) mixes it with Morison's;
+ !! K3 no ambient normal flow (still water, or a flow along the tangent): Morison's drag, bit for
+ !! bit; and with cdy = 0 and cdy_lin = cdn, the split recombines Morison's drag in a flow;
+ !! K4 the Jacobians against central differences of the force: in the relative velocity and in
+ !! the (non-unit) tangent vector, with tangential relative flow, cdy /= cdn, a Morison-form
+ !! cross-flow term (cdy_lin) and U ~ u_ref;
+ !! K5 bad inputs refused by name.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_Hydro, ONLY: CD_Morison_Drag_Split_Per_Length_Jac, CD_Morison_Drag_Per_Length_Jac, CD_HYDRO_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: RHO = 1025.0_wp, DIAM = 0.1_wp, CDN = 1.2_wp, CDT = 0.3_wp, CDY = 0.55_wp
+ INTEGER :: nfail = 0
+
+ CALL check_at_rest()
+ CALL check_crossflow()
+ CALL check_no_flow()
+ CALL check_jacobians()
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: split cross-flow drag kernel'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE check_at_rest()
+ REAL(wp) :: amb(3), tg(3), fs(3), fm(3)
+ INTEGER :: es
+ CHARACTER(200) :: em
+ amb = [0.3_wp, 0.8_wp, 0.1_wp]
+ tg = [1.0_wp, 0.2_wp, -0.1_wp]
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(amb, amb, tg, RHO, DIAM, CDN, CDY, CDT, 0.01_wp, fs, &
+ ErrStat=es, ErrMsg=em)
+ CALL require(es == CD_HYDRO_OK, 'K1: split call: '//TRIM(em))
+ CALL CD_Morison_Drag_Per_Length_Jac(amb, tg, RHO, DIAM, CDN, CDT, fm, ErrStat=es, ErrMsg=em)
+ WRITE (*, '(A,ES10.2)') 'K1 at rest: |split - Morison|/|Morison| ', NORM2(fs - fm)/NORM2(fm)
+ CALL require(NORM2(fs - fm) <= 1.0e-13_wp*NORM2(fm), 'K1: a point at rest feels Morison drag')
+ END SUBROUTINE check_at_rest
+
+ SUBROUTINE check_crossflow()
+ REAL(wp) :: amb(3), tg(3), v(3), rel(3), f(3), ex(3), ey(3), w(3), wm, beta, fy, fx, uref, u
+ INTEGER :: es
+ CHARACTER(200) :: em
+ u = 0.6_wp
+ amb = [0.0_wp, u, 0.0_wp]
+ tg = [2.0_wp, 0.0_wp, 0.0_wp]
+ ex = [0.0_wp, 1.0_wp, 0.0_wp]
+ ey = [0.0_wp, 0.0_wp, 1.0_wp] ! t x e_x = x x y = z
+ v = [0.0_wp, 0.1_wp, 0.35_wp] ! in-line 0.1, cross-flow 0.35
+ rel = amb - v
+ uref = 0.2_wp
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel, amb, tg, RHO, DIAM, CDN, CDY, CDT, uref, f, ErrStat=es, ErrMsg=em)
+ CALL require(es == CD_HYDRO_OK, 'K2: split call: '//TRIM(em))
+ w = [0.0_wp, rel(2), rel(3)]
+ wm = NORM2(w)
+ beta = u*u/(u*u + uref*uref)
+ fy = beta*0.5_wp*RHO*DIAM*CDY*ABS(rel(3))*rel(3) + (1.0_wp - beta)*0.5_wp*RHO*DIAM*CDN*wm*rel(3)
+ fx = 0.5_wp*RHO*DIAM*CDN*wm*rel(2)
+ WRITE (*, '(A,2ES12.4,A,2ES12.4)') 'K2 cross-flow: force (in line, across) ', DOT_PRODUCT(f, ex), &
+ DOT_PRODUCT(f, ey), ' expected ', fx, fy
+ CALL require(ABS(DOT_PRODUCT(f, ey) - fy) <= 1.0e-13_wp*ABS(fy), &
+ 'K2: the cross-flow force is the blended cdy |w_y| w_y')
+ CALL require(ABS(DOT_PRODUCT(f, ex) - fx) <= 1.0e-13_wp*ABS(fx), 'K2: the in-line force is Morison''s')
+ CALL require(ABS(f(1)) <= 1.0e-12_wp, 'K2: no tangential force without tangential flow')
+ END SUBROUTINE check_crossflow
+
+ SUBROUTINE check_no_flow()
+ REAL(wp) :: tg(3), rel(3), fs(3), fm(3), amb(3)
+ INTEGER :: es
+ CHARACTER(200) :: em
+ tg = [0.3_wp, -1.0_wp, 0.4_wp]
+ rel = [0.2_wp, 0.1_wp, -0.3_wp]
+ amb = 0.0_wp
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel, amb, tg, RHO, DIAM, CDN, CDY, CDT, 0.01_wp, fs, ErrStat=es, ErrMsg=em)
+ CALL CD_Morison_Drag_Per_Length_Jac(rel, tg, RHO, DIAM, CDN, CDT, fm, ErrStat=es, ErrMsg=em)
+ CALL require(ALL(fs == fm), 'K3: no ambient flow, Morison drag bit for bit')
+ amb = 0.7_wp*tg
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel, amb, tg, RHO, DIAM, CDN, CDY, CDT, 0.01_wp, fs, ErrStat=es, ErrMsg=em)
+ CALL require(ALL(fs == fm), 'K3: a flow along the tangent, Morison drag bit for bit')
+ amb = [0.1_wp, 0.6_wp, -0.2_wp]
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel, amb, tg, RHO, DIAM, CDN, 0.0_wp, CDT, 0.01_wp, fs, ErrStat=es, &
+ ErrMsg=em, cdy_lin=CDN)
+ WRITE (*, '(A,ES10.2)') 'K3 cdy 0, cdy_lin cdn: |split - Morison|/|Morison| ', NORM2(fs - fm)/NORM2(fm)
+ CALL require(es == CD_HYDRO_OK .AND. NORM2(fs - fm) <= 1.0e-13_wp*NORM2(fm), &
+ 'K3: cdy 0 and cdy_lin cdn recombine Morison''s drag')
+ END SUBROUTINE check_no_flow
+
+ SUBROUTINE check_jacobians()
+ REAL(wp) :: rel(3), amb(3), tg(3), f(3), fp(3), fmn(3), jr(3, 3), jt(3, 3), h, err_r, err_t, scale, d(3)
+ INTEGER :: es, k
+ CHARACTER(200) :: em
+ rel = [0.21_wp, 0.13_wp, -0.37_wp]
+ amb = [0.05_wp, 0.18_wp, 0.02_wp]
+ tg = [1.3_wp, -0.4_wp, 0.25_wp]
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel, amb, tg, RHO, DIAM, CDN, CDY, CDT, 0.12_wp, f, jr, jt, es, em, &
+ cdy_lin=0.7_wp)
+ CALL require(es == CD_HYDRO_OK, 'K4: split call with Jacobians: '//TRIM(em))
+ h = 1.0e-6_wp
+ err_r = 0.0_wp; err_t = 0.0_wp
+ scale = MAX(MAXVAL(ABS(jr)), MAXVAL(ABS(jt)))
+ DO k = 1, 3
+ d = 0.0_wp; d(k) = h
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel + d, amb, tg, RHO, DIAM, CDN, CDY, CDT, 0.12_wp, fp, ErrStat=es, &
+ ErrMsg=em, cdy_lin=0.7_wp)
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel - d, amb, tg, RHO, DIAM, CDN, CDY, CDT, 0.12_wp, fmn, ErrStat=es, &
+ ErrMsg=em, cdy_lin=0.7_wp)
+ err_r = MAX(err_r, MAXVAL(ABS((fp - fmn)/(2.0_wp*h) - jr(:, k))))
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel, amb, tg + d, RHO, DIAM, CDN, CDY, CDT, 0.12_wp, fp, ErrStat=es, &
+ ErrMsg=em, cdy_lin=0.7_wp)
+ CALL CD_Morison_Drag_Split_Per_Length_Jac(rel, amb, tg - d, RHO, DIAM, CDN, CDY, CDT, 0.12_wp, fmn, ErrStat=es, &
+ ErrMsg=em, cdy_lin=0.7_wp)
+ err_t = MAX(err_t, MAXVAL(ABS((fp - fmn)/(2.0_wp*h) - jt(:, k))))
+ END DO
+ WRITE (*, '(A,2ES10.2,A,ES10.2)') 'K4 Jacobians against central differences: rel, tangent ', err_r, err_t, &
+ ' (scale ', scale, ')'
+ CALL require(err_r <= 1.0e-7_wp*scale .AND. err_t <= 1.0e-7_wp*scale, 'K4: exact Jacobians')
+ END SUBROUTINE check_jacobians
+
+ SUBROUTINE check_refusals()
+ REAL(wp) :: f(3)
+ INTEGER :: es
+ CHARACTER(200) :: em
+ CALL CD_Morison_Drag_Split_Per_Length_Jac([0.1_wp, 0.0_wp, 0.0_wp], [0.0_wp, 0.5_wp, 0.0_wp], &
+ [1.0_wp, 0.0_wp, 0.0_wp], &
+ RHO, DIAM, CDN, -0.1_wp, CDT, 0.01_wp, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HYDRO_OK .AND. INDEX(em, 'non-negative') > 0, 'K5: a negative cdy refused')
+ CALL CD_Morison_Drag_Split_Per_Length_Jac([0.1_wp, 0.0_wp, 0.0_wp], [0.0_wp, 0.5_wp, 0.0_wp], &
+ [1.0_wp, 0.0_wp, 0.0_wp], &
+ RHO, DIAM, CDN, CDY, CDT, 0.0_wp, f, ErrStat=es, ErrMsg=em)
+ CALL require(es /= CD_HYDRO_OK .AND. INDEX(em, 'u_ref positive') > 0, 'K5: a zero u_ref refused')
+ END SUBROUTINE check_refusals
+
+END PROGRAM test_viv_cf_damping_kernel
diff --git a/tests/test_viv_coupled.f90 b/tests/test_viv_coupled.f90
index fd9aa2a6..cd15f601 100644
--- a/tests/test_viv_coupled.f90
+++ b/tests/test_viv_coupled.f90
@@ -12,6 +12,9 @@ PROGRAM test_viv_coupled
!! * lock-in: over 60-120 s the mid-span cross-flow amplitude of both lines is MoorDyn-F's
!! A/D 0.662 within 0.03 and the response frequency its 0.293 Hz within 0.01 Hz; with Cl = 0
!! the lines stay still (A/D below 0.01);
+ !! * load power (the VIVPow, DragPow and DampPow channels of each line): over the lock-in window
+ !! the VIV loads put power in, the drag takes it out, the damping power is never positive, and
+ !! their means balance within 1 % of the VIV power;
!! * checkpoint restart (the shell's rebuild recipe: a fresh instance takes the coupled
!! kinematics, each EI = 0 line's interior [v; q; a] and VIV block and each cable's mirror,
!! then the host field): the restarted run continues bit for bit, and a rebuild that skips the
@@ -23,15 +26,40 @@ PROGRAM test_viv_coupled
!! step: 0.5 s), and over 500 coupling steps when the deck has no dtM (5 s);
!! * phase seed: MoorDyn's 2 pi i/N with node i counted from the deck's End A, also on a deck
!! written anchor first (which the reader turns around) and, through CD_Deck_VIV_Phase_Seed,
- !! at the deck nodes of a refined mesh (added nodes interpolated in arc length).
+ !! at the deck nodes of a refined mesh (added nodes interpolated in arc length);
+ !! * in-line VIV (a VIV section, ClX 0.85, on both lines): the checkpoint blocks grow by the
+ !! in-line phase and mean squares (3 per node), the restarted run continues bit for bit with
+ !! both phases, a rebuild without the VIV state does not, and a rewound step repeats;
+ !! * wake oscillator (a WAKE OSCILLATOR row, C_L0 0.3, on both types, which have Cl 0): the
+ !! cable's checkpoint block grows by the wake state (2 per node), the EI = 0 riser carries it in
+ !! its VIV block (q in the phase, dq/dt in the first motion statistic), the restarted run
+ !! continues bit for bit with both, a rebuild without the VIV state does not, and a rewound step
+ !! repeats; with the wake filter (Tf 5 s) the cable's block carries the filtered velocity too
+ !! (5 per node) and the riser's VIV block its rows 3-5 (6 motion statistics per node), with the
+ !! same restart and rewind checks;
+ !! * amplitude tables (a VIV AMPLITUDE table on both types, Cv falling from 0.8 at A/D 0 to 0.4 at
+ !! 1, CdAmp from 1 to 1.5): both checkpoint blocks grow by the amplitude estimate (4 per node),
+ !! the restarted run continues bit for bit with it, a rebuild without the VIV state does not,
+ !! and a rewound step repeats; with the flow frame (VIV FRAME Tf 5 s on both types, and VIV
+ !! DAMPING on the cable) both blocks carry the filtered velocity too (3 more per node, 9 motion
+ !! 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; 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, &
CD_AGG_SetFluidFields, CD_AGG_Snapshot, CD_AGG_Restore
USE CableDyn_OpenFAST_HermiteFMF, ONLY: CD_HFMF_MirrorSize, CD_HFMF_VIVMirrorSize, CD_HFMF_PackMirror, &
CD_HFMF_UnpackMirror, CD_HFMF_OK
- USE CableDyn_DeckDriver, ONLY: CD_Deck_VIV_Phase_Seed
+ USE CableDyn_DeckDriver, ONLY: CD_Deck_VIV_Phase_Seed, CD_Eval_Aggregate_Channel, CD_DECKDRV_OK
USE CableDyn_System, ONLY: CD_System_NLines, CD_System_Line_NDOF, CD_Get_System_Line_State, &
CD_Update_System_Line_Interior_State, CD_System_Line_VIV_MirrorSize, &
CD_Get_System_Line_VIV_State, CD_Set_System_Line_VIV_State, CD_SYSTEM_OK
@@ -41,15 +69,68 @@ PROGRAM test_viv_coupled
REAL(wp), PARAMETER :: MD_AD = 0.662_wp, MD_F = 0.293_wp
INTEGER, PARAMETER :: MID = 26
INTEGER :: nfail
+ ! 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., cyc_case = .FALSE.
nfail = 0
CALL write_deck('viv_coupled.dat', 0.8_wp)
CALL write_deck('viv_coupled_nolift.dat', 0.0_wp)
+ CALL write_deck('viv_coupled_il.dat', 0.8_wp, inline=.TRUE.)
+ CALL write_deck('viv_coupled_wake.dat', 0.8_wp, wake=.TRUE.)
+ CALL write_deck('viv_coupled_wakef.dat', 0.8_wp, wake=.TRUE., wake_tf='5.0')
+ 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()
CALL case_rewind()
CALL case_window()
CALL case_seed()
+ deck_name = 'viv_coupled_il.dat'
+ il_case = .TRUE.
+ CALL case_restart()
+ CALL case_rewind()
+ deck_name = 'viv_coupled_wake.dat'
+ il_case = .FALSE.
+ wake_case = .TRUE.
+ CALL case_restart()
+ CALL case_rewind()
+ deck_name = 'viv_coupled_wakef.dat'
+ wakef_case = .TRUE.
+ CALL case_restart()
+ CALL case_rewind()
+ deck_name = 'viv_coupled_frame.dat'
+ wake_case = .FALSE.
+ wakef_case = .FALSE.
+ 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.
+ wakef_case = .FALSE.
+ amp_case = .TRUE.
+ CALL case_restart()
+ CALL case_rewind()
+ deck_name = 'viv_coupled_ampf.dat'
+ ampf_case = .TRUE.
+ CALL case_restart()
+ CALL case_rewind()
+ deck_name = 'viv_coupled_sto.dat'
+ amp_case = .FALSE.
+ ampf_case = .FALSE.
+ sto_case = .TRUE.
+ CALL case_restart()
+ CALL case_rewind()
IF (nfail > 0) THEN
WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' coupled VIV check(s) failed'
ERROR STOP 1
@@ -62,20 +143,44 @@ SUBROUTINE case_lockin()
!! 120 s in the host current; the response statistics over 60-120 s.
INTEGER, PARAMETER :: NSTEP = 12000, NSKIP = 6000
TYPE(CD_AGG_ModuleType) :: agg
- REAL(wp) :: zs(NSTEP - NSKIP, 2), ad(2), f(2)
+ REAL(wp) :: zs(NSTEP - NSKIP, 2), ad(2), f(2), pw(3, 2), pmax(2)
INTEGER :: pass, s, k
+ CHARACTER(8) :: pname(3) = ['VIVPow ', 'DragPow ', 'DampPow ']
CHARACTER(16) :: what(2) = ['EI = 0 riser ', 'finite-EI cable ']
DO pass = 1, 2
IF (.NOT. start(agg, MERGE('viv_coupled.dat ', 'viv_coupled_nolift.dat', pass == 1))) RETURN
DO s = 1, NSKIP
IF (.NOT. advance(agg)) RETURN
END DO
+ pw = 0.0_wp
+ pmax = -HUGE(1.0_wp)
DO s = 1, NSTEP - NSKIP
IF (.NOT. advance(agg)) RETURN
zs(s, 1) = agg%sys%fast%system%lines(1)%q(3*MID)
zs(s, 2) = agg%cables(1)%line%q(6*(MID - 1) + 3)
+ IF (pass == 2) CYCLE
+ DO k = 1, 2
+ BLOCK
+ REAL(wp) :: val
+ INTEGER :: j
+ DO j = 1, 3
+ IF (.NOT. channel(agg, TRIM(pname(j))//MERGE('1', '2', k == 1), val)) RETURN
+ pw(j, k) = pw(j, k) + val/REAL(NSTEP - NSKIP, wp)
+ IF (j == 3) pmax(k) = MAX(pmax(k), val)
+ END DO
+ END BLOCK
+ END DO
END DO
CALL finish(agg)
+ IF (pass == 1) THEN
+ DO k = 1, 2
+ WRITE (*, '(2A,3F9.4,A,ES10.2)') ' ', what(k), pw(:, k), ' W mean VIV/drag/damping power, balance/VIV ', &
+ SUM(pw(:, k))/pw(1, k)
+ CALL check(pw(1, k) > 0.0_wp .AND. pw(2, k) < 0.0_wp, TRIM(what(k))//': VIV power in, drag power out')
+ CALL check(pmax(k) <= 0.0_wp, TRIM(what(k))//': the damping power is never positive')
+ CALL check(ABS(SUM(pw(:, k))) <= 0.01_wp*pw(1, k), TRIM(what(k))//': the load powers balance within 1 %')
+ END DO
+ END IF
DO k = 1, 2
CALL response(zs(:, k), ad(k), f(k))
IF (pass == 1) THEN
@@ -90,13 +195,26 @@ SUBROUTINE case_lockin()
END DO
END SUBROUTINE case_lockin
+ LOGICAL FUNCTION channel(agg, name, val) RESULT(ok)
+ !! One deck channel of the aggregate at its committed state (the shells' evaluator).
+ TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg
+ CHARACTER(*), INTENT(IN) :: name
+ REAL(wp), INTENT(OUT) :: val
+ INTEGER :: es
+ CHARACTER(512) :: em
+ CALL CD_Eval_Aggregate_Channel(name, agg%has_sys, agg%sys%fast%system, agg%cables, agg%line_is_cable, &
+ agg%line_obj_index, val, es, em, cable_points=agg%cable_points)
+ ok = es == CD_DECKDRV_OK
+ CALL check(ok, name//': '//TRIM(em))
+ END FUNCTION channel
+
SUBROUTINE case_restart()
!! Checkpoint after 10 s, while the lock-in builds up; 50 steps on.
INTEGER, PARAMETER :: NPRE = 1000, NPOST = 50
TYPE(CD_AGG_ModuleType) :: a, b, c
INTEGER :: s
LOGICAL :: same_b, same_c
- IF (.NOT. start(a, 'viv_coupled.dat')) RETURN
+ IF (.NOT. start(a, TRIM(deck_name))) RETURN
DO s = 1, NPRE
IF (.NOT. advance(a)) RETURN
END DO
@@ -111,8 +229,8 @@ SUBROUTINE case_restart()
same_b = same_b .AND. identical(a, b)
same_c = same_c .AND. identical(a, c)
END DO
- CALL check(same_b, 'the restarted run continues bit for bit')
- CALL check(.NOT. same_c, 'a restart without the VIV state does not')
+ CALL check(same_b, TRIM(deck_name)//': the restarted run continues bit for bit')
+ CALL check(.NOT. same_c, TRIM(deck_name)//': a restart without the VIV state does not')
CALL finish(a)
CALL finish(b)
CALL finish(c)
@@ -123,8 +241,8 @@ SUBROUTINE case_rewind()
TYPE(CD_AGG_ModuleType) :: a, b
INTEGER :: s, es
CHARACTER(512) :: em
- IF (.NOT. start(a, 'viv_coupled.dat')) RETURN
- IF (.NOT. start(b, 'viv_coupled.dat')) RETURN
+ IF (.NOT. start(a, TRIM(deck_name))) RETURN
+ IF (.NOT. start(b, TRIM(deck_name))) RETURN
DO s = 1, 500
IF (.NOT. advance(a)) RETURN
IF (.NOT. advance(b)) RETURN
@@ -138,7 +256,7 @@ SUBROUTINE case_rewind()
IF (.NOT. advance(a)) RETURN
IF (.NOT. advance(b)) RETURN
END DO
- CALL check(identical(a, b), 'a rewound step repeats bit for bit')
+ CALL check(identical(a, b), TRIM(deck_name)//': a rewound step repeats bit for bit')
CALL CD_AGG_End(a, es, em)
CALL CD_AGG_End(b, es, em)
END SUBROUTINE case_rewind
@@ -285,7 +403,7 @@ LOGICAL FUNCTION rebuild(a, b, with_viv) RESULT(ok)
fresh(:)
INTEGER :: es, npt, il, ndof, nv, nvc
CHARACTER(512) :: em
- ok = start(b, 'viv_coupled.dat')
+ ok = start(b, TRIM(deck_name))
IF (.NOT. ok) RETURN
npt = CD_AGG_NMovingPoints(a, es, em)
ALLOCATE (pos(3, npt), vel(3, npt), acc(3, npt), load(3, npt))
@@ -300,7 +418,11 @@ LOGICAL FUNCTION rebuild(a, b, with_viv) RESULT(ok)
a_interior=aL(4:ndof - 3))
ok = ok .AND. es == CD_SYSTEM_OK
nv = CD_System_Line_VIV_MirrorSize(a%sys%fast%system, il)
- ok = ok .AND. nv == 3*(ndof/3) + 1
+ ! per node the phases and mean squares, the further motion statistics and, on a
+ ! 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(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)
@@ -313,7 +435,10 @@ LOGICAL FUNCTION rebuild(a, b, with_viv) RESULT(ok)
ALLOCATE (buf(CD_HFMF_MirrorSize(a%cables(1))), fresh(CD_HFMF_MirrorSize(b%cables(1))))
CALL CD_HFMF_PackMirror(a%cables(1), buf, es, em)
nvc = CD_HFMF_VIVMirrorSize(a%cables(1))
- ok = ok .AND. nvc == 3*a%cables(1)%line%nn + 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(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)
@@ -325,12 +450,44 @@ LOGICAL FUNCTION rebuild(a, b, with_viv) RESULT(ok)
END FUNCTION rebuild
LOGICAL FUNCTION identical(a, b) RESULT(same)
- !! Both lines' state and shedding phases are the same bits.
+ !! Both lines' state and shedding phases (in-line too in the in-line case) are the same bits.
TYPE(CD_AGG_ModuleType), INTENT(IN) :: a, b
same = MAXVAL(ABS(a%sys%fast%system%lines(1)%q - b%sys%fast%system%lines(1)%q)) <= 0.0_wp .AND. &
MAXVAL(ABS(a%sys%fast%system%lines(1)%viv_phi - b%sys%fast%system%lines(1)%viv_phi)) <= 0.0_wp .AND. &
MAXVAL(ABS(a%cables(1)%line%q - b%cables(1)%line%q)) <= 0.0_wp .AND. &
MAXVAL(ABS(a%cables(1)%line%viv_phi - b%cables(1)%line%viv_phi)) <= 0.0_wp
+ IF (same .AND. wakef_case) same = a%cables(1)%line%wo_filter .AND. SIZE(a%cables(1)%line%wo_s, 1) == 5 .AND. &
+ a%sys%fast%system%lines(1)%wo_filter .AND. &
+ SIZE(a%sys%fast%system%lines(1)%viv_ms, 1) == 6
+ IF (same .AND. wake_case) same = a%cables(1)%line%viv_wake .AND. &
+ MAXVAL(ABS(a%cables(1)%line%wo_s - b%cables(1)%line%wo_s)) <= 0.0_wp .AND. &
+ a%sys%fast%system%lines(1)%viv_wake .AND. &
+ MAXVAL(ABS(a%sys%fast%system%lines(1)%viv_ms - &
+ b%sys%fast%system%lines(1)%viv_ms)) <= 0.0_wp
+ IF (same .AND. frame_case) THEN
+ ! 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 + 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
+ IF (same .AND. amp_case) THEN
+ ! the motion statistics with the amplitude estimate (rows 3-6) on both lines
+ same = a%sys%fast%system%lines(1)%has_viv_amp .AND. a%cables(1)%line%has_viv_amp .AND. &
+ SIZE(a%cables(1)%line%viv_ms, 1) == MERGE(10, 7, ampf_case) .AND. &
+ SIZE(a%sys%fast%system%lines(1)%viv_ms, 1) == MERGE(10, 7, ampf_case) .AND. &
+ (a%cables(1)%line%viv_frame .EQV. ampf_case) .AND. &
+ (a%sys%fast%system%lines(1)%viv_frame .EQV. ampf_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
+ IF (.NOT. (same .AND. il_case)) RETURN
+ same = a%sys%fast%system%lines(1)%has_viv_il .AND. a%cables(1)%line%has_viv_il .AND. &
+ MAXVAL(ABS(a%sys%fast%system%lines(1)%vil_phi - b%sys%fast%system%lines(1)%vil_phi)) <= 0.0_wp .AND. &
+ MAXVAL(ABS(a%cables(1)%line%vil_phi - b%cables(1)%line%vil_phi)) <= 0.0_wp
END FUNCTION identical
SUBROUTINE response(z, ad, f)
@@ -355,27 +512,39 @@ SUBROUTINE response(z, ad, f)
IF (n > 1) f = REAL(n - 1, wp)/(t1 - t0)
END SUBROUTINE response
- SUBROUTINE write_deck(path, cl, window, dtm, anchor_first)
+ SUBROUTINE write_deck(path, cl, window, dtm, anchor_first, inline, wake, amp, wake_tf, damp, sto)
!! The EI = 0 riser (line 1) and the finite-EI cable (line 2), 20 m apart across the current;
- !! VIVrmsWindow 0.25 s unless window is given (0: none), and a deck dtM when dtm is given.
+ !! VIVrmsWindow 0.25 s unless window is given (0: none), and a deck dtM when dtm is given;
+ !! inline adds the in-line VIV of both types (a VIV section, ClX 0.85); wake gives both types
+ !! the wake oscillator instead of their lift (Cl 0 and WAKE OSCILLATOR rows, C_L0 0.3); amp a VIV
+ !! AMPLITUDE table on both types; damp Thorsen's cross-flow damping (VIV DAMPING 0.31 0.89) on the
+ !! cable.
CHARACTER(*), INTENT(IN) :: path
REAL(wp), INTENT(IN) :: cl
REAL(wp), INTENT(IN), OPTIONAL :: window, dtm
- LOGICAL, INTENT(IN), OPTIONAL :: anchor_first
+ LOGICAL, INTENT(IN), OPTIONAL :: anchor_first, inline, wake, amp, damp
+ ! the VIV FRAME filter time Tf of both types (no section without it)
+ CHARACTER(*), INTENT(IN), OPTIONAL :: wake_tf
+ ! the VIV STOCHASTIC values (sigma c Nf seed) of both types (no section without them)
+ CHARACTER(*), INTENT(IN), OPTIONAL :: sto
INTEGER :: u
- LOGICAL :: stock
+ LOGICAL :: stock, wo
REAL(wp) :: tw
- CHARACTER(32) :: len_txt, cl_txt
+ CHARACTER(32) :: len_txt, cl_txt, clc_txt
WRITE (len_txt, '(F12.6)') 100.0_wp/(1.0_wp + 5.0e4_wp/5.0e7_wp)
WRITE (cl_txt, '(F4.2)') cl
+ wo = .FALSE.
+ IF (PRESENT(wake)) wo = wake
+ clc_txt = cl_txt
+ IF (wo) clc_txt = '0.00'
OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
WRITE (u, '(A)') '--------------------- CableDyn Input File ---'
WRITE (u, '(A)') 'coupled VIV gate: taut riser and cable in a host cross current'
WRITE (u, '(A)') '--------------------- LINE TYPES ---'
WRITE (u, '(A)') 'TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx Cl dF cF'
WRITE (u, '(A)') '(name) (m) (kg/m) (N) (N-s/-) (-) (-) (-) (-) (-) (-) (-) (-)'
- WRITE (u, '(A)') 'riser 0.10 10.0 5.0e7 -0.8 0.0 1.2 1.0 0.0 0.0 '//TRIM(cl_txt)//' 0.08 0.18'
- WRITE (u, '(A)') 'cable 0.10 10.0 5.0e7 -0.8 1.0 1.2 1.0 0.0 0.0 '//TRIM(cl_txt)//' 0.08 0.18'
+ WRITE (u, '(A)') 'riser 0.10 10.0 5.0e7 -0.8 0.0 1.2 1.0 0.0 0.0 '//TRIM(clc_txt)//' 0.08 0.18'
+ WRITE (u, '(A)') 'cable 0.10 10.0 5.0e7 -0.8 1.0 1.2 1.0 0.0 0.0 '//TRIM(clc_txt)//' 0.08 0.18'
WRITE (u, '(A)') '--------------------- POINTS ---'
WRITE (u, '(A)') 'ID Attachment X Y Z M V CdA CA'
WRITE (u, '(A)') '(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)'
@@ -396,6 +565,54 @@ SUBROUTINE write_deck(path, cl, window, dtm, anchor_first)
WRITE (u, '(A)') '1 riser 1 2 '//TRIM(ADJUSTL(len_txt))//' 50 -'
WRITE (u, '(A)') '2 cable 3 4 '//TRIM(ADJUSTL(len_txt))//' 50 -'
END IF
+ IF (PRESENT(inline)) THEN
+ IF (inline) THEN
+ WRITE (u, '(A)') '--------------------- VIV ---'
+ WRITE (u, '(A)') 'TypeName ClX alpha'
+ WRITE (u, '(A)') '(name) (-) (-)'
+ WRITE (u, '(A)') 'riser 0.85 0.15'
+ WRITE (u, '(A)') 'cable 0.85 0.15'
+ END IF
+ END IF
+ IF (wo) THEN
+ WRITE (u, '(A)') '--------------------- WAKE OSCILLATOR ---'
+ WRITE (u, '(A)') 'TypeName CL0 St eps A'
+ WRITE (u, '(A)') 'riser 0.3 0.2 0.3 12'
+ WRITE (u, '(A)') 'cable 0.3 0.2 0.3 12'
+ END IF
+ IF (PRESENT(amp)) THEN
+ IF (amp) THEN
+ WRITE (u, '(A)') '--------------------- VIV AMPLITUDE ---'
+ WRITE (u, '(A)') 'TypeName AD Cv CdAmp'
+ WRITE (u, '(A)') 'riser 0.0 0.8 1.0'
+ WRITE (u, '(A)') 'riser 1.0 0.4 1.5'
+ WRITE (u, '(A)') 'cable 0.0 0.8 1.0'
+ WRITE (u, '(A)') 'cable 1.0 0.4 1.5'
+ END IF
+ END IF
+ IF (PRESENT(damp)) THEN
+ IF (damp) THEN
+ WRITE (u, '(A)') '--------------------- VIV DAMPING ---'
+ WRITE (u, '(A)') 'TypeName a b'
+ WRITE (u, '(A)') 'cable 0.31 0.89'
+ END IF
+ END IF
+ IF (PRESENT(wake_tf)) THEN
+ WRITE (u, '(A)') '--------------------- VIV FRAME ---'
+ 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
+ IF (PRESENT(sto)) THEN
+ WRITE (u, '(A)') '--------------------- VIV STOCHASTIC ---'
+ WRITE (u, '(A)') 'TypeName sigma c Nf seed'
+ WRITE (u, '(A)') 'riser '//sto
+ WRITE (u, '(A)') 'cable '//sto
+ END IF
WRITE (u, '(A)') '--------------------- OPTIONS ---'
WRITE (u, '(A)') '100.0 WtrDpth'
WRITE (u, '(A)') '1025.0 rhoW'
diff --git a/tests/test_viv_cycle_frame.f90 b/tests/test_viv_cycle_frame.f90
new file mode 100644
index 00000000..403ba8c9
--- /dev/null
+++ b/tests/test_viv_cycle_frame.f90
@@ -0,0 +1,177 @@
+! 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, 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
+ 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 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')
+ 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_diameter_deck.f90 b/tests/test_viv_diameter_deck.f90
new file mode 100644
index 00000000..c9a6eb48
--- /dev/null
+++ b/tests/test_viv_diameter_deck.f90
@@ -0,0 +1,270 @@
+! File: tests/test_viv_diameter_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_diameter_deck
+ !! The diameter of the VIV model on a deck (the optional VIV DIAMETER section, rows TypeName
+ !! Dviv): the taut gate line (100 m, Diam 0.1 m, 50 kN, pinned at 50 m depth, 50 elements) in a
+ !! uniform 0.15 m/s current along y, as a finite-EI cable
+ !! (EI 1 N m^2) and as an EI = 0 line:
+ !! D1 Dviv equal to the type's Diam is the deck without the section, to the printed digits;
+ !! D2 with the synchronisation lift (Cl 0.8, cF 0.18, dF 0.08) the deck locks in near the first
+ !! mode (cF U/Diam = 0.27 Hz, the lock-in at 0.287 Hz); with Dviv 0.2 m the shedding band
+ !! (cF -+ dF) U/Dviv, 0.075-0.195 Hz, lies below that mode, where the motion lags the lift by
+ !! less than a quarter period and the phase runs at the top of the band, 0.195 Hz (within
+ !! 0.005 Hz), on both line kinds;
+ !! D3 a wake oscillator uncoupled from the cable (A 0, St 0.2) drives the finite-EI cable at
+ !! St U/Dviv = 0.15 Hz with Dviv 0.2 m (within 0.005 Hz), half the 0.30 Hz of Diam;
+ !! D4 refusals by name: a malformed row, an unknown or repeated type, a value out of range, and a
+ !! type without VIV (a row with no number is a header row, as in every table section).
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, D = 0.1_wp
+ INTEGER :: nfail = 0
+
+ CALL write_current('vdd_current.dat')
+ CALL check_kind('1.0', 'finite-EI')
+ CALL check_kind('0.0', 'EI = 0')
+ CALL check_wake()
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: VIV diameter deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the VIV diameter deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_deck(path, dia_rows, tmax, ei, cl, wake_row)
+ !! dia_rows: the VIV DIAMETER section's data rows, ';'-separated ('' for no section); ei the
+ !! type's EI, cl its LINE TYPES Cl (default 0.8); wake_row a WAKE OSCILLATOR row.
+ CHARACTER(*), INTENT(IN) :: path, dia_rows, ei
+ REAL(wp), INTENT(IN) :: tmax
+ CHARACTER(*), INTENT(IN), OPTIONAL :: cl, wake_row
+ CHARACTER(32) :: cl_col
+ INTEGER :: u, i0, i1
+ cl_col = '0.8'
+ IF (PRESENT(cl)) cl_col = cl
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'VIV diameter deck gate: taut cable in a uniform current'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ 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 '//TRIM(ei)//' 1.2 1.0 0.0 0.0 '// &
+ TRIM(cl_col)//' 0.08 0.18'
+ WRITE (u, '(A)') 'bare 0.10 10.0 5.0e7 -0.8 '//TRIM(ei)//' 1.2 1.0 0.0 0.0 0.0'
+ 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'
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ 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 (PRESENT(wake_row)) THEN
+ WRITE (u, '(A)') '----------------------- WAKE OSCILLATOR -------------------------------------'
+ WRITE (u, '(A)') 'TypeName CL0 St eps A'
+ WRITE (u, '(A)') wake_row
+ END IF
+ IF (LEN_TRIM(dia_rows) > 0) THEN
+ WRITE (u, '(A)') '----------------------- VIV DIAMETER ----------------------------------------'
+ WRITE (u, '(A)') 'TypeName Dviv'
+ WRITE (u, '(A)') '(-) (m)'
+ i0 = 1
+ DO
+ i1 = INDEX(dia_rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(dia_rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') dia_rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '0.01 dtM'
+ WRITE (u, '(A)') '100.0 WtrDpth'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') 'vdd_current.dat WaterKin'
+ WRITE (u, '(A,F8.3,A)') ' ', tmax, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (u, '(A)') 'L1N26PZ'
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, tab, n)
+ !! The rows (time, L1N26PZ) of a deck's main output file.
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(1024) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(2, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ REAL(wp) FUNCTION peak_frequency(tt, x) RESULT(fpk)
+ !! The frequency of the largest Fourier amplitude of x - mean(x) on 0.05-1 Hz (0.001 Hz grid).
+ REAL(wp), INTENT(IN) :: tt(:), x(:)
+ REAL(wp) :: xm(SIZE(x)), f, best, re, im
+ INTEGER :: j
+ xm = x - SUM(x)/REAL(SIZE(x), wp)
+ best = -1.0_wp
+ fpk = 0.0_wp
+ DO j = 0, 950
+ f = 0.05_wp + 0.001_wp*REAL(j, wp)
+ re = SUM(xm*COS(2.0_wp*PI*f*tt))
+ im = SUM(xm*SIN(2.0_wp*PI*f*tt))
+ IF (re*re + im*im > best) THEN
+ best = re*re + im*im
+ fpk = f
+ END IF
+ END DO
+ END FUNCTION peak_frequency
+
+ SUBROUTINE window_stats(tab, n, t0, ad, f)
+ !! Half peak-to-peak mid-span cross-flow amplitude over D and dominant frequency from t0 on.
+ REAL(wp), INTENT(IN) :: tab(:, :), t0
+ INTEGER, INTENT(IN) :: n
+ REAL(wp), INTENT(OUT) :: ad, f
+ LOGICAL :: keep(n)
+ REAL(wp), ALLOCATABLE :: tt(:), z(:)
+ keep = tab(1, 1:n) >= t0
+ tt = PACK(tab(1, 1:n), keep)
+ z = PACK(tab(2, 1:n), keep)
+ ad = 0.5_wp*(MAXVAL(z) - MINVAL(z))/D
+ f = peak_frequency(tt, z)
+ END SUBROUTINE window_stats
+
+ SUBROUTINE check_kind(ei, label)
+ CHARACTER(*), INTENT(IN) :: ei, label
+ CHARACTER(16) :: tag
+ REAL(wp), ALLOCATABLE :: tn(:, :), ts(:, :), tb(:, :)
+ INTEGER :: nn, ns, nb
+ REAL(wp) :: ad_n, f_n, ad_b, f_b
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ tag = MERGE('fe', 'e0', ei /= '0.0')
+ CALL write_deck('vdd_'//TRIM(tag)//'_none.dat', '', 100.0_wp, ei)
+ CALL run('vdd_'//TRIM(tag)//'_none.dat', 'vdd_'//TRIM(tag)//'_none', ok, msg)
+ CALL require(ok, 'D1 ('//label//'): the deck without the section runs: '//TRIM(msg))
+ CALL write_deck('vdd_'//TRIM(tag)//'_same.dat', 'riser 0.10', 100.0_wp, ei)
+ CALL run('vdd_'//TRIM(tag)//'_same.dat', 'vdd_'//TRIM(tag)//'_same', ok, msg)
+ CALL require(ok, 'D1 ('//label//'): the Dviv = Diam deck runs: '//TRIM(msg))
+ CALL write_deck('vdd_'//TRIM(tag)//'_big.dat', 'riser 0.2', 100.0_wp, ei)
+ CALL run('vdd_'//TRIM(tag)//'_big.dat', 'vdd_'//TRIM(tag)//'_big', ok, msg)
+ CALL require(ok, 'D2 ('//label//'): the Dviv 0.2 deck runs: '//TRIM(msg))
+ CALL read_out('vdd_'//TRIM(tag)//'_none.out', tn, nn)
+ CALL read_out('vdd_'//TRIM(tag)//'_same.out', ts, ns)
+ CALL read_out('vdd_'//TRIM(tag)//'_big.out', tb, nb)
+ CALL require(nn > 5000 .AND. ns == nn .AND. nb == nn, 'D1 ('//label//'): the runs wrote matching rows')
+ IF (.NOT. (nn > 5000 .AND. ns == nn .AND. nb == nn)) RETURN
+ CALL require(ALL(ts(:, 1:ns) == tn(:, 1:nn)), 'D1 ('//label//'): Dviv = Diam is the deck without the section')
+ CALL window_stats(tn, nn, 60.0_wp, ad_n, f_n)
+ CALL window_stats(tb, nb, 60.0_wp, ad_b, f_b)
+ WRITE (*, '(A,2F8.4,A,2F8.4)') 'D2 ('//label//'): A/D, f [Hz] with Diam ', ad_n, f_n, '; with Dviv 0.2 ', &
+ ad_b, f_b
+ CALL require(ABS(f_n - 0.28_wp) <= 0.02_wp, 'D2 ('//label//'): with Diam the line locks in near its first mode')
+ CALL require(ABS(f_b - 0.195_wp) <= 0.005_wp, 'D2 ('//label//'): with Dviv 0.2 the phase runs at the top of '// &
+ 'its band, (cF + dF) U/Dviv')
+ END SUBROUTINE check_kind
+
+ SUBROUTINE check_wake()
+ REAL(wp), ALLOCATABLE :: tw(:, :)
+ INTEGER :: nw
+ REAL(wp) :: ad, f
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('vdd_wake.dat', 'riser 0.2', 100.0_wp, '1.0', cl='0.0', wake_row='riser 0.3 0.2 0.3 0.0')
+ CALL run('vdd_wake.dat', 'vdd_wake', ok, msg)
+ CALL require(ok, 'D3: the uncoupled wake-oscillator deck with Dviv 0.2 runs: '//TRIM(msg))
+ CALL read_out('vdd_wake.out', tw, nw)
+ CALL require(nw > 5000, 'D3: the run wrote its rows')
+ IF (nw <= 5000) RETURN
+ CALL window_stats(tw, nw, 50.0_wp, ad, f)
+ WRITE (*, '(A,2F8.4)') 'D3: uncoupled wake, Dviv 0.2: A/D, f [Hz] ', ad, f
+ CALL require(ABS(f - 0.15_wp) <= 0.005_wp, 'D3: the wake drives the cable at St U/Dviv')
+ END SUBROUTINE check_wake
+
+ SUBROUTINE check_refusals()
+ CALL refused('riser 0.2 0.3', 'TypeName Dviv', 'a row of three columns')
+ CALL refused('cable 0.2', 'undefined LINE TYPE', 'an unknown type')
+ CALL refused('riser 0.2;riser 0.3', 'twice', 'a repeated type')
+ CALL refused('riser 0.0', 'Dviv > 0', 'a zero Dviv')
+ CALL refused('riser -0.2', 'Dviv > 0', 'a negative Dviv')
+ CALL refused('bare 0.2', 'give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row', 'a type without VIV')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE refused(rows, needle, what)
+ CHARACTER(*), INTENT(IN) :: rows, needle, what
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('vdd_bad.dat', rows, 1.0_wp, '1.0')
+ CALL run('vdd_bad.dat', 'vdd_bad', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, needle) > 0, 'D4: '//what//' is refused: '//TRIM(msg))
+ END SUBROUTINE refused
+
+END PROGRAM test_viv_diameter_deck
diff --git a/tests/test_viv_frame_deck.f90 b/tests/test_viv_frame_deck.f90
new file mode 100644
index 00000000..a510dc15
--- /dev/null
+++ b/tests/test_viv_frame_deck.f90
@@ -0,0 +1,445 @@
+! File: tests/test_viv_frame_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_frame_deck
+ !! The VIV FRAME section (TypeName Tf) on the synchronisation model: with Tf > 0 the motion of the
+ !! phases (the cable's velocity relative to its velocity low-pass filtered over Tf), the amplitude
+ !! estimate (and so the VIV AMPLITUDE coefficients Cv and CdAmp) and the axes and blend of the
+ !! VIV DAMPING split take the cable's filtered motion as their frame. The cable is the taut cable
+ !! of the VIV amplitude and damping gates (100 m, D 0.1 m, 50 kN, pinned at 50 m depth, 50
+ !! elements, Cl 0.8), its type with the lift alone, or ("tables") with a VIV AMPLITUDE table (Cv
+ !! 0.8, 0.6, 0.0 and CdAmp 1.0, 1.3, 1.6 at A/D 0, 0.5, 1) and, on the finite-EI cable (EI 1
+ !! N m^2), Thorsen's VIV DAMPING (0.31 0.89).
+ !! G1 a Tf 0 row is the deck without the section, bit for bit, on the finite-EI cable and on the
+ !! EI = 0 line, with and without the tables;
+ !! G2 the finite-EI cable towed through still water (both ends at 0.15 m/s against y after a
+ !! 10 s half-cosine ramp) with Tf 10 s responds as the cable held in a 0.15 m/s current: the
+ !! A/D over 50-80 s within 1 % of the held cable's (measured 0.25 % with the tables, 0.15 %
+ !! with the lift alone) and within 0.2 % of the held cable's with Tf 10 s (measured 0.01 %;
+ !! the frame moves at a constant velocity, so the two are the same problem), the frequency
+ !! within 0.005 and 0.0015 Hz (the 30 s window resolves 0.033 Hz; the scan peak moves by
+ !! 0.002 Hz). With the tables the towed cable without the frame takes Cv and CdAmp at A/D 0
+ !! and the Morison drag (no ambient flow) and responds otherwise (A/D more than 10 % off;
+ !! measured 16 %); with the lift alone it is reported (2.0 % off);
+ !! G3 held in the current, Tf 10 s leaves the response as the ambient flow gives it (A/D within
+ !! 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);
+ !! 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
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, D = 0.1_wp
+ CHARACTER(*), PARAMETER :: AMP = 'riser 0.0 0.8 1.0;riser 0.5 0.6 1.3;riser 1.0 0.0 1.6'
+ REAL(wp), PARAMETER :: TMAX = 80.0_wp, T0 = 50.0_wp
+ INTEGER :: nfail = 0
+ REAL(wp) :: fe_cur(2), fe_cur_tf(2), l_cur(2), l_cur_tf(2), fs_cur(2), fs_cur_tf(2), ls_cur(2), ls_cur_tf(2)
+ ! the agreement of the towed cable with the held one, without and with Tf (G2)
+ REAL(wp), PARAMETER :: TOL_TOW = 0.01_wp, TOL_TOW_TF = 0.002_wp
+
+ CALL write_current('vfd_current.dat')
+ CALL write_tow('vfd_tow.txt')
+ CALL check_fixed('1.0', AMP, 'riser 0.31 0.89', 'vfd_fe', fe_cur, fe_cur_tf)
+ CALL check_fixed('0.0', AMP, '', 'vfd_l', l_cur, l_cur_tf)
+ CALL check_fixed('1.0', '', '', 'vfd_fs', fs_cur, fs_cur_tf)
+ CALL check_fixed('0.0', '', '', 'vfd_ls', ls_cur, ls_cur_tf)
+ 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
+ END IF
+ WRITE (*, '(A)') 'PASS: VIV FRAME deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the VIV FRAME deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_tow(path)
+ !! Both ends (points 1 and 2) moved along -y at 0.15 m/s after a 10 s half-cosine velocity ramp,
+ !! every 0.01 s to TMAX: y = -U (t/2 - T sin(pi t/T)/(2 pi)) in the ramp (T 10 s).
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), PARAMETER :: U = 0.15_wp, TR = 10.0_wp
+ INTEGER :: u_, k
+ REAL(wp) :: t, y, v, a
+ OPEN (NEWUNIT=u_, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u_, '(A)') '# time point x y z vx vy vz ax ay az'
+ DO k = 0, NINT(100.0_wp*TMAX)
+ t = 0.01_wp*REAL(k, wp)
+ IF (t < TR) THEN
+ y = -U*(0.5_wp*t - TR*SIN(PI*t/TR)/(2.0_wp*PI))
+ v = -U*0.5_wp*(1.0_wp - COS(PI*t/TR))
+ a = -U*0.5_wp*(PI/TR)*SIN(PI*t/TR)
+ ELSE
+ y = -U*(0.5_wp*TR + (t - TR))
+ v = -U
+ a = 0.0_wp
+ END IF
+ WRITE (u_, '(F9.3,A,3ES17.9,A,ES17.9,A,ES17.9,A)') t, ' 1 ', 0.0_wp, y, -50.0_wp, ' 0 ', v, ' 0 0 ', a, ' 0'
+ WRITE (u_, '(F9.3,A,3ES17.9,A,ES17.9,A,ES17.9,A)') t, ' 2 ', 100.0_wp, y, -50.0_wp, ' 0 ', v, ' 0 0 ', a, ' 0'
+ END DO
+ CLOSE (u_)
+ END SUBROUTINE write_tow
+
+ SUBROUTINE write_rows(u, title, header, rows)
+ INTEGER, INTENT(IN) :: u
+ CHARACTER(*), INTENT(IN) :: title, header, rows
+ INTEGER :: i0, i1
+ WRITE (u, '(A)') '----------------------- '//title//' ---------------------------------------'
+ WRITE (u, '(A)') header
+ i0 = 1
+ DO
+ i1 = INDEX(rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END SUBROUTINE write_rows
+
+ 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).
+ CHARACTER(*), INTENT(IN) :: path, ei, amp_rows, damp_rows
+ 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'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ 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'
+ IF (tow) THEN
+ WRITE (u, '(A)') '2 Coupled 100.0 0.0 -50.0 0 0 0 0'
+ ELSE
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ END IF
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ WRITE (u, '(A)') '1 1 2 -'
+ WRITE (u, '(A)') '----------------------- SECTIONS --------------------------------------------'
+ WRITE (u, '(A)') 'LineID LineType Length NumSegs'
+ 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)) 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'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ IF (tow) THEN
+ WRITE (u, '(A)') 'vfd_tow.txt motionFile'
+ ELSE
+ WRITE (u, '(A)') 'vfd_current.dat WaterKin'
+ END IF
+ WRITE (u, '(A,F8.3,A)') ' ', tmax_, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (u, '(A)') 'L1N25PZ'
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, tab, n)
+ !! The rows (time, L1N25PZ) of a deck's main output file.
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(1024) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(2, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ REAL(wp) FUNCTION peak_frequency(tt, x) RESULT(fpk)
+ !! The frequency of the largest Fourier amplitude of x - mean(x) on 0.05-1 Hz (0.001 Hz grid).
+ REAL(wp), INTENT(IN) :: tt(:), x(:)
+ REAL(wp) :: xm(SIZE(x)), f, best, re, im
+ INTEGER :: j
+ xm = x - SUM(x)/REAL(SIZE(x), wp)
+ best = -1.0_wp
+ fpk = 0.0_wp
+ DO j = 0, 950
+ f = 0.05_wp + 0.001_wp*REAL(j, wp)
+ re = SUM(xm*COS(2.0_wp*PI*f*tt))
+ im = SUM(xm*SIN(2.0_wp*PI*f*tt))
+ IF (re*re + im*im > best) THEN
+ best = re*re + im*im
+ fpk = f
+ END IF
+ END DO
+ END FUNCTION peak_frequency
+
+ SUBROUTINE stats(root, res, ok)
+ !! Half the peak-to-peak mid-span cross-flow excursion over D and the dominant frequency over
+ !! T0-TMAX of the run root.
+ CHARACTER(*), INTENT(IN) :: root
+ REAL(wp), INTENT(OUT) :: res(2)
+ LOGICAL, INTENT(OUT) :: ok
+ REAL(wp), ALLOCATABLE :: tab(:, :), tt(:), z(:)
+ INTEGER :: n
+ LOGICAL, ALLOCATABLE :: keep(:)
+ res = 0.0_wp
+ CALL read_out(root//'.out', tab, n)
+ ok = n > 1000
+ IF (.NOT. ok) RETURN
+ keep = tab(1, 1:n) >= T0
+ tt = PACK(tab(1, 1:n), keep)
+ z = PACK(tab(2, 1:n), keep)
+ res = [0.5_wp*(MAXVAL(z) - MINVAL(z))/D, peak_frequency(tt, z)]
+ END SUBROUTINE stats
+
+ LOGICAL FUNCTION same_file(a, b) RESULT(same)
+ !! The two text files are the same, line for line.
+ CHARACTER(*), INTENT(IN) :: a, b
+ CHARACTER(1024) :: ra, rb
+ INTEGER :: ua, ub, ia, ib
+ same = .FALSE.
+ OPEN (NEWUNIT=ua, FILE=a, STATUS='OLD', ACTION='READ', IOSTAT=ia)
+ IF (ia /= 0) RETURN
+ OPEN (NEWUNIT=ub, FILE=b, STATUS='OLD', ACTION='READ', IOSTAT=ib)
+ IF (ib /= 0) THEN
+ CLOSE (ua); RETURN
+ END IF
+ DO
+ READ (ua, '(A)', IOSTAT=ia) ra
+ READ (ub, '(A)', IOSTAT=ib) rb
+ IF (ia /= 0 .OR. ib /= 0) EXIT
+ IF (ra /= rb) EXIT
+ END DO
+ same = ia /= 0 .AND. ib /= 0
+ CLOSE (ua)
+ CLOSE (ub)
+ END FUNCTION same_file
+
+ SUBROUTINE check_fixed(ei, amp_rows, damp_rows, tag, res, res_tf)
+ !! G1 and G3 on the cable of EI ei held in the current: without the section, with a Tf 0 row
+ !! and with Tf 10 s; res and res_tf (A/D, f) without the section and with Tf 10 s.
+ CHARACTER(*), INTENT(IN) :: ei, amp_rows, damp_rows, tag
+ REAL(wp), INTENT(OUT) :: res(2), res_tf(2)
+ LOGICAL :: ok, ok2
+ CHARACTER(1024) :: msg
+ CHARACTER(:), ALLOCATABLE :: lab
+ lab = ' (EI '//ei//', '//TRIM(MERGE('tables', 'lift ', LEN_TRIM(amp_rows) > 0))//')'
+ CALL write_deck(tag//'_amb.dat', ei, amp_rows, damp_rows, TMAX, .FALSE.)
+ CALL run(tag//'_amb.dat', tag//'_amb', ok, msg)
+ CALL require(ok, 'G1: the deck without the section runs'//lab//': '//TRIM(msg))
+ CALL write_deck(tag//'_t0.dat', ei, amp_rows, damp_rows, TMAX, .FALSE., frame_rows='riser 0')
+ CALL run(tag//'_t0.dat', tag//'_t0', ok, msg)
+ CALL require(ok, 'G1: the deck with Tf 0 runs'//lab//': '//TRIM(msg))
+ CALL require(same_file(tag//'_amb.out', tag//'_t0.out'), 'G1: a Tf 0 row is the deck without it, bit for '// &
+ 'bit'//lab)
+ 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, 'G3: the deck with Tf 10 s runs'//lab//': '//TRIM(msg))
+ CALL stats(tag//'_amb', res, ok)
+ CALL stats(tag//'_tf', res_tf, ok2)
+ CALL require(ok .AND. ok2, 'G3: the runs wrote their rows'//lab)
+ WRITE (*, '(A,2F8.4,A,2F8.4)') 'G3'//lab//': in the current A/D, f [Hz] with Tf 10 s ', res_tf, &
+ '; without ', res
+ CALL require(res(1) > 0.2_wp, 'G3: the cable locks in'//lab)
+ CALL require(ABS(res_tf(1)/res(1) - 1.0_wp) <= 0.005_wp .AND. ABS(res_tf(2) - res(2)) <= 0.005_wp, &
+ 'G3: held in the current, Tf leaves the response as the ambient flow gives it'//lab)
+ END SUBROUTINE check_fixed
+
+ SUBROUTINE check_tow(tag, amp_rows, damp_rows, ref, ref_tf, lab)
+ !! G2 on the finite-EI cable with the given tables: towed with Tf 10 s and without it, against
+ !! the cable held in the current without and with Tf 10 s (ref, ref_tf, from check_fixed);
+ !! without the tables (the lift alone) the towed cable without Tf is only reported.
+ CHARACTER(*), INTENT(IN) :: tag, amp_rows, damp_rows, lab
+ REAL(wp), INTENT(IN) :: ref(2), ref_tf(2)
+ REAL(wp) :: r_tf(2), r_0(2)
+ LOGICAL :: ok, ok2
+ CHARACTER(1024) :: msg
+ CALL write_deck(tag//'_tf.dat', '1.0', amp_rows, damp_rows, TMAX, .TRUE., frame_rows='riser 10')
+ CALL run(tag//'_tf.dat', tag//'_tf', ok, msg)
+ CALL require(ok, 'G2: the towed deck with Tf runs'//lab//': '//TRIM(msg))
+ CALL write_deck(tag//'_0.dat', '1.0', amp_rows, damp_rows, TMAX, .TRUE.)
+ CALL run(tag//'_0.dat', tag//'_0', ok, msg)
+ CALL require(ok, 'G2: the towed deck without Tf runs'//lab//': '//TRIM(msg))
+ CALL stats(tag//'_tf', r_tf, ok)
+ CALL stats(tag//'_0', r_0, ok2)
+ CALL require(ok .AND. ok2, 'G2: the towed runs wrote their rows'//lab)
+ WRITE (*, '(A,2F8.4,A,2F8.4,A,2F8.4,A,2F8.4)') 'G2'//lab//': towed A/D, f [Hz] with Tf 10 s ', r_tf, &
+ '; without ', r_0, '; held in the current ', ref, ', with Tf ', ref_tf
+ CALL require(ABS(r_tf(1)/ref(1) - 1.0_wp) <= TOL_TOW .AND. ABS(r_tf(2) - ref(2)) <= 0.005_wp, &
+ 'G2: towed with Tf, the cable responds as the cable held in the current'//lab)
+ CALL require(ABS(r_tf(1)/ref_tf(1) - 1.0_wp) <= TOL_TOW_TF .AND. ABS(r_tf(2) - ref_tf(2)) <= 0.0015_wp, &
+ 'G2: towed with Tf, the cable responds as the cable held in the current with Tf'//lab)
+ IF (LEN_TRIM(amp_rows) > 0) CALL require(ABS(r_0(1)/ref(1) - 1.0_wp) > 0.10_wp, &
+ 'G2: towed without Tf, it responds otherwise'//lab)
+ END SUBROUTINE check_tow
+
+ SUBROUTINE check_refusals()
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('vfd_bad.dat', '1.0', '', '', 1.0_wp, .FALSE., frame_rows='riser 10', cl='0.0')
+ CALL run('vfd_bad.dat', 'vfd_bad', ok, msg)
+ WRITE (*, '(A)') 'G4 a type without VIV: '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row') > 0, &
+ '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_inline_deck.f90 b/tests/test_viv_inline_deck.f90
new file mode 100644
index 00000000..fe433751
--- /dev/null
+++ b/tests/test_viv_inline_deck.f90
@@ -0,0 +1,410 @@
+! File: tests/test_viv_inline_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_inline_deck
+ !! In-line VIV on a deck (the optional VIV section, TypeName ClX [alpha]): the taut line of the
+ !! cross-flow lock-in benchmark (tests/test_viv_lockin.py) as a finite-EI cable, 100 m pinned
+ !! at 50 m depth in a uniform 0.15 m/s current along y, Cl 0.8 with MoorDyn's band.
+ !! D1 with ClX 0.85 the quarter-span in-line (y) response oscillates at twice the mid-span
+ !! cross-flow (z) frequency and is larger than without the VIV section;
+ !! D2 a VIV row with ClX 0 is the deck without the section, to the printed digits;
+ !! D3 malformed rows, an unknown or repeated type, ClX on a type without the cross-flow lift
+ !! and alpha outside [0, 1) are refused by name;
+ !! D4 the same deck as an EI = 0 line (the lumped node force, neighbour-averaged kinematics)
+ !! matches the finite-EI cable: cross-flow and in-line amplitudes within 2 %, the same
+ !! frequencies within one 0.01 Hz bin;
+ !! D5 a higher-harmonic coefficient Chh 1.0 (Ulveseter et al. 2019, the fourth column) at
+ !! least triples the quarter-span in-line response at four times the cross-flow frequency
+ !! (the in-line share of the force at the cross-flow plus in-line phase), on the cable and
+ !! the EI = 0 line alike (within 5 %); Chh 0 is the row without it, to the printed digits;
+ !! Chh on a type without in-line VIV and a negative Chh are refused;
+ !! D6 the cross-flow columns after the 14-column finite-EI row (GAs GJ Irt Irn): a 17-column row
+ !! free in torsion is the 13-column deck, to the printed digits; a 15-column row (Cl alone) is
+ !! the 17-column one with MoorDyn's dF 0.08 and cF 0.18; and on the line restrained in
+ !! torsion at both ends (nodal twist) the lift still locks the cable in, with the cross-flow
+ !! amplitude and frequency of the line free in torsion.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, D = 0.1_wp
+ INTEGER :: nfail = 0
+
+ CALL write_current('vid_current.dat')
+ CALL check_runs()
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: in-line VIV deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the in-line VIV deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_deck(path, viv_rows, tmax, ei, cl, wide, ends)
+ !! viv_rows: the VIV section's data rows, ';'-separated ('' for no section). wide: the VIV
+ !! columns written after the 14-column finite-EI row (GAs GJ Irt Irn in the CableDyn hydro
+ !! order) instead of the 10 stock-order ones; ends: restrain both ends in torsion.
+ CHARACTER(*), INTENT(IN) :: path, viv_rows
+ REAL(wp), INTENT(IN) :: tmax
+ CHARACTER(*), INTENT(IN), OPTIONAL :: ei, cl, wide
+ LOGICAL, INTENT(IN), OPTIONAL :: ends
+ CHARACTER(32) :: ei_col, cl_col
+ INTEGER :: u, i0, i1
+ ei_col = '1.0'
+ IF (PRESENT(ei)) ei_col = ei
+ cl_col = '0.8'
+ IF (PRESENT(cl)) cl_col = cl
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'in-line VIV deck gate: taut cable in a uniform current'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ IF (PRESENT(wide)) THEN
+ ! GJ = EI/1.3, Irn = m D^2/8, Irt = m D^2/16, GAs = EA/2.6: the circular-section closure
+ WRITE (u, '(A)') 'TypeName Diam Mass/m EA BA/-zeta EI GAs GJ Irt Irn Cd_n Cd_t Ca_n Ca_t Cl [dF cF]'
+ WRITE (u, '(A)') 'riser 0.10 10.0 5.0e7 -0.8 '//TRIM(ei_col)//' 1.9230769e7 0.76923077 0.00625 0.0125 '// &
+ '1.2 0.0 1.0 0.0 '//wide
+ ELSE
+ WRITE (u, '(A)') 'TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx Cl dF cF'
+ WRITE (u, '(A)') '(name) (m) (kg/m) (N) (N-s/-) (-) (-) (-) (-) (-) (-) (-) (-)'
+ WRITE (u, '(A)') 'riser 0.10 10.0 5.0e7 -0.8 '//TRIM(ei_col)//' 1.2 1.0 0.0 0.0 '// &
+ TRIM(cl_col)//' 0.08 0.18'
+ END IF
+ WRITE (u, '(A)') '----------------------- POINTS ----------------------------------------------'
+ WRITE (u, '(A)') 'ID Attachment X Y Z M V CdA CA'
+ WRITE (u, '(A)') '(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)'
+ WRITE (u, '(A)') '1 Coupled 0.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID LineType AttachA AttachB UnstrLen NumSegs Outputs'
+ WRITE (u, '(A)') '(#) (name) (#) (#) (m) (-) (-)'
+ WRITE (u, '(A)') '1 riser 1 2 99.900100 50 -'
+ IF (PRESENT(ends)) THEN
+ IF (ends) THEN
+ ! pinned in bending, rigid in torsion, the zero-twist normal along z
+ WRITE (u, '(A)') '----------------------- END CONNECTIONS ---------------------------------------'
+ WRITE (u, '(A)') 'LineID End Stiffness EzX EzY EzZ TorsStiffness NxX NxY NxZ Pretwist'
+ WRITE (u, '(A)') '1 A 0 1.0 0.0 0.0 Rigid 0.0 0.0 1.0 0.0'
+ WRITE (u, '(A)') '1 B 0 1.0 0.0 0.0 Rigid 0.0 0.0 1.0 0.0'
+ END IF
+ END IF
+ IF (LEN_TRIM(viv_rows) > 0) THEN
+ WRITE (u, '(A)') '----------------------- VIV -------------------------------------------------'
+ WRITE (u, '(A)') 'TypeName ClX alpha'
+ WRITE (u, '(A)') '(name) (-) (-)'
+ i0 = 1
+ DO
+ i1 = INDEX(viv_rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(viv_rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') viv_rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '0.01 dtM'
+ WRITE (u, '(A)') '100.0 WtrDpth'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') 'vid_current.dat WaterKin'
+ WRITE (u, '(A)') '0.25 VIVrmsWindow'
+ WRITE (u, '(A,F8.3,A)') ' ', tmax, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (u, '(A)') 'L1N25PZ'
+ WRITE (u, '(A)') 'L1N12PY'
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, tab, n)
+ !! The rows (time, L1N25PZ, L1N12PY) of a deck's main output file.
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(1024) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(3, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ REAL(wp) FUNCTION peak_frequency(tt, x) RESULT(fpk)
+ !! The frequency of the largest Fourier amplitude of x - mean(x) on 0.05-2 Hz (0.002 Hz grid).
+ REAL(wp), INTENT(IN) :: tt(:), x(:)
+ REAL(wp) :: xm(SIZE(x)), f, best, re, im
+ INTEGER :: i, j
+ xm = x - SUM(x)/REAL(SIZE(x), wp)
+ best = -1.0_wp
+ fpk = 0.0_wp
+ DO j = 0, 975
+ f = 0.05_wp + 0.002_wp*REAL(j, wp)
+ re = 0.0_wp; im = 0.0_wp
+ DO i = 1, SIZE(x)
+ re = re + xm(i)*COS(2.0_wp*PI*f*tt(i))
+ im = im + xm(i)*SIN(2.0_wp*PI*f*tt(i))
+ END DO
+ IF (re*re + im*im > best) THEN
+ best = re*re + im*im
+ fpk = f
+ END IF
+ END DO
+ END FUNCTION peak_frequency
+
+ SUBROUTINE window(tab, n, t0, tt, z, y)
+ !! The rows of tab from time t0 on.
+ REAL(wp), INTENT(IN) :: tab(:, :), t0
+ INTEGER, INTENT(IN) :: n
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tt(:), z(:), y(:)
+ LOGICAL :: keep(n)
+ keep = tab(1, 1:n) >= t0
+ tt = PACK(tab(1, 1:n), keep)
+ z = PACK(tab(2, 1:n), keep)
+ y = PACK(tab(3, 1:n), keep)
+ END SUBROUTINE window
+
+ SUBROUTINE check_runs()
+ REAL(wp), ALLOCATABLE :: ti(:, :), tc(:, :), t0(:, :), tt(:), z(:), y(:)
+ INTEGER :: ni, nc, n0
+ REAL(wp) :: fz, fy, ay_il, ay_cf
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('vid_il.dat', 'riser 0.85 0.15', 100.0_wp)
+ CALL run('vid_il.dat', 'vid_il', ok, msg)
+ CALL require(ok, 'D1: the in-line VIV deck runs: '//TRIM(msg))
+ CALL write_deck('vid_cf.dat', '', 100.0_wp)
+ CALL run('vid_cf.dat', 'vid_cf', ok, msg)
+ CALL require(ok, 'D1: the cross-flow-only deck runs: '//TRIM(msg))
+ CALL write_deck('vid_zero.dat', 'riser 0.0', 100.0_wp)
+ CALL run('vid_zero.dat', 'vid_zero', ok, msg)
+ CALL require(ok, 'D2: the ClX 0 deck runs: '//TRIM(msg))
+ CALL read_out('vid_il.out', ti, ni)
+ CALL read_out('vid_cf.out', tc, nc)
+ CALL read_out('vid_zero.out', t0, n0)
+ CALL require(ni > 100 .AND. ni == nc .AND. ni == n0, 'D1/D2: the runs wrote matching rows')
+ IF (.NOT. (ni > 100 .AND. ni == nc .AND. ni == n0)) RETURN
+ CALL require(ALL(t0(:, 1:n0) == tc(:, 1:nc)), 'D2: a VIV row with ClX 0 is the deck without the section')
+ CALL window(ti, ni, 50.0_wp, tt, z, y)
+ fz = peak_frequency(tt, z)
+ fy = peak_frequency(tt, y)
+ ay_il = 0.5_wp*(MAXVAL(y) - MINVAL(y))
+ WRITE (*, '(A,F7.4,A,F7.4,A,F7.3,A,F7.4)') 'D1: cross-flow ', fz, ' Hz, in-line ', fy, ' Hz, ratio ', fy/fz, &
+ ', CF amplitude/D ', 0.5_wp*(MAXVAL(z) - MINVAL(z))/D
+ CALL window(tc, nc, 50.0_wp, tt, z, y)
+ ay_cf = 0.5_wp*(MAXVAL(y) - MINVAL(y))
+ WRITE (*, '(A,F8.4,A,F8.4)') 'D1: quarter-span in-line amplitude/D ', ay_il/D, ', without the VIV section ', &
+ ay_cf/D
+ CALL require(ABS(fy/fz - 2.0_wp) <= 0.15_wp, 'D1: the in-line response is at twice the cross-flow frequency')
+ CALL require(ay_il > 2.0_wp*ay_cf, 'D1: the in-line force raises the in-line response')
+ ! D4: the EI = 0 line
+ BLOCK
+ REAL(wp), ALLOCATABLE :: te(:, :)
+ INTEGER :: ne0
+ REAL(wp) :: az_f, az_0, ay_f, ay_0, fz_f, fy_f
+ CALL window(ti, ni, 50.0_wp, tt, z, y)
+ az_f = 0.5_wp*(MAXVAL(z) - MINVAL(z))
+ ay_f = 0.5_wp*(MAXVAL(y) - MINVAL(y))
+ fz_f = peak_frequency(tt, z)
+ fy_f = peak_frequency(tt, y)
+ CALL write_deck('vid_ei0.dat', 'riser 0.85 0.15', 100.0_wp, ei='0.0')
+ CALL run('vid_ei0.dat', 'vid_ei0', ok, msg)
+ CALL require(ok, 'D4: the EI = 0 in-line VIV deck runs: '//TRIM(msg))
+ CALL read_out('vid_ei0.out', te, ne0)
+ CALL require(ne0 == ni, 'D4: the EI = 0 run wrote the same rows')
+ IF (ne0 /= ni) RETURN
+ CALL window(te, ne0, 50.0_wp, tt, z, y)
+ az_0 = 0.5_wp*(MAXVAL(z) - MINVAL(z))
+ ay_0 = 0.5_wp*(MAXVAL(y) - MINVAL(y))
+ WRITE (*, '(A,2F8.4,A,2F8.4)') 'D4: CF and IL amplitude/D, EI = 0 line ', az_0/D, ay_0/D, &
+ ', finite-EI cable ', az_f/D, ay_f/D
+ WRITE (*, '(A,2F8.4,A,2F8.4)') 'D4: CF and IL frequency [Hz], EI = 0 line ', peak_frequency(tt, z), &
+ peak_frequency(tt, y), ', finite-EI cable ', fz_f, fy_f
+ CALL require(ABS(az_0/az_f - 1.0_wp) <= 0.02_wp .AND. ABS(ay_0/ay_f - 1.0_wp) <= 0.02_wp, &
+ 'D4: the EI = 0 line matches the cable''s amplitudes within 2 %')
+ CALL require(ABS(peak_frequency(tt, z) - fz_f) <= 0.01_wp .AND. ABS(peak_frequency(tt, y) - fy_f) <= 0.01_wp, &
+ 'D4: and its frequencies within 0.01 Hz')
+ END BLOCK
+ ! D5: the higher-harmonic force
+ BLOCK
+ REAL(wp), ALLOCATABLE :: th(:, :), t0h(:, :), te(:, :)
+ INTEGER :: nh, n0h, neh
+ REAL(wp) :: f1, a4_il, a4_hh, a4_e
+ CALL write_deck('vid_hh.dat', 'riser 0.85 0.15 1.0', 100.0_wp)
+ CALL run('vid_hh.dat', 'vid_hh', ok, msg)
+ CALL require(ok, 'D5: the Chh deck runs: '//TRIM(msg))
+ CALL write_deck('vid_hh0.dat', 'riser 0.85 0.15 0.0', 100.0_wp)
+ CALL run('vid_hh0.dat', 'vid_hh0', ok, msg)
+ CALL require(ok, 'D5: the Chh 0 deck runs: '//TRIM(msg))
+ CALL write_deck('vid_hhe.dat', 'riser 0.85 0.15 1.0', 100.0_wp, ei='0.0')
+ CALL run('vid_hhe.dat', 'vid_hhe', ok, msg)
+ CALL require(ok, 'D5: the EI = 0 Chh deck runs: '//TRIM(msg))
+ CALL read_out('vid_hh.out', th, nh)
+ CALL read_out('vid_hh0.out', t0h, n0h)
+ CALL read_out('vid_hhe.out', te, neh)
+ CALL require(nh == ni .AND. n0h == ni .AND. neh == ni, 'D5: the runs wrote the same rows')
+ IF (.NOT. (nh == ni .AND. n0h == ni .AND. neh == ni)) RETURN
+ CALL require(ALL(t0h(:, 1:n0h) == ti(:, 1:ni)), 'D5: a VIV row with Chh 0 is the row without it')
+ CALL window(ti, ni, 50.0_wp, tt, z, y)
+ f1 = peak_frequency(tt, z)
+ a4_il = fourier_amplitude(tt, y, 4.0_wp*f1)
+ CALL window(th, nh, 50.0_wp, tt, z, y)
+ f1 = peak_frequency(tt, z)
+ a4_hh = fourier_amplitude(tt, y, 4.0_wp*f1)
+ CALL window(te, neh, 50.0_wp, tt, z, y)
+ a4_e = fourier_amplitude(tt, y, 4.0_wp*peak_frequency(tt, z))
+ WRITE (*, '(A,3F8.4)') 'D5: quarter-span in-line amplitude/D at 4 f, Chh 0, Chh 1, Chh 1 EI = 0: ', &
+ a4_il/D, a4_hh/D, a4_e/D
+ CALL require(a4_hh >= 3.0_wp*a4_il, 'D5: Chh raises the fourth in-line harmonic at least threefold')
+ CALL require(ABS(a4_e/a4_hh - 1.0_wp) <= 0.05_wp, 'D5: the EI = 0 line takes it within 5 %')
+ END BLOCK
+ CALL check_wide_rows(tc, nc)
+ END SUBROUTINE check_runs
+
+ SUBROUTINE check_wide_rows(tc, nc)
+ !! D6 against the cross-flow-only deck tc (the 13-column row, no VIV section).
+ REAL(wp), INTENT(IN) :: tc(:, :)
+ INTEGER, INTENT(IN) :: nc
+ REAL(wp), ALLOCATABLE :: tw(:, :), t15(:, :), t17(:, :), tr(:, :), tt(:), z(:), y(:)
+ INTEGER :: nw, n15, n17, nr
+ REAL(wp) :: az_c, fz_c, az_r, fz_r
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('vid_w13.dat', '', 100.0_wp, wide='0.8 0.08 0.18')
+ CALL run('vid_w13.dat', 'vid_w13', ok, msg)
+ CALL require(ok, 'D6: the 17-column deck runs: '//TRIM(msg))
+ CALL read_out('vid_w13.out', tw, nw)
+ CALL require(nw == nc, 'D6: the 17-column run wrote the rows of the 13-column one')
+ IF (nw /= nc) RETURN
+ CALL require(ALL(tw(:, 1:nw) == tc(:, 1:nc)), 'D6: a 17-column row free in torsion is the 13-column row')
+ CALL write_deck('vid_w15.dat', '', 30.0_wp, wide='0.8', ends=.TRUE.)
+ CALL run('vid_w15.dat', 'vid_w15', ok, msg)
+ CALL require(ok, 'D6: the 15-column deck restrained in torsion runs: '//TRIM(msg))
+ CALL write_deck('vid_w17.dat', '', 30.0_wp, wide='0.8 0.08 0.18', ends=.TRUE.)
+ CALL run('vid_w17.dat', 'vid_w17', ok, msg)
+ CALL require(ok, 'D6: the 17-column deck restrained in torsion runs: '//TRIM(msg))
+ CALL read_out('vid_w15.out', t15, n15)
+ CALL read_out('vid_w17.out', t17, n17)
+ CALL require(n15 > 100 .AND. n15 == n17, 'D6: the 15- and 17-column runs wrote matching rows')
+ IF (.NOT. (n15 > 100 .AND. n15 == n17)) RETURN
+ CALL require(ALL(t15(:, 1:n15) == t17(:, 1:n17)), 'D6: a 15-column row takes dF 0.08 and cF 0.18')
+ CALL write_deck('vid_wr.dat', '', 100.0_wp, wide='0.8 0.08 0.18', ends=.TRUE.)
+ CALL run('vid_wr.dat', 'vid_wr', ok, msg)
+ CALL require(ok, 'D6: the VIV deck restrained in torsion runs: '//TRIM(msg))
+ CALL read_out('vid_wr.out', tr, nr)
+ CALL require(nr == nc, 'D6: the run restrained in torsion wrote the same rows')
+ IF (nr /= nc) RETURN
+ CALL window(tc, nc, 50.0_wp, tt, z, y)
+ az_c = 0.5_wp*(MAXVAL(z) - MINVAL(z))
+ fz_c = peak_frequency(tt, z)
+ CALL window(tr, nr, 50.0_wp, tt, z, y)
+ az_r = 0.5_wp*(MAXVAL(z) - MINVAL(z))
+ fz_r = peak_frequency(tt, z)
+ WRITE (*, '(A,2F8.4,A,2F8.4)') 'D6: mid-span CF amplitude/D and frequency [Hz], restrained in torsion ', &
+ az_r/D, fz_r, ', free ', az_c/D, fz_c
+ CALL require(az_r > 0.3_wp*D, 'D6: the lift locks in the cable restrained in torsion')
+ CALL require(ABS(az_r/az_c - 1.0_wp) <= 0.02_wp .AND. ABS(fz_r - fz_c) <= 0.01_wp, &
+ 'D6: with the amplitude (2 %) and frequency (0.01 Hz) of the cable free in torsion')
+ END SUBROUTINE check_wide_rows
+
+ REAL(wp) FUNCTION fourier_amplitude(tt, x, f) RESULT(a)
+ !! The amplitude of x - mean(x) at frequency f (Hann window, so a sine of amplitude A gives A).
+ REAL(wp), INTENT(IN) :: tt(:), x(:), f
+ REAL(wp) :: w(SIZE(x)), xm(SIZE(x)), re, im
+ INTEGER :: i, n
+ n = SIZE(x)
+ DO i = 1, n
+ w(i) = 0.5_wp - 0.5_wp*COS(2.0_wp*PI*REAL(i - 1, wp)/REAL(n - 1, wp))
+ END DO
+ xm = x - SUM(x)/REAL(n, wp)
+ re = SUM(w*xm*COS(2.0_wp*PI*f*tt))
+ im = SUM(w*xm*SIN(2.0_wp*PI*f*tt))
+ a = 2.0_wp*SQRT(re*re + im*im)/SUM(w)
+ END FUNCTION fourier_amplitude
+
+ SUBROUTINE check_refusals()
+ CALL refused('riser 0.85 0.15 7 1', 'TypeName ClX [alpha [Chh]]', 'a row of five columns')
+ CALL refused('cable 0.85', 'undefined LINE TYPE', 'an unknown type')
+ CALL refused('riser 0.85;riser 0.5', 'twice', 'a repeated type')
+ CALL refused('riser -0.1', 'non-negative', 'a negative ClX')
+ CALL refused('riser 0.85 1.0', '0 <= alpha < 1', 'alpha = 1')
+ CALL refused('riser 0.85 x', 'plain numbers', 'a non-numeric alpha')
+ CALL refused('riser 0.85', 'cross-flow lift', 'ClX on a type without the cross-flow lift', cl='0.0')
+ CALL refused('riser 0.0 0.15 1.0', 'needs its in-line VIV', 'Chh without in-line VIV')
+ CALL refused('riser 0.85 0.15 -1.0', 'Chh must be non-negative', 'a negative Chh')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE refused(rows, needle, what, ei, cl)
+ CHARACTER(*), INTENT(IN) :: rows, needle, what
+ CHARACTER(*), INTENT(IN), OPTIONAL :: ei, cl
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ IF (PRESENT(ei)) THEN
+ CALL write_deck('vid_bad.dat', rows, 1.0_wp, ei=ei)
+ ELSE IF (PRESENT(cl)) THEN
+ CALL write_deck('vid_bad.dat', rows, 1.0_wp, cl=cl)
+ ELSE
+ CALL write_deck('vid_bad.dat', rows, 1.0_wp)
+ END IF
+ CALL run('vid_bad.dat', 'vid_bad', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, needle) > 0, 'D3: '//what//' is refused: '//TRIM(msg))
+ END SUBROUTINE refused
+
+END PROGRAM test_viv_inline_deck
diff --git a/tests/test_viv_kernels.f90 b/tests/test_viv_kernels.f90
index e6ddad46..1fc11b77 100644
--- a/tests/test_viv_kernels.f90
+++ b/tests/test_viv_kernels.f90
@@ -11,15 +11,22 @@ PROGRAM test_viv_kernels
!! 4) the phase rate is 2 pi (cF + dF sin(phi_y - phi)) U/D, with phi_y from the RMS-normalised
!! y', y'' (cF at phase lock, cF + dF a quarter period ahead);
!! 5) the running mean square is MoorDyn's ((n_m - 1) old^2 + new^2)/n_m;
- !! 6) the phase wraps to [0, 2 pi), and a node whose neighbours coincide fails closed.
+ !! 6) the phase wraps to [0, 2 pi), and a node whose neighbours coincide fails closed;
+ !! 7) the per-length lift of a centreline point (the finite-EI Gauss points);
+ !! 8) in-line VIV (Ulveseter et al. 2018): the node and per-length forces are
+ !! 1/2 rho D C_vx cos(phi_x) U v_n along the normal flow, their Jacobians match central
+ !! differences, the in-line motion is the component along v_n/U, and the phase rate is
+ !! 2 rate_y [1 + alpha sin(phi_xd - phi_x)] (twice the cross-flow rate at phase lock).
USE CableDyn_Precision, ONLY: wp
USE CableDyn_VIV, ONLY: CD_VIV_Node_Lift, CD_VIV_Crossflow_Motion, CD_VIV_Phase_Rate, CD_VIV_Mean_Square, &
- CD_VIV_Wrap_Phase, CD_VIV_TWO_PI, CD_VIV_NM, CD_VIV_Lift_Per_Length
+ CD_VIV_Wrap_Phase, CD_VIV_TWO_PI, CD_VIV_NM, CD_VIV_Lift_Per_Length, &
+ CD_VIV_Node_Inline, CD_VIV_Inline_Per_Length, CD_VIV_Inline_Phase_Rate, &
+ CD_VIV_Crossflow_Along
IMPLICIT NONE
REAL(wp), PARAMETER :: RHO = 1025.0_wp, DIAM = 0.1_wp, CL = 0.8_wp, L1 = 2.0_wp, L2 = 1.5_wp
REAL(wp) :: rp(3), rn(3), rd(3), u(3), coef, phi, f(3), q(3), vr(3), vn(3), un, w(3), ref(3)
REAL(wp) :: jv(3, 3), jp(3, 3), jn(3, 3), fd(3, 3), fp(3), fm(3), h, e(3), yd, ydd, un2, rate
- REAL(wp) :: ms, ms_md, rpv(3), kk, fl(3), jr(3, 3), jt(3, 3)
+ REAL(wp) :: ms, ms_md, rpv(3), kk, fl(3), jr(3, 3), jt(3, 3), xd, xdd, yd2, ydd2, un3, rdd(3)
LOGICAL :: ok
INTEGER :: nfail, j, k
@@ -119,6 +126,77 @@ PROGRAM test_viv_kernels
CALL CD_VIV_Lift_Per_Length(u - rd, 3.0_wp*rpv, kk, fp, ok)
CALL require(NORM2(fp - fl) <= 1.0e-12_wp*NORM2(fl), 'per-length lift does not depend on |dr/dxi|')
+ ! (8) in-line VIV: the node force along the normal flow and its Jacobians
+ CALL CD_VIV_Node_Inline(rp, rn, rd, u, coef, phi, f, ok)
+ ref = 0.25_wp*RHO*DIAM*un*CL*COS(phi)*vn*(L1 + L2)
+ CALL require(ok .AND. NORM2(f - ref) <= 1.0e-12_wp*NORM2(ref), 'in-line: node force = coef cos(phi_x) U v_n')
+ CALL require(ABS(DOT_PRODUCT(f, q)) <= 1.0e-12_wp*NORM2(f), 'in-line: node force normal to the tangent')
+ CALL CD_VIV_Node_Inline(rp, rn, rd, rd + 0.3_wp*q, coef, phi, f, ok)
+ CALL require(ok .AND. NORM2(f) <= 1.0e-14_wp, 'in-line: no force for flow along the line')
+ CALL CD_VIV_Node_Inline(rp, rn, rd, u, coef, phi, f, ok, jv, jp, jn)
+ DO j = 1, 3
+ CALL CD_VIV_Node_Inline(rp, rn, rd + h*unit(j), u, coef, phi, fp, ok)
+ CALL CD_VIV_Node_Inline(rp, rn, rd - h*unit(j), u, coef, phi, fm, ok)
+ fd(:, j) = -(fp - fm)/(2.0_wp*h)
+ END DO
+ CALL require(MAXVAL(ABS(jv - fd)) <= 1.0e-6_wp*MAXVAL(ABS(fd)), 'in-line: velocity Jacobian matches differences')
+ DO j = 1, 3
+ CALL CD_VIV_Node_Inline(rp + h*unit(j), rn, rd, u, coef, phi, fp, ok)
+ CALL CD_VIV_Node_Inline(rp - h*unit(j), rn, rd, u, coef, phi, fm, ok)
+ fd(:, j) = -(fp - fm)/(2.0_wp*h)
+ END DO
+ CALL require(MAXVAL(ABS(jp - fd)) <= 1.0e-6_wp*MAXVAL(ABS(fd)), 'in-line: previous-node Jacobian matches differences')
+ DO j = 1, 3
+ CALL CD_VIV_Node_Inline(rp, rn + h*unit(j), rd, u, coef, phi, fp, ok)
+ CALL CD_VIV_Node_Inline(rp, rn - h*unit(j), rd, u, coef, phi, fm, ok)
+ fd(:, j) = -(fp - fm)/(2.0_wp*h)
+ END DO
+ CALL require(MAXVAL(ABS(jn - fd)) <= 1.0e-6_wp*MAXVAL(ABS(fd)), 'in-line: next-node Jacobian matches differences')
+ CALL CD_VIV_Node_Inline(rp, rp, rd, u, coef, phi, f, ok)
+ CALL require(.NOT. ok .AND. NORM2(f) <= 0.0_wp, 'in-line: coinciding neighbours fail closed with no force')
+
+ ! in-line force per unit length: the node formula with the exact tangent, independent of |dr/dxi|
+ CALL CD_VIV_Inline_Per_Length(u - rd, rpv, kk, fl, ok, jr, jt)
+ CALL CD_VIV_Node_Inline(rp, rn, rd, u, 1.0_wp, phi, f, ok)
+ CALL require(ok .AND. NORM2(fl - 0.5_wp*RHO*DIAM*CL*f) <= 1.0e-12_wp*NORM2(fl), &
+ 'in-line: per-length force = 1/2 rho D C_vx cos(phi_x) U v_n')
+ DO j = 1, 3
+ CALL CD_VIV_Inline_Per_Length(u - rd + h*unit(j), rpv, kk, fp, ok)
+ CALL CD_VIV_Inline_Per_Length(u - rd - h*unit(j), rpv, kk, fm, ok)
+ fd(:, j) = (fp - fm)/(2.0_wp*h)
+ END DO
+CALL require(MAXVAL(ABS(jr - fd)) <= 1.0e-6_wp*MAXVAL(ABS(fd)), 'in-line: per-length flow Jacobian matches differences')
+ DO j = 1, 3
+ CALL CD_VIV_Inline_Per_Length(u - rd, rpv + h*unit(j), kk, fp, ok)
+ CALL CD_VIV_Inline_Per_Length(u - rd, rpv - h*unit(j), kk, fm, ok)
+ fd(:, j) = (fp - fm)/(2.0_wp*h)
+ END DO
+ CALL require(MAXVAL(ABS(jt - fd)) <= 1.0e-6_wp*MAXVAL(ABS(fd)), &
+ 'in-line: per-length tangent Jacobian matches differences')
+ CALL CD_VIV_Inline_Per_Length(u - rd, 3.0_wp*rpv, kk, fp, ok)
+ CALL require(NORM2(fp - fl) <= 1.0e-12_wp*NORM2(fl), 'in-line: per-length force does not depend on |dr/dxi|')
+
+ ! in-line motion along v_n/U, from both motion routines; the cross-flow outputs are unchanged
+ rdd = [1.0_wp, 2.0_wp, -0.5_wp]
+ CALL CD_VIV_Crossflow_Motion(rp, rn, rd, rdd, u, yd2, ydd2, un3, ok, xd, xdd)
+ CALL require(ok .AND. yd2 == yd .AND. ydd2 == ydd, 'in-line: the cross-flow motion is unchanged')
+ CALL require(ABS(xd - DOT_PRODUCT(rd, vn)/un) <= 1.0e-14_wp .AND. ABS(xdd - DOT_PRODUCT(rdd, vn)/un) <= 1.0e-14_wp, &
+ 'in-line: velocity and acceleration along v_n/U')
+ CALL CD_VIV_Crossflow_Along(rn - rp, rd, rdd, u, yd2, ydd2, un3, ok, xd, xdd)
+ CALL require(ok .AND. ABS(yd2 - yd) <= 1.0e-14_wp .AND. ABS(xd - DOT_PRODUCT(rd, vn)/un) <= 1.0e-14_wp .AND. &
+ ABS(xdd - DOT_PRODUCT(rdd, vn)/un) <= 1.0e-14_wp, 'in-line: motion along a given tangent')
+
+ ! in-line phase rate: twice the cross-flow rate at phase lock, (1 + alpha) times that a quarter
+ ! period ahead; a node with no in-line motion takes phi_xd = 0
+ rate = CD_VIV_Inline_Phase_Rate(COS(2.2_wp), -SIN(2.2_wp), 1.0_wp, 1.0_wp, 2.2_wp, 3.0_wp, 0.15_wp)
+ CALL require(ABS(rate - 6.0_wp) <= 1.0e-12_wp*rate, 'in-line: rate at phase lock is twice the cross-flow rate')
+ rate = CD_VIV_Inline_Phase_Rate(COS(2.2_wp), -SIN(2.2_wp), 1.0_wp, 1.0_wp, 2.2_wp - 0.25_wp*CD_VIV_TWO_PI, &
+ 3.0_wp, 0.15_wp)
+ CALL require(ABS(rate - 6.0_wp*1.15_wp) <= 1.0e-12_wp*rate, 'in-line: rate a quarter period ahead is 2 (1+alpha) rate_y')
+ rate = CD_VIV_Inline_Phase_Rate(0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.5_wp, 3.0_wp, 0.15_wp)
+ CALL require(ABS(rate - 6.0_wp*(1.0_wp + 0.15_wp*SIN(-0.5_wp))) <= 1.0e-12_wp*rate, &
+ 'in-line: no in-line motion takes phi_xd = 0')
+
! (6) wrap and degenerate frame
CALL require(CD_VIV_Wrap_Phase(-1.0e-300_wp) >= 0.0_wp .AND. CD_VIV_Wrap_Phase(-1.0e-300_wp) < CD_VIV_TWO_PI, &
'a tiny negative phase wraps into [0, 2 pi)')
diff --git a/tests/test_viv_long_run.f90 b/tests/test_viv_long_run.f90
new file mode 100644
index 00000000..232f62a1
--- /dev/null
+++ b/tests/test_viv_long_run.f90
@@ -0,0 +1,471 @@
+! File: tests/test_viv_long_run.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_long_run
+ !! Long runs of the cross-flow VIV synchronisation model (CableDyn_VIV): hundreds of cycles, as a
+ !! VIV study runs them, at 100 steps per cycle. The shedding phase advances by Heun's rule
+ !! (viv_step_begin / viv_step_end of both line kinds), so its error must grow linearly in time
+ !! and fall with dt^2; the load powers must close the energy balance over the whole run; and a
+ !! locked-in response must be stationary. Every tolerance below comes from a dt sweep (25, 50,
+ !! 100, 200, 400 steps per cycle, gfortran Release) and is stated with the measured value.
+ !!
+ !! P Prescribed motion, the finite-EI cable (10 elements, 20 m, every node's position held and
+ !! moved): all nodes move across a uniform flow U = 0.3 m/s (along y) as a rigid body,
+ !! z = z0 - A cos(om t), A = 1e-6 m (the phase does not depend on A; a small A keeps the
+ !! relative flow and so U and the cross-flow axis fixed to (A om/U)^2 ~ 1e-10). The running
+ !! mean squares start at those of the motion and average over 1000 s, so the motion phase is
+ !! phi_y = om t - pi/2 to the averaging ripple (about 1e-4 rad), and psi = phi_y - phi obeys
+ !! Adler's equation d psi/dt = a - b sin(psi), a = om - Om cF, b = Om dF, Om = 2 pi U/D,
+ !! whose solution is closed form: tan(psi/2) = (b + s tan(theta/2))/a, theta = theta0 + s t,
+ !! s = sqrt(a^2 - b^2) outside the band (a > b), and psi -> asin(a/b) inside it.
+ !! P1 outside the band (om 5.5 rad/s, slip period 2 pi/s = 4.3 s), 400 motion cycles: the
+ !! largest phase error over the 11 nodes against the closed form grows linearly: error(T)/
+ !! error(T/2) in [1.8, 2.2] (linear 2, quadratic 4; measured 2.014 and 1.988 at 50 and 100
+ !! steps per cycle);
+ !! P2 it is second order: error at 50 over error at 100 steps per cycle in [3.6, 4.4]
+ !! (measured 4.01), and at 100 steps per cycle at most 0.05 rad after 400 cycles (measured
+ !! 0.0167, i.e. 4e-5 rad per cycle);
+ !! P3 inside the band (om = Om (cF + dF/2), psi* = pi/6), 50 steps per cycle: the phase lag
+ !! stays within 1e-4 rad of psi* at T/2 and T (measured 2.9e-5 at 25, 50 and 100 steps per
+ !! cycle: the averaging-ripple floor, not the step) and does not grow (error(T) <=
+ !! 1.1 error(T/2), measured 1.0004), and the mean shedding rate over the second half is om
+ !! within 1e-8 (measured 5.8e-12).
+ !!
+ !! C Lock-in, both line kinds: a weightless taut line (20 m, 10 elements, D 0.1 m, 8.1 kg/m,
+ !! EA 5e7 N, 3.8 kN, the finite-EI cable EI 1e3 N m^2, no added mass so that the structural
+ !! energy is the whole stored energy), pinned at both ends in the 0.3 m/s cross current, Cl
+ !! 0.8, cF 0.18, dF 0.08, Cd 1.2, running RMS window 0.25 s (the examples' value), rho_inf = 1
+ !! (no numerical damping, so that the load powers are the whole energy change). It locks in at
+ !! about 0.63 Hz with a mid-span A/D of 0.56-0.57. 400 cycles of the nominal shedding period
+ !! D/(cF U) = 1.85 s (740 s) at 100 and at 200 steps per cycle.
+ !! C1 energy: E(t) - E(0) = int (P_viv + P_drag + P_damp) dt (trapezoidal), the mismatch at
+ !! most 3e-4 of the VIV work at 100 steps per cycle (measured 2.0e-4 finite EI, 1.8e-4
+ !! EI = 0: the lift takes the phase predicted from the previous step's mid-point rate, half
+ !! a step behind the step's own, a second-order lag), second order (the ratio from 100 to
+ !! 200 steps per cycle in [3, 5], measured 3.98 and 3.67), and it accumulates with the work
+ !! and not faster: the mismatch fraction at T within 1.25 times that at T/2 (measured 1.00
+ !! and 1.00);
+ !! C2 statistics over the last three quarters of the run, its two halves: the mid-span RMS
+ !! A/D within 2e-3 and the mean VIV power within 1e-2 of each other (measured 7.3e-4 and
+ !! 1.8e-3 finite EI, 4.1e-4 and 9.0e-4 EI = 0), the same bounds as the change of the
+ !! second half's values from 100 to 200 steps per cycle must meet (measured A/D 7.9e-5 and
+ !! 6.0e-4, power 1.1e-3 and 3.3e-4), so a drift between the halves stays below the
+ !! discretisation error of the statistic;
+ !! C3 phase: the mean shedding rate (the lock-in frequency) of the mid-span node over the two
+ !! halves agrees within 2e-3 (measured 7.4e-5 finite EI, 1.9e-4 EI = 0), so the phase error
+ !! against a finer step grows linearly (a frequency offset) and not quadratically, and the
+ !! second half's rate changes by at most 5e-3 from 100 to 200 steps per cycle (measured
+ !! 1.6e-4 finite EI, 1.9e-4 EI = 0). The coupled lock-in frequency converges at second
+ !! order (test viv_step_order).
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_VIV, ONLY: CD_VIV_TWO_PI
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
+ CD_HermiteCable_Dyn_Set_Drag, CD_HermiteCable_Dyn_Set_VIV, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_Recompute_Acceleration, &
+ CD_HermiteCable_Dyn_Energy, CD_HermiteCable_Dyn_Load_Power, &
+ CD_HermiteCable_Dyn_End, CD_HCDYN_OK
+ USE CableDyn_Dynamic, ONLY: GenAlphaConfig
+ USE CableDyn_Model, ONLY: CD_ModelType, CD_Init_Model, CD_Set_Model_VIV, CD_Step_Model, CD_End_Model, &
+ CD_Recompute_Model_Acceleration, CD_Get_Model_Load_Power, CD_MODEL_OK
+ IMPLICIT NONE
+
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
+ REAL(wp), PARAMETER :: RHOW = 1025.0_wp, D = 0.1_wp, CF = 0.18_wp, DF = 0.08_wp, U = 0.3_wp
+ REAL(wp), PARAMETER :: OMS = CD_VIV_TWO_PI*U/D
+ INTEGER, PARAMETER :: NCYC = 400
+
+ !> The results of one lock-in run (C): the energy mismatch over the VIV work at T/2 and T, the
+ !> mid-span RMS A/D and mean VIV power over the two halves of the last three quarters, and the
+ !> mean shedding rate of the mid-span node over the same halves.
+ TYPE :: lockin_result
+ LOGICAL :: ok = .FALSE.
+ REAL(wp) :: closure(2) = 0.0_wp, ad(2) = 0.0_wp, pviv(2) = 0.0_wp, rate(2) = 0.0_wp
+ END TYPE lockin_result
+
+ INTEGER :: nfail = 0
+
+ CALL check_prescribed()
+ CALL check_lockin(.TRUE., 'finite-EI cable')
+ CALL check_lockin(.FALSE., 'EI = 0 line')
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: long-run VIV phase, energy and statistics'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ PURE REAL(wp) FUNCTION wrap_pi(x) RESULT(y)
+ !! x mapped to [-pi, pi].
+ REAL(wp), INTENT(IN) :: x
+ y = x - CD_VIV_TWO_PI*ANINT(x/CD_VIV_TWO_PI)
+ END FUNCTION wrap_pi
+
+ PURE REAL(wp) FUNCTION rel(x, y) RESULT(r)
+ !! The relative difference of two statistics.
+ REAL(wp), INTENT(IN) :: x, y
+ r = ABS(x - y)/MAX(ABS(x), ABS(y), TINY(1.0_wp))
+ END FUNCTION rel
+
+ PURE REAL(wp) FUNCTION adler_psi(t, psi0, a, b) RESULT(psi)
+ !! The continuous solution of d psi/dt = a - b sin(psi), a > b > 0, from psi(0) = psi0 in
+ !! (-pi, pi): tan(psi/2) = (b + s tan(theta/2))/a, theta = theta0 + s t, s = sqrt(a^2 - b^2),
+ !! continued over the turns of theta.
+ REAL(wp), INTENT(IN) :: t, psi0, a, b
+ REAL(wp) :: s, th, thr, k
+ s = SQRT(a*a - b*b)
+ th = 2.0_wp*ATAN((a*TAN(0.5_wp*psi0) - b)/s) + s*t
+ k = ANINT(th/CD_VIV_TWO_PI)
+ thr = th - CD_VIV_TWO_PI*k
+ psi = CD_VIV_TWO_PI*k + 2.0_wp*ATAN((b + s*TAN(0.5_wp*thr))/a)
+ END FUNCTION adler_psi
+
+ SUBROUTINE check_prescribed()
+ REAL(wp) :: e50(2), e100(2), el(2), rate_err
+ LOGICAL :: ok
+ CALL prescribed(5.5_wp, 50, e50, rate_err, ok)
+ IF (.NOT. ok) RETURN
+ CALL prescribed(5.5_wp, 100, e100, rate_err, ok)
+ IF (.NOT. ok) RETURN
+ WRITE (*, '(A,2ES11.3,A,2ES11.3)') ' P1/P2 outside the band, phase error at T/2, T: 50 steps ', e50, &
+ ', 100 steps ', e100
+ WRITE (*, '(A,3F8.4)') ' P1/P2 growth T/(T/2) at 50, 100 steps, order 50/100: ', e50(2)/e50(1), e100(2)/e100(1), &
+ e50(2)/e100(2)
+ CALL require(e50(2) >= 1.8_wp*e50(1) .AND. e50(2) <= 2.2_wp*e50(1) .AND. &
+ e100(2) >= 1.8_wp*e100(1) .AND. e100(2) <= 2.2_wp*e100(1), &
+ 'P1: the phase error grows linearly in time')
+ CALL require(e50(2) >= 3.6_wp*e100(2) .AND. e50(2) <= 4.4_wp*e100(2), 'P2: the phase error is second order')
+ CALL require(e100(2) <= 0.05_wp, 'P2: at most 0.05 rad after 400 cycles at 100 steps per cycle')
+ CALL prescribed(OMS*(CF + 0.5_wp*DF), 50, el, rate_err, ok)
+ IF (.NOT. ok) RETURN
+ WRITE (*, '(A,2ES11.3,A,ES11.3)') ' P3 inside the band, phase-lag error at T/2, T: ', el, &
+ ', mean rate error ', rate_err
+ CALL require(MAXVAL(el) <= 1.0e-4_wp .AND. el(2) <= 1.1_wp*el(1), 'P3: the locked phase lag holds')
+ CALL require(rate_err <= 1.0e-8_wp, 'P3: the locked shedding rate is the motion frequency')
+ END SUBROUTINE check_prescribed
+
+ SUBROUTINE prescribed(om, nper, err, rate_err, ok)
+ !! Every node of the straight cable moved across the flow as a rigid body at om, nper steps per
+ !! motion cycle over NCYC cycles: err the largest phase error over the nodes at T/2 and T
+ !! (outside the band against the closed form, inside it the phase lag against psi*), rate_err
+ !! the relative error of the mean shedding rate over the second half inside the band.
+ REAL(wp), INTENT(IN) :: om
+ INTEGER, INTENT(IN) :: nper
+ REAL(wp), INTENT(OUT) :: err(2), rate_err
+ LOGICAL, INTENT(OUT) :: ok
+ INTEGER, PARAMETER :: NE = 10, NN = NE + 1
+ REAL(wp), PARAMETER :: SPAN = 20.0_wp, AMP = 1.0e-6_wp, Z0 = -50.0_wp, TW = 1.0e3_wp
+ TYPE(CD_HermiteCableDynType) :: m
+ REAL(wp) :: seed(6*NN), l0(NE), eav(NE), eiv(NE), rhoa(NE), wv(NE), hd(NE), hn(NE), ht(NE)
+ REAL(wp) :: cl(NE), cfv(NE), dfv(NE), pq(3*NN), pv(3*NN), pa(3*NN), dt, t, a, b, phi0(NN), psi0(NN)
+ REAL(wp) :: phu(NN), phold(NN), ex, e, ph_half(NN), psi_star
+ INTEGER :: pdofs(3*NN), i, n, nstep, es
+ CHARACTER(1024) :: em
+ LOGICAL :: locked
+ err = 0.0_wp; rate_err = 0.0_wp
+ seed = 0.0_wp
+ DO i = 1, NN
+ seed(6*(i - 1) + 1) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ seed(6*(i - 1) + 3) = Z0 - AMP
+ seed(6*(i - 1) + 4) = 1.0_wp
+ pdofs(3*i - 2:3*i) = [6*(i - 1) + 1, 6*(i - 1) + 2, 6*(i - 1) + 3]
+ END DO
+ ! a stiff, unstretched cable: the slopes (free) barely turn under the tiny lift and the drag
+ l0 = SPAN/REAL(NE, wp); eav = 5.0e7_wp; eiv = 1.0e6_wp; rhoa = 8.1_wp; wv = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Init(m, l0, eav, eiv, rhoa, wv, seed, pdofs, -1.0e4_wp, 0.0_wp, 1.0_wp, es, em)
+ ok = es == CD_HCDYN_OK
+ CALL require(ok, 'P: init: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ hd = D; hn = 1.2_wp; ht = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_Drag(m, RHOW, hd, hn, ht, 0.0_wp, [0.0_wp, U, 0.0_wp], es, em)
+ ok = es == CD_HCDYN_OK
+ CALL require(ok, 'P: drag: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ cl = 1.0e-3_wp; cfv = CF; dfv = DF
+ CALL CD_HermiteCable_Dyn_Set_VIV(m, cl, cfv, dfv, TW, es, em)
+ ok = es == CD_HCDYN_OK
+ CALL require(ok, 'P: VIV: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ CALL kin(0.0_wp, om, seed, AMP, Z0, NN, pq, pv, pa)
+ CALL CD_HermiteCable_Dyn_Recompute_Acceleration(m, es, em, pres_dofs=pdofs, pres_a=pa)
+ ok = es == CD_HCDYN_OK
+ CALL require(ok, 'P: start acceleration: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ ! the running mean squares start at those of the motion, y' = A om sin(om t)
+ m%viv_ms(1, :) = 0.5_wp*(AMP*om)**2
+ m%viv_ms(2, :) = 0.5_wp*(AMP*om*om)**2
+ a = om - OMS*CF
+ b = OMS*DF
+ locked = ABS(a) < b
+ psi_star = ASIN(MAX(-1.0_wp, MIN(1.0_wp, a/b)))
+ phi0 = m%viv_phi
+ phu = phi0
+ phold = phi0
+ DO i = 1, NN
+ psi0(i) = wrap_pi(-0.5_wp*PI - phi0(i))
+ END DO
+ dt = CD_VIV_TWO_PI/om/REAL(nper, wp)
+ nstep = nper*NCYC
+ DO n = 1, nstep
+ t = REAL(n, wp)*dt
+ CALL kin(t, om, seed, AMP, Z0, NN, pq, pv, pa)
+ CALL CD_HermiteCable_Dyn_Step(m, dt, 50, 1.0e-10_wp, es, em, pres_dofs=pdofs, pres_q=pq, pres_v=pv, pres_a=pa)
+ ok = es == CD_HCDYN_OK
+ CALL require(ok, 'P: step: '//TRIM(em))
+ IF (.NOT. ok) EXIT
+ DO i = 1, NN
+ phu(i) = phu(i) + wrap_pi(m%viv_phi(i) - phold(i))
+ phold(i) = m%viv_phi(i)
+ END DO
+ IF (n /= nstep/2 .AND. n /= nstep) CYCLE
+ e = 0.0_wp
+ DO i = 1, NN
+ IF (locked) THEN
+ ex = wrap_pi(phu(i) - (om*t - 0.5_wp*PI - psi_star))
+ ELSE
+ ex = phu(i) - (phi0(i) + om*t - (adler_psi(t, psi0(i), a, b) - psi0(i)))
+ END IF
+ e = MAX(e, ABS(ex))
+ END DO
+ IF (n == nstep/2) THEN
+ err(1) = e
+ ph_half = phu
+ ELSE
+ err(2) = e
+ END IF
+ END DO
+ IF (ok .AND. locked) rate_err = ABS(SUM(phu - ph_half)/REAL(NN, wp)/(0.5_wp*REAL(nstep, wp)*dt) - om)/om
+ CALL CD_HermiteCable_Dyn_End(m)
+ END SUBROUTINE prescribed
+
+ SUBROUTINE kin(tt, om, seed, amp, z0, nn, pq, pv, pa)
+ !! The prescribed rigid-body motion of every node at time tt.
+ REAL(wp), INTENT(IN) :: tt, om, seed(:), amp, z0
+ INTEGER, INTENT(IN) :: nn
+ REAL(wp), INTENT(OUT) :: pq(:), pv(:), pa(:)
+ INTEGER :: j
+ DO j = 1, nn
+ pq(3*j - 2:3*j) = [seed(6*(j - 1) + 1), 0.0_wp, z0 - amp*COS(om*tt)]
+ pv(3*j - 2:3*j) = [0.0_wp, 0.0_wp, amp*om*SIN(om*tt)]
+ pa(3*j - 2:3*j) = [0.0_wp, 0.0_wp, amp*om*om*COS(om*tt)]
+ END DO
+ END SUBROUTINE kin
+
+ SUBROUTINE check_lockin(finite_ei, label)
+ LOGICAL, INTENT(IN) :: finite_ei
+ CHARACTER(*), INTENT(IN) :: label
+ TYPE(lockin_result) :: r1, r2
+ CALL lockin(finite_ei, 100, r1)
+ IF (.NOT. r1%ok) RETURN
+ CALL lockin(finite_ei, 200, r2)
+ IF (.NOT. r2%ok) RETURN
+ WRITE (*, '(3A,2ES11.3,A,2ES11.3)') ' C1 ', label, ': energy mismatch / VIV work at T/2, T, 100 steps ', &
+ r1%closure, ', 200 steps ', r2%closure
+ WRITE (*, '(3A,4F11.6)') ' C2 ', label, ': RMS A/D and VIV power [W] over the halves ', r1%ad/D, r1%pviv
+ WRITE (*, '(3A,2F12.8,A,F12.8)') ' C3 ', label, ': mean shedding rate [rad/s] over the halves ', r1%rate, &
+ ', at 200 steps ', r2%rate(2)
+ WRITE (*, '(3A,5ES10.2)') ' ', label, ': halves A/D, power, rate; 100 to 200 steps A/D, power ', &
+ rel(r1%ad(1), r1%ad(2)), rel(r1%pviv(1), r1%pviv(2)), rel(r1%rate(1), r1%rate(2)), &
+ rel(r1%ad(2), r2%ad(2)), rel(r1%pviv(2), r2%pviv(2))
+ CALL require(ABS(r1%closure(2)) <= 3.0e-4_wp, 'C1 '//label//': the load powers close the energy balance')
+ CALL require(ABS(r1%closure(2)) >= 3.0_wp*ABS(r2%closure(2)) .AND. &
+ ABS(r1%closure(2)) <= 5.0_wp*ABS(r2%closure(2)), 'C1 '//label//': the mismatch is second order')
+ CALL require(ABS(r1%closure(2)) <= 1.25_wp*ABS(r1%closure(1)), &
+ 'C1 '//label//': the mismatch grows no faster than the work')
+ CALL require(rel(r1%ad(1), r1%ad(2)) <= 2.0e-3_wp .AND. rel(r1%pviv(1), r1%pviv(2)) <= 1.0e-2_wp, &
+ 'C2 '//label//': the response is stationary')
+ CALL require(rel(r1%ad(2), r2%ad(2)) <= 2.0e-3_wp .AND. rel(r1%pviv(2), r2%pviv(2)) <= 1.0e-2_wp, &
+ 'C2 '//label//': the statistics are converged in the step')
+ CALL require(rel(r1%rate(1), r1%rate(2)) <= 2.0e-3_wp, 'C3 '//label//': the lock-in frequency does not drift')
+ CALL require(rel(r1%rate(2), r2%rate(2)) <= 5.0e-3_wp, 'C3 '//label//': the lock-in frequency is converged')
+ END SUBROUTINE check_lockin
+
+ SUBROUTINE lockin(finite_ei, nper, res)
+ !! The taut line locked in over NCYC nominal cycles at nper steps per cycle.
+ LOGICAL, INTENT(IN) :: finite_ei
+ INTEGER, INTENT(IN) :: nper
+ TYPE(lockin_result), INTENT(OUT) :: res
+ INTEGER, PARAMETER :: NE = 10, NN = NE + 1, MIDN = NE/2 + 1
+ REAL(wp), PARAMETER :: SPAN = 20.0_wp, Z0 = -50.0_wp, EA = 5.0e7_wp, MLIN = 8.1_wp, TENS = 3.8e3_wp
+ REAL(wp), PARAMETER :: TW = 0.25_wp
+ TYPE(CD_HermiteCableDynType) :: hm
+ TYPE(CD_ModelType) :: em0
+ TYPE(GenAlphaConfig) :: cfg
+ REAL(wp) :: seed(6*NN), l0(NE), eav(NE), eiv(NE), rhoa(NE), wv(NE), hd(NE), hn(NE), ht(NE)
+ REAL(wp) :: cl(NE), cfv(NE), dfv(NE), dt, tv, e0, e_now, p_prev(3), p_now(3), work(3)
+ REAL(wp) :: q0(3*NN), v0(3*NN), fext(3*NN), fluid(3, NN), wl(NN), z, ph, phold, phu, s2(2), sp(2), cnt(2)
+ REAL(wp) :: ph_mark(3)
+ INTEGER :: conn(2, NE), i, n, nstep, es, n_iter, n0, n1, h
+ CHARACTER(1024) :: em
+ LOGICAL :: conv, stalled, ok
+ tv = D/(CF*U)
+ dt = tv/REAL(nper, wp)
+ nstep = nper*NCYC
+ ! the statistics window: the last three quarters, in two halves (n0, n1] and (n1, nstep]
+ n0 = nper*(NCYC/4)
+ n1 = nper*(NCYC/4 + (NCYC - NCYC/4)/2)
+ cl = 0.8_wp; cfv = CF; dfv = DF
+ l0 = SPAN/REAL(NE, wp)/(1.0_wp + TENS/EA)
+ eav = EA; rhoa = MLIN
+ IF (finite_ei) THEN
+ seed = 0.0_wp
+ DO i = 1, NN
+ seed(6*(i - 1) + 1) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ seed(6*(i - 1) + 3) = Z0
+ seed(6*(i - 1) + 4) = 1.0_wp
+ END DO
+ eiv = 1.0e3_wp; wv = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Init(hm, l0, eav, eiv, rhoa, wv, seed, [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3], &
+ -1.0e4_wp, 0.0_wp, 1.0_wp, es, em)
+ ok = es == CD_HCDYN_OK
+ IF (ok) THEN
+ hd = D; hn = 1.2_wp; ht = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_Drag(hm, RHOW, hd, hn, ht, 0.0_wp, [0.0_wp, U, 0.0_wp], es, em)
+ ok = es == CD_HCDYN_OK
+ END IF
+ IF (ok) THEN
+ CALL CD_HermiteCable_Dyn_Set_VIV(hm, cl, cfv, dfv, TW, es, em)
+ ok = es == CD_HCDYN_OK
+ END IF
+ CALL require(ok, 'C: the finite-EI cable sets up: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ phold = hm%viv_phi(MIDN)
+ ELSE
+ DO i = 1, NE
+ conn(:, i) = [i, i + 1]
+ END DO
+ q0 = 0.0_wp
+ DO i = 1, NN
+ q0(3*i - 2) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ q0(3*i) = Z0
+ END DO
+ v0 = 0.0_wp; fext = 0.0_wp
+ fluid = 0.0_wp; fluid(2, :) = U; wl = 0.0_wp
+ cfg%rho_inf = 1.0_wp
+ CALL CD_Init_Model(em0, q0, v0, conn, l0, eav, rhoa, .TRUE., fext, [1, 2, 3, 3*NN - 2, 3*NN - 1, 3*NN], cfg, &
+ es, em, fluid_velocity=fluid, drag_waterline_z=wl, drag_rho=RHOW, drag_diameter=D, &
+ drag_cdn=1.2_wp, drag_cdt=0.0_wp)
+ ok = es == CD_MODEL_OK
+ IF (ok) THEN
+ hd = D
+ CALL CD_Set_Model_VIV(em0, RHOW, cl, hd, cfv, dfv, TW, es, em)
+ ok = es == CD_MODEL_OK
+ END IF
+ IF (ok) THEN
+ CALL CD_Recompute_Model_Acceleration(em0, es, em)
+ ok = es == CD_MODEL_OK
+ END IF
+ CALL require(ok, 'C: the EI = 0 line sets up: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ phold = em0%viv_phi(MIDN)
+ END IF
+ phu = phold
+ CALL energy(finite_ei, hm, em0, l0, EA, MLIN, e0)
+ CALL powers(finite_ei, hm, em0, NN, p_prev)
+ work = 0.0_wp
+ s2 = 0.0_wp; sp = 0.0_wp; cnt = 0.0_wp
+ ph_mark = 0.0_wp
+ DO n = 1, nstep
+ IF (finite_ei) THEN
+ CALL CD_HermiteCable_Dyn_Step(hm, dt, 50, 1.0e-8_wp, es, em)
+ ok = es == CD_HCDYN_OK
+ ph = hm%viv_phi(MIDN)
+ z = hm%q(6*(MIDN - 1) + 3) - Z0
+ ELSE
+ CALL CD_Step_Model(em0, dt, conv, stalled, n_iter, es, em)
+ ok = es == CD_MODEL_OK .AND. conv
+ ph = em0%viv_phi(MIDN)
+ z = em0%q(3*MIDN) - Z0
+ END IF
+ CALL require(ok, 'C: step: '//TRIM(em))
+ IF (.NOT. ok) EXIT
+ phu = phu + wrap_pi(ph - phold)
+ phold = ph
+ CALL powers(finite_ei, hm, em0, NN, p_now)
+ work = work + 0.5_wp*dt*(p_prev + p_now)
+ p_prev = p_now
+ IF (n == n0) ph_mark(1) = phu
+ IF (n == n1) ph_mark(2) = phu
+ IF (n > n0) THEN
+ h = MERGE(1, 2, n <= n1)
+ s2(h) = s2(h) + z*z
+ sp(h) = sp(h) + p_now(1)
+ cnt(h) = cnt(h) + 1.0_wp
+ END IF
+ IF (n == nstep/2 .OR. n == nstep) THEN
+ CALL energy(finite_ei, hm, em0, l0, EA, MLIN, e_now)
+ res%closure(MERGE(1, 2, n == nstep/2)) = (e_now - e0 - SUM(work))/work(1)
+ END IF
+ END DO
+ ph_mark(3) = phu
+ IF (ok) THEN
+ res%ok = .TRUE.
+ res%ad = SQRT(2.0_wp*s2/cnt)
+ res%pviv = sp/cnt
+ res%rate(1) = (ph_mark(2) - ph_mark(1))/(REAL(n1 - n0, wp)*dt)
+ res%rate(2) = (ph_mark(3) - ph_mark(2))/(REAL(nstep - n1, wp)*dt)
+ END IF
+ IF (finite_ei) THEN
+ CALL CD_HermiteCable_Dyn_End(hm)
+ ELSE
+ CALL CD_End_Model(em0, es, em)
+ END IF
+ END SUBROUTINE lockin
+
+ SUBROUTINE energy(finite_ei, hm, em0, l0, ea, mlin, e)
+ !! The line's kinetic plus elastic energy: the finite-EI cable's own (consistent mass), or for
+ !! the EI = 0 line the consistent translational mass (rho_a l0/6 [[2, 1], [1, 2]]) and the
+ !! tension-only axial strain energy EA (l - l0)^2/(2 l0).
+ LOGICAL, INTENT(IN) :: finite_ei
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: hm
+ TYPE(CD_ModelType), INTENT(IN) :: em0
+ REAL(wp), INTENT(IN) :: l0(:), ea, mlin
+ REAL(wp), INTENT(OUT) :: e
+ INTEGER :: k, ia, ib, ess
+ REAL(wp) :: l, kin_, str_
+ CHARACTER(256) :: emm
+ IF (finite_ei) THEN
+ CALL CD_HermiteCable_Dyn_Energy(hm, kin_, str_, ess, emm)
+ CALL require(ess == CD_HCDYN_OK, 'C: energy: '//TRIM(emm))
+ e = kin_ + str_
+ ELSE
+ e = 0.0_wp
+ DO k = 1, SIZE(l0)
+ ia = 3*k - 2; ib = 3*k + 1
+ e = e + mlin*l0(k)/6.0_wp*(DOT_PRODUCT(em0%v(ia:ia + 2), em0%v(ia:ia + 2)) + &
+ DOT_PRODUCT(em0%v(ia:ia + 2), em0%v(ib:ib + 2)) + &
+ DOT_PRODUCT(em0%v(ib:ib + 2), em0%v(ib:ib + 2)))
+ l = NORM2(em0%q(ib:ib + 2) - em0%q(ia:ia + 2))
+ IF (l > l0(k)) e = e + 0.5_wp*ea*(l - l0(k))**2/l0(k)
+ END DO
+ END IF
+ END SUBROUTINE energy
+
+ SUBROUTINE powers(finite_ei, hm, em0, nn, p)
+ !! The line totals of the VIV, drag and damping powers.
+ LOGICAL, INTENT(IN) :: finite_ei
+ TYPE(CD_HermiteCableDynType), INTENT(IN) :: hm
+ TYPE(CD_ModelType), INTENT(IN) :: em0
+ INTEGER, INTENT(IN) :: nn
+ REAL(wp), INTENT(OUT) :: p(3)
+ REAL(wp) :: pv(nn), pd(nn), pm(nn)
+ INTEGER :: ess
+ CHARACTER(256) :: emm
+ IF (finite_ei) THEN
+ CALL CD_HermiteCable_Dyn_Load_Power(hm, pv, pd, pm, ess, emm)
+ ELSE
+ CALL CD_Get_Model_Load_Power(em0, pv, pd, pm, ess, emm)
+ END IF
+ CALL require(ess == 0, 'C: load power: '//TRIM(emm))
+ p = [SUM(pv), SUM(pd), SUM(pm)]
+ END SUBROUTINE powers
+
+END PROGRAM test_viv_long_run
diff --git a/tests/test_viv_step_order.f90 b/tests/test_viv_step_order.f90
new file mode 100644
index 00000000..7b5373c0
--- /dev/null
+++ b/tests/test_viv_step_order.f90
@@ -0,0 +1,243 @@
+! File: tests/test_viv_step_order.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_step_order
+ !! Time-step convergence of a locked-in VIV response, the line and the synchronisation model
+ !! coupled: a weightless taut line (20 m, 10 elements, D 0.1 m, 8.1 kg/m, EA 5e7 N, 3.8 kN; the
+ !! finite-EI cable with EI 1e3 N m^2), pinned at both ends in a 0.3 m/s cross current, Cl 0.8,
+ !! cF 0.18, dF 0.08, Cd 1.2, running RMS window 0.25 s. It locks in at about 0.65 Hz with a
+ !! mid-span A/D of 0.57 (0.55 on the cable). The lock-in frequency is the mean shedding rate of
+ !! the mid-span node over the second half of 200 nominal cycles D/(cF U) = 1.85 s, at n steps per
+ !! cycle.
+ !!
+ !! The phase advances by the implicit mid-point rule on the mid-step motion, the velocity and
+ !! acceleration the step means from the converged positions and velocities, and its lift is
+ !! predicted from the last step's mid-point rate: the
+ !! coupled response is second order in the step at any rho_inf. Sampling the committed
+ !! generalised-alpha acceleration instead made it first order (that acceleration is the line's
+ !! at t_n + (alpha_m - alpha_f) dt) and, at rho_inf = 1, where it carries an undamped alternating
+ !! mode, it converged to a frequency 3.4 % low (over 400 cycles 3.9403 rad/s at 3200 steps per
+ !! cycle against 4.0797). On that code every check below fails: the ratios were 2.44, 2.27, 2.18
+ !! and 2.76, and the rho_inf = 0.4 frequency 3.1 % off the rho_inf = 1 one. Tolerances from a
+ !! gfortran Release run, the measured value with each:
+ !!
+ !! S1 EI = 0 line, rho_inf = 1: the frequency changes from 100 to 200 and from 200 to 400 steps
+ !! per cycle in a ratio in [3, 5.5] (second order 4; measured 3.99), and at 200 steps per cycle
+ !! it is within 2e-4 of the 400-step one (measured 5.3e-5);
+ !! S2 the same line at the deck default rho_inf = 0.4: second order the same way (measured 3.67),
+ !! and its frequency at 200 steps per cycle within 1e-4 of the rho_inf = 1 one (measured
+ !! 4.3e-5): the numerical damping no longer moves the lock-in;
+ !! S3 the wake oscillator on the EI = 0 line (St 0.2, eps 0.3, A 12, C_L0 0.3, rho_inf 0.8): the
+ !! mid-span frequency from upward zero crossings, second order the same way (measured 3.90);
+ !! S4 the finite-EI cable, rho_inf = 0.8, 200 to 800 steps per cycle: second order the same way
+ !! (measured 4.39).
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_VIV, ONLY: CD_VIV_TWO_PI
+ USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, &
+ CD_HermiteCable_Dyn_Set_Drag, CD_HermiteCable_Dyn_Set_VIV, &
+ CD_HermiteCable_Dyn_Step, CD_HermiteCable_Dyn_End, CD_HCDYN_OK
+ USE CableDyn_Dynamic, ONLY: GenAlphaConfig
+ USE CableDyn_Model, ONLY: CD_ModelType, CD_Init_Model, CD_Set_Model_VIV, CD_Step_Model, CD_End_Model, &
+ CD_Recompute_Model_Acceleration, CD_MODEL_OK
+ IMPLICIT NONE
+
+ REAL(wp), PARAMETER :: RHOW = 1025.0_wp, D = 0.1_wp, CF = 0.18_wp, DF = 0.08_wp, U = 0.3_wp
+ INTEGER, PARAMETER :: NCYC = 200
+ INTEGER :: nfail = 0
+ REAL(wp) :: r(3), r04(3), ratio
+
+ ! S1
+ CALL sweep(.FALSE., 1.0_wp, .FALSE., [100, 200, 400], r)
+ ratio = (r(2) - r(1))/(r(3) - r(2))
+ WRITE (*, '(A,3F14.9,A,F7.3)') ' S1 EI = 0 line, rho_inf 1, 100/200/400 steps: ', r, ' rad/s, ratio ', ratio
+ CALL require(ratio >= 3.0_wp .AND. ratio <= 5.5_wp, 'S1: the lock-in frequency is second order in the step')
+ CALL require(ABS(r(2) - r(3)) <= 2.0e-4_wp*r(3), 'S1: at 200 steps per cycle it is within 2e-4 of 400')
+ ! S2
+ CALL sweep(.FALSE., 0.4_wp, .FALSE., [100, 200, 400], r04)
+ ratio = (r04(2) - r04(1))/(r04(3) - r04(2))
+ WRITE (*, '(A,3F14.9,A,F7.3,A,ES10.2)') ' S2 rho_inf 0.4: ', r04, ' rad/s, ratio ', ratio, &
+ ', against rho_inf 1 at 200 steps ', ABS(r04(2) - r(2))/r(2)
+ CALL require(ratio >= 3.0_wp .AND. ratio <= 5.5_wp, 'S2: second order at rho_inf 0.4')
+ CALL require(ABS(r04(2) - r(2)) <= 1.0e-4_wp*r(2), 'S2: the lock-in does not depend on rho_inf')
+ ! S3
+ CALL sweep(.FALSE., 0.8_wp, .TRUE., [100, 200, 400], r)
+ ratio = (r(2) - r(1))/(r(3) - r(2))
+ WRITE (*, '(A,3F14.9,A,F7.3)') ' S3 wake oscillator, crossing frequency: ', r, ' rad/s, ratio ', ratio
+ CALL require(ratio >= 3.0_wp .AND. ratio <= 5.5_wp, 'S3: the wake response is second order in the step')
+ ! S4
+ CALL sweep(.TRUE., 0.8_wp, .FALSE., [200, 400, 800], r)
+ ratio = (r(2) - r(1))/(r(3) - r(2))
+ WRITE (*, '(A,3F14.9,A,F7.3)') ' S4 finite-EI cable, rho_inf 0.8, 200/400/800 steps: ', r, ' rad/s, ratio ', ratio
+ CALL require(ratio >= 3.0_wp .AND. ratio <= 5.5_wp, 'S4: the cable lock-in is second order in the step')
+
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: coupled VIV response second order in the time step'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE sweep(finite_ei, rho_inf, wake, nper, freq)
+ !! The lock-in frequency at each of the steps per cycle nper.
+ LOGICAL, INTENT(IN) :: finite_ei, wake
+ REAL(wp), INTENT(IN) :: rho_inf
+ INTEGER, INTENT(IN) :: nper(3)
+ REAL(wp), INTENT(OUT) :: freq(3)
+ INTEGER :: k
+ DO k = 1, 3
+ freq(k) = lockin(finite_ei, rho_inf, wake, nper(k))
+ END DO
+ END SUBROUTINE sweep
+
+ REAL(wp) FUNCTION lockin(finite_ei, rho_inf, wake, nper) RESULT(freq)
+ !! The mean shedding rate of the mid-span node over the second half of NCYC cycles (with the
+ !! wake oscillator, the mean frequency of the upward zero crossings of its cross-flow
+ !! displacement there), 0 on a failed set-up or step.
+ LOGICAL, INTENT(IN) :: finite_ei, wake
+ REAL(wp), INTENT(IN) :: rho_inf
+ INTEGER, INTENT(IN) :: nper
+ INTEGER, PARAMETER :: NE = 10, NN = NE + 1, MIDN = NE/2 + 1
+ REAL(wp), PARAMETER :: SPAN = 20.0_wp, Z0 = -50.0_wp, EA = 5.0e7_wp, MLIN = 8.1_wp, TENS = 3.8e3_wp
+ REAL(wp), PARAMETER :: TW = 0.25_wp
+ TYPE(CD_HermiteCableDynType) :: hm
+ TYPE(CD_ModelType) :: em0
+ TYPE(GenAlphaConfig) :: cfg
+ REAL(wp) :: seed(6*NN), l0(NE), eav(NE), eiv(NE), rhoa(NE), wv(NE), hd(NE), hn(NE), ht(NE), wk(3, NE)
+ REAL(wp) :: cl(NE), cfv(NE), dfv(NE), dt, q0(3*NN), v0(3*NN), fext(3*NN), fluid(3, NN), wl(NN)
+ REAL(wp) :: z, zold, ph, phold, phu, ph0, tc1, tcn, t
+ INTEGER :: conn(2, NE), i, n, nstep, n0, es, n_iter, ncross
+ CHARACTER(1024) :: em
+ LOGICAL :: conv, stalled, ok
+ freq = 0.0_wp
+ dt = D/(CF*U)/REAL(nper, wp)
+ nstep = nper*NCYC
+ n0 = nstep/2
+ cl = MERGE(0.3_wp, 0.8_wp, wake)
+ cfv = CF
+ dfv = DF
+ wk(1, :) = 0.2_wp
+ wk(2, :) = 0.3_wp
+ wk(3, :) = 12.0_wp
+ l0 = SPAN/REAL(NE, wp)/(1.0_wp + TENS/EA)
+ eav = EA
+ rhoa = MLIN
+ IF (finite_ei) THEN
+ seed = 0.0_wp
+ DO i = 1, NN
+ seed(6*(i - 1) + 1) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ seed(6*(i - 1) + 3) = Z0
+ seed(6*(i - 1) + 4) = 1.0_wp
+ END DO
+ eiv = 1.0e3_wp
+ wv = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Init(hm, l0, eav, eiv, rhoa, wv, seed, [1, 2, 3, 6*NE + 1, 6*NE + 2, 6*NE + 3], &
+ -1.0e4_wp, 0.0_wp, rho_inf, es, em)
+ ok = es == CD_HCDYN_OK
+ IF (ok) THEN
+ hd = D
+ hn = 1.2_wp
+ ht = 0.0_wp
+ CALL CD_HermiteCable_Dyn_Set_Drag(hm, RHOW, hd, hn, ht, 0.0_wp, [0.0_wp, U, 0.0_wp], es, em)
+ ok = es == CD_HCDYN_OK
+ END IF
+ IF (ok) THEN
+ IF (wake) THEN
+ CALL CD_HermiteCable_Dyn_Set_VIV(hm, cl, cfv, dfv, TW, es, em, wake=wk)
+ ELSE
+ CALL CD_HermiteCable_Dyn_Set_VIV(hm, cl, cfv, dfv, TW, es, em)
+ END IF
+ ok = es == CD_HCDYN_OK
+ END IF
+ CALL require(ok, 'set-up of the finite-EI cable: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ phold = hm%viv_phi(MIDN)
+ ELSE
+ DO i = 1, NE
+ conn(:, i) = [i, i + 1]
+ END DO
+ q0 = 0.0_wp
+ DO i = 1, NN
+ q0(3*i - 2) = SPAN*REAL(i - 1, wp)/REAL(NE, wp)
+ q0(3*i) = Z0
+ END DO
+ v0 = 0.0_wp
+ fext = 0.0_wp
+ fluid = 0.0_wp
+ fluid(2, :) = U
+ wl = 0.0_wp
+ cfg%rho_inf = rho_inf
+ CALL CD_Init_Model(em0, q0, v0, conn, l0, eav, rhoa, .TRUE., fext, [1, 2, 3, 3*NN - 2, 3*NN - 1, 3*NN], cfg, &
+ es, em, fluid_velocity=fluid, drag_waterline_z=wl, drag_rho=RHOW, drag_diameter=D, &
+ drag_cdn=1.2_wp, drag_cdt=0.0_wp)
+ ok = es == CD_MODEL_OK
+ IF (ok) THEN
+ hd = D
+ IF (wake) THEN
+ CALL CD_Set_Model_VIV(em0, RHOW, cl, hd, cfv, dfv, TW, es, em, wake=wk)
+ ELSE
+ CALL CD_Set_Model_VIV(em0, RHOW, cl, hd, cfv, dfv, TW, es, em)
+ END IF
+ ok = es == CD_MODEL_OK
+ END IF
+ IF (ok) THEN
+ CALL CD_Recompute_Model_Acceleration(em0, es, em)
+ ok = es == CD_MODEL_OK
+ END IF
+ CALL require(ok, 'set-up of the EI = 0 line: '//TRIM(em))
+ IF (.NOT. ok) RETURN
+ phold = em0%viv_phi(MIDN)
+ END IF
+ phu = phold
+ ph0 = 0.0_wp
+ zold = 0.0_wp
+ ncross = 0
+ tc1 = 0.0_wp
+ tcn = 0.0_wp
+ DO n = 1, nstep
+ IF (finite_ei) THEN
+ CALL CD_HermiteCable_Dyn_Step(hm, dt, 50, 1.0e-8_wp, es, em)
+ ok = es == CD_HCDYN_OK
+ ph = hm%viv_phi(MIDN)
+ z = hm%q(6*(MIDN - 1) + 3) - Z0
+ ELSE
+ CALL CD_Step_Model(em0, dt, conv, stalled, n_iter, es, em)
+ ok = es == CD_MODEL_OK .AND. conv
+ ph = em0%viv_phi(MIDN)
+ z = em0%q(3*MIDN) - Z0
+ END IF
+ CALL require(ok, 'step: '//TRIM(em))
+ IF (.NOT. ok) EXIT
+ phu = phu + (ph - phold) - CD_VIV_TWO_PI*ANINT((ph - phold)/CD_VIV_TWO_PI)
+ phold = ph
+ t = REAL(n, wp)*dt
+ IF (n == n0) ph0 = phu
+ IF (n > n0 .AND. zold <= 0.0_wp .AND. z > 0.0_wp) THEN
+ IF (ncross == 0) tc1 = t - dt*z/(z - zold)
+ tcn = t - dt*z/(z - zold)
+ ncross = ncross + 1
+ END IF
+ zold = z
+ END DO
+ IF (ok) THEN
+ IF (wake) THEN
+ IF (ncross > 1) freq = CD_VIV_TWO_PI*REAL(ncross - 1, wp)/(tcn - tc1)
+ ELSE
+ freq = (phu - ph0)/(REAL(nstep - n0, wp)*dt)
+ END IF
+ END IF
+ IF (finite_ei) THEN
+ CALL CD_HermiteCable_Dyn_End(hm)
+ ELSE
+ CALL CD_End_Model(em0, es, em)
+ END IF
+ END FUNCTION lockin
+END PROGRAM test_viv_step_order
diff --git a/tests/test_viv_stochastic.f90 b/tests/test_viv_stochastic.f90
new file mode 100644
index 00000000..304e371a
--- /dev/null
+++ b/tests/test_viv_stochastic.f90
@@ -0,0 +1,284 @@
+! File: tests/test_viv_stochastic.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_stochastic
+ !! The stochastic band centre of the synchronisation model (VIV STOCHASTIC section; Ulveseter et
+ !! al. 2017, Eq. 6, Fig. 4): the centre cF of a node becomes cF + sum_i a sin(p_i + 2 pi f_i
+ !! theta), theta = integral U/D dt, of N_f components of a flat spectrum up to c cF.
+ !! S1 the process (CD_VIV_Sto_Node, CD_VIV_Sto_Centre) at their NDP values (cF 0.144, sigma 0.016,
+ !! c 0.07, 100 components) over theta 0-4e6 (about 200 periods of the lowest component)
+ !! sampled every 5: mean within 0.03 sigma of cF, standard deviation within 3 % of sigma (the
+ !! components' amplitudes give exactly sigma), excess kurtosis within 0.3 of a Gaussian's 0;
+ !! no component above c cF; the start phases repeat for the same seed and node and differ
+ !! between nodes and between seeds;
+ !! S2 a sigma 0 row is the deck without the section, bit for bit, on the finite-EI cable and on
+ !! the EI = 0 line (the taut cable of the VIV FRAME gates in a 0.15 m/s current);
+ !! S3 with sigma 0.02 (c 0.07, 100 components) the run repeats bit for bit, differs from the
+ !! constant centre and between seeds, and stays locked in (A/D over 50-80 s within 15 % of the
+ !! constant centre's), on both cores;
+ !! S4 refusals by name: a row on a type without Cl, on a wake-oscillator type, with c out of
+ !! (0, 1], with a non-integer Nf and with a seed out of range.
+ !! The checkpoint restart and rewind with the centre are in test_viv_coupled.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_VIV, ONLY: CD_VIV_Sto_Node, CD_VIV_Sto_Centre
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, D = 0.1_wp
+ REAL(wp), PARAMETER :: TMAX = 80.0_wp, T0 = 50.0_wp
+ INTEGER :: nfail = 0
+
+ CALL check_process()
+ CALL write_current('vsd_current.dat')
+ CALL check_deck('1.0', 'vsd_fe')
+ CALL check_deck('0.0', 'vsd_l')
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: VIV STOCHASTIC gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE check_process()
+ REAL(wp), PARAMETER :: CF = 0.144_wp, SIG = 0.016_wp, C = 0.07_wp
+ INTEGER, PARAMETER :: NF = 100, NS = 800000
+ REAL(wp) :: a, f(NF), p(NF), a2, f2(NF), p2(NF), x, s1, s2, s4, mean, sd, kurt
+ INTEGER :: k
+ CALL CD_VIV_Sto_Node(SIG, C, CF, NF, 7, 12, a, f, p)
+ s1 = 0.0_wp
+ s2 = 0.0_wp
+ s4 = 0.0_wp
+ DO k = 0, NS - 1
+ x = CD_VIV_Sto_Centre(CF, a, f, p, 5.0_wp*REAL(k, wp)) - CF
+ s1 = s1 + x
+ END DO
+ mean = s1/REAL(NS, wp)
+ DO k = 0, NS - 1
+ x = CD_VIV_Sto_Centre(CF, a, f, p, 5.0_wp*REAL(k, wp)) - CF - mean
+ s2 = s2 + x*x
+ s4 = s4 + x**4
+ END DO
+ sd = SQRT(s2/REAL(NS, wp))
+ kurt = (s4/REAL(NS, wp))/(s2/REAL(NS, wp))**2 - 3.0_wp
+ WRITE (*, '(A,3ES12.4)') 'S1 mean - cF, sd/sigma, excess kurtosis: ', mean, sd/SIG, kurt
+ CALL require(ABS(mean) <= 0.03_wp*SIG, 'S1: the process has the mean cF')
+ CALL require(ABS(sd/SIG - 1.0_wp) <= 0.03_wp, 'S1: the process has the standard deviation sigma')
+ CALL require(ABS(kurt) <= 0.3_wp, 'S1: the process is close to Gaussian')
+ CALL require(ABS(a*a*REAL(NF, wp)/2.0_wp - SIG*SIG) <= 1.0e-15_wp, 'S1: the amplitudes give sigma^2')
+ CALL require(MAXVAL(f) < C*CF .AND. MINVAL(f) > 0.0_wp, 'S1: the spectrum lies in (0, c cF]')
+ CALL require(ALL(p >= 0.0_wp .AND. p < 2.0_wp*PI), 'S1: the start phases lie in [0, 2 pi)')
+ CALL CD_VIV_Sto_Node(SIG, C, CF, NF, 7, 12, a2, f2, p2)
+ CALL require(ALL(.NOT. (ABS(p2 - p) > 0.0_wp)), 'S1: the same seed and node repeat the phases')
+ CALL CD_VIV_Sto_Node(SIG, C, CF, NF, 7, 13, a2, f2, p2)
+ CALL require(COUNT(.NOT. (ABS(p2 - p) > 0.0_wp)) == 0, 'S1: another node draws other phases')
+ CALL CD_VIV_Sto_Node(SIG, C, CF, NF, 8, 12, a2, f2, p2)
+ CALL require(COUNT(.NOT. (ABS(p2 - p) > 0.0_wp)) == 0, 'S1: another seed draws other phases')
+ END SUBROUTINE check_process
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the VIV STOCHASTIC deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_deck(path, ei, tmax_, sto_row, cl, wake)
+ !! The taut cable of EI ei in the current; sto_row: the VIV STOCHASTIC data row (no section
+ !! without it); cl the LINE TYPES Cl (default 0.8); wake: a WAKE OSCILLATOR row instead of the lift.
+ CHARACTER(*), INTENT(IN) :: path, ei
+ REAL(wp), INTENT(IN) :: tmax_
+ CHARACTER(*), INTENT(IN), OPTIONAL :: sto_row, cl
+ LOGICAL, INTENT(IN), OPTIONAL :: wake
+ CHARACTER(8) :: cl_col
+ LOGICAL :: wo
+ INTEGER :: u
+ cl_col = '0.8'
+ IF (PRESENT(cl)) cl_col = cl
+ wo = .FALSE.
+ IF (PRESENT(wake)) wo = wake
+ IF (wo) cl_col = '0.0'
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'VIV STOCHASTIC deck gate: taut cable in a uniform current'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ 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'
+ 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'
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ 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 (wo) THEN
+ WRITE (u, '(A)') '--------------------- WAKE OSCILLATOR ----------------------------------'
+ WRITE (u, '(A)') 'TypeName CL0 St eps A'
+ WRITE (u, '(A)') 'riser 0.3 0.2 0.3 12'
+ END IF
+ IF (PRESENT(sto_row)) THEN
+ WRITE (u, '(A)') '--------------------- VIV STOCHASTIC -----------------------------------'
+ WRITE (u, '(A)') 'TypeName sigma c Nf seed'
+ WRITE (u, '(A)') sto_row
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '0.01 dtM'
+ WRITE (u, '(A)') '100.0 WtrDpth'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ WRITE (u, '(A)') 'vsd_current.dat WaterKin'
+ WRITE (u, '(A,F8.3,A)') ' ', tmax_, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (u, '(A)') 'L1N25PZ'
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ REAL(wp) FUNCTION amplitude(root) RESULT(ad)
+ !! Half the peak-to-peak mid-span cross-flow excursion over D over T0-TMAX (0 without rows).
+ CHARACTER(*), INTENT(IN) :: root
+ CHARACTER(1024) :: rec
+ REAL(wp) :: row(2), zmin, zmax
+ INTEGER :: u, ios
+ ad = 0.0_wp
+ zmin = HUGE(1.0_wp)
+ zmax = -HUGE(1.0_wp)
+ OPEN (NEWUNIT=u, FILE=root//'.out', STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ READ (rec, *) row
+ IF (row(1) < T0) CYCLE
+ zmin = MIN(zmin, row(2))
+ zmax = MAX(zmax, row(2))
+ END DO
+ CLOSE (u)
+ IF (zmax > zmin) ad = 0.5_wp*(zmax - zmin)/D
+ END FUNCTION amplitude
+
+ LOGICAL FUNCTION same_file(a, b) RESULT(same)
+ !! The two text files are the same, line for line.
+ CHARACTER(*), INTENT(IN) :: a, b
+ CHARACTER(1024) :: ra, rb
+ INTEGER :: ua, ub, ia, ib
+ same = .FALSE.
+ OPEN (NEWUNIT=ua, FILE=a, STATUS='OLD', ACTION='READ', IOSTAT=ia)
+ IF (ia /= 0) RETURN
+ OPEN (NEWUNIT=ub, FILE=b, STATUS='OLD', ACTION='READ', IOSTAT=ib)
+ IF (ib /= 0) THEN
+ CLOSE (ua); RETURN
+ END IF
+ DO
+ READ (ua, '(A)', IOSTAT=ia) ra
+ READ (ub, '(A)', IOSTAT=ib) rb
+ IF (ia /= 0 .OR. ib /= 0) EXIT
+ IF (ra /= rb) EXIT
+ END DO
+ same = ia /= 0 .AND. ib /= 0
+ CLOSE (ua)
+ CLOSE (ub)
+ END FUNCTION same_file
+
+ SUBROUTINE check_deck(ei, tag)
+ !! S2 and S3 on the cable of EI ei.
+ CHARACTER(*), INTENT(IN) :: ei, tag
+ LOGICAL :: ok, same
+ CHARACTER(1024) :: msg
+ CHARACTER(:), ALLOCATABLE :: lab
+ REAL(wp) :: ad0, ad1
+ lab = ' (EI '//ei//')'
+ CALL write_deck(tag//'_none.dat', ei, TMAX)
+ CALL run(tag//'_none.dat', tag//'_none', ok, msg)
+ CALL require(ok, 'S2: the deck without the section runs'//lab//': '//TRIM(msg))
+ CALL write_deck(tag//'_s0.dat', ei, TMAX, sto_row='riser 0 0.07 100 3')
+ CALL run(tag//'_s0.dat', tag//'_s0', ok, msg)
+ CALL require(ok, 'S2: the deck with sigma 0 runs'//lab//': '//TRIM(msg))
+ CALL require(same_file(tag//'_none.out', tag//'_s0.out'), 'S2: a sigma 0 row is the deck without it, '// &
+ 'bit for bit'//lab)
+ CALL write_deck(tag//'_s1.dat', ei, TMAX, sto_row='riser 0.02 0.07 100 3')
+ CALL run(tag//'_s1.dat', tag//'_s1', ok, msg)
+ CALL require(ok, 'S3: the deck with sigma 0.02 runs'//lab//': '//TRIM(msg))
+ CALL run(tag//'_s1.dat', tag//'_s1b', ok, msg)
+ same = same_file(tag//'_s1.out', tag//'_s1b.out')
+ CALL require(ok .AND. same, 'S3: the run repeats bit for bit'//lab)
+ CALL require(.NOT. same_file(tag//'_none.out', tag//'_s1.out'), 'S3: the centre moves the response'//lab)
+ CALL write_deck(tag//'_s2.dat', ei, TMAX, sto_row='riser 0.02 0.07 100 4')
+ CALL run(tag//'_s2.dat', tag//'_s2', ok, msg)
+ same = same_file(tag//'_s1.out', tag//'_s2.out')
+ CALL require(ok .AND. .NOT. same, 'S3: another seed, another run'//lab)
+ ad0 = amplitude(tag//'_none')
+ ad1 = amplitude(tag//'_s1')
+ WRITE (*, '(A,2F8.4)') 'S3'//lab//': A/D over 50-80 s with the constant and the stochastic centre ', ad0, ad1
+ CALL require(ad0 > 0.2_wp .AND. ABS(ad1/ad0 - 1.0_wp) <= 0.15_wp, 'S3: the cable stays locked in'//lab)
+ END SUBROUTINE check_deck
+
+ SUBROUTINE refuse(tag, sto_row, want, label, cl, wake)
+ CHARACTER(*), INTENT(IN) :: tag, sto_row, want, label
+ CHARACTER(*), INTENT(IN), OPTIONAL :: cl
+ LOGICAL, INTENT(IN), OPTIONAL :: wake
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck(tag//'.dat', '1.0', 1.0_wp, sto_row=sto_row, cl=cl, wake=wake)
+ CALL run(tag//'.dat', tag, ok, msg)
+ WRITE (*, '(A)') 'S4 '//label//': '//TRIM(msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, want) > 0, 'S4: '//label//' is refused')
+ END SUBROUTINE refuse
+
+ SUBROUTINE check_refusals()
+ CALL refuse('vsd_nocl', 'riser 0.02 0.07', 'give the type LINE TYPES Cl > 0 and no WAKE OSCILLATOR row', &
+ 'a type without Cl', cl='0.0')
+ CALL refuse('vsd_wake', 'riser 0.02 0.07', 'give the type LINE TYPES Cl > 0 and no WAKE OSCILLATOR row', &
+ 'a wake-oscillator type', wake=.TRUE.)
+ CALL refuse('vsd_c', 'riser 0.02 1.5', '0 < c <= 1', 'c above 1')
+ CALL refuse('vsd_nf', 'riser 0.02 0.07 10.5', 'Nf must be an integer', 'a non-integer Nf')
+ CALL refuse('vsd_seed', 'riser 0.02 0.07 100 -1', 'seed must be an integer', 'a negative seed')
+ END SUBROUTINE check_refusals
+
+END PROGRAM test_viv_stochastic
diff --git a/tests/test_viv_wake_deck.f90 b/tests/test_viv_wake_deck.f90
new file mode 100644
index 00000000..5bccad05
--- /dev/null
+++ b/tests/test_viv_wake_deck.f90
@@ -0,0 +1,454 @@
+! File: tests/test_viv_wake_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_wake_deck
+ !! Wake-oscillator VIV on a deck (the optional WAKE OSCILLATOR section, TypeName CL0 [St [eps
+ !! [A]]], and the VIV FRAME section, TypeName Tf; Facchinetti et al. 2004): the taut cable of the in-line VIV gate (100 m, D 0.1 m,
+ !! 50 kN, pinned at 50 m depth) in a uniform 0.15 m/s current along y, its type with no
+ !! synchronisation lift (Cl 0) and the row riser 0.3 (St 0.2, eps 0.3, A 12). W1-W3 run on the
+ !! finite-EI cable (EI 1 N m^2) and on the EI = 0 line alike.
+ !! W1 lock-in: with the acceleration coupling A 12 the cross-flow response is captured by the
+ !! cable's first mode, below the wake's own frequency St U/D = 0.30 Hz by more than
+ !! 0.01 Hz, at a steady mid-span A/D between 0.4 and 0.8; uncoupled (A 0) the wake drives
+ !! the cable at its own 0.30 Hz (within 0.005 Hz), and the coupled amplitude is at least
+ !! three times the uncoupled one;
+ !! W2 power: over 60-100 s the mean wake-lift power (VIVPow1) is positive and the drag and
+ !! damping powers (DragPow1, DampPow1) take it out within 0.5 %;
+ !! W3 a row with CL0 0 is the deck without the section, to the printed digits;
+ !! W4 refusals by name: a malformed or non-numeric row, an unknown or repeated type, St, eps or
+ !! A out of range, a type that keeps its synchronisation lift (Cl > 0, which in-line VIV
+ !! also needs), and a line that mixes the two models (finite-EI and EI = 0);
+ !! W5 the two cores agree: the EI = 0 line locks in within 3 % of the finite-EI cable's A/D
+ !! and 0.003 Hz of its frequency, and so does its uncoupled response;
+ !! W6 a finite-EI cable towed through still water: both ends move at 0.15 m/s against y (a
+ !! 10 s half-cosine ramp), no current. With the filter time Tf 10 s the wake frequency takes
+ !! the flow relative to the cable's filtered motion, and the cable locks in as the fixed
+ !! cable in the 0.15 m/s current does (A/D within 5 %, frequency within 0.003 Hz); without
+ !! it (the ambient flow, zero) the wake does not lock in (A/D below a tenth of that). The
+ !! 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 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
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, D = 0.1_wp, F_WAKE = 0.2_wp*0.15_wp/0.1_wp
+ INTEGER :: nfail = 0
+ REAL(wp) :: ad_fe(4) = 0.0_wp, ad_l(4) = 0.0_wp, af_fe(2) = 0.0_wp, af_l(2) = 0.0_wp
+
+ CALL write_current('wod_current.dat')
+ CALL check_runs('1.0', 'wod', ad_fe)
+ CALL check_runs('0.0', 'wod0', ad_l)
+ WRITE (*, '(A,4F8.4)') 'W5: lock-in A/D, f [Hz] finite-EI, EI = 0: ', ad_fe(1:2), ad_l(1:2)
+ WRITE (*, '(A,4F8.4)') 'W5: uncoupled A/D, f [Hz] finite-EI, EI = 0: ', ad_fe(3:4), ad_l(3:4)
+ CALL require(ABS(ad_l(1)/ad_fe(1) - 1.0_wp) <= 0.03_wp .AND. ABS(ad_l(2) - ad_fe(2)) <= 0.003_wp, &
+ 'W5: the EI = 0 line locks in as the finite-EI cable')
+ CALL require(ABS(ad_l(3)/ad_fe(3) - 1.0_wp) <= 0.03_wp .AND. ABS(ad_l(4) - ad_fe(4)) <= 0.003_wp, &
+ 'W5: and responds uncoupled as it')
+ CALL write_tow('wod_tow.txt')
+ CALL check_tow('wodt', ad_fe)
+ CALL check_filter_fixed('1.0', 'wodf', ad_fe, af_fe)
+ CALL check_filter_fixed('0.0', 'wodf0', ad_l, af_l)
+ CALL require(ABS(af_l(1)/af_fe(1) - 1.0_wp) <= 0.03_wp .AND. ABS(af_l(2) - af_fe(2)) <= 0.003_wp, &
+ 'W6: with Tf the EI = 0 line locks in as the finite-EI cable')
+ CALL check_refusals()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: wake-oscillator deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_current(path)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') 'MoorDyn v2 water kinematics file'
+ WRITE (u, '(A)') 'uniform current along y for the wake-oscillator deck gate'
+ WRITE (u, '(A)') '--------------------------- WAVES -------------------------------------'
+ WRITE (u, '(A)') '0 WaveKinMod - type of wave input'
+ WRITE (u, '(A)') '"" WaveKinFile - file containing wave elevation time series'
+ WRITE (u, '(A)') '0.000000E+00 dtWave - time step to use in setting up wave kinematics grid (s)'
+ WRITE (u, '(A)') '0 WaveDir - wave heading (deg)'
+ WRITE (u, '(A)') '2 - X wave input type'
+ WRITE (u, '(A)') '-10, 110, 2 - X wave grid point data'
+ WRITE (u, '(A)') '2 - Y wave input type'
+ WRITE (u, '(A)') '-10, 10, 2 - Y wave grid point data'
+ WRITE (u, '(A)') '2 - Z wave input type'
+ WRITE (u, '(A)') '-100, 0, 2 - Z wave grid point data'
+ WRITE (u, '(A)') '--------------------------- CURRENT -------------------------------------'
+ WRITE (u, '(A)') '1 CurrentMod - type of current input'
+ WRITE (u, '(A)') 'z-depth x-current y-current'
+ WRITE (u, '(A)') '(m) (m/s) (m/s)'
+ WRITE (u, '(A)') '0.0 0.0 0.15'
+ WRITE (u, '(A)') '-100.0 0.0 0.15'
+ WRITE (u, '(A)') '--------------------- need this line ------------------'
+ CLOSE (u)
+ END SUBROUTINE write_current
+
+ SUBROUTINE write_deck(path, wake_rows, tmax, cl, ei, viv_row, mixed, tow, frame_rows)
+ !! wake_rows: the WAKE OSCILLATOR section's data rows, ';'-separated ('' for no section); cl the
+ !! type's LINE TYPES Cl (default 0), ei its EI (default 1), viv_row a VIV section row, mixed:
+ !! the line in two sections, the second of a type 'lift' with Cl 0.8; tow: no current, both
+ !! ends Coupled and moved by the motion file wod_tow.txt; frame_rows: the VIV FRAME section's
+ !! data rows, ';'-separated (none without it).
+ CHARACTER(*), INTENT(IN) :: path, wake_rows
+ REAL(wp), INTENT(IN) :: tmax
+ CHARACTER(*), INTENT(IN), OPTIONAL :: cl, ei, viv_row
+ LOGICAL, INTENT(IN), OPTIONAL :: mixed, tow
+ CHARACTER(*), INTENT(IN), OPTIONAL :: frame_rows
+ CHARACTER(32) :: cl_col, ei_col
+ INTEGER :: u, i0, i1
+ LOGICAL :: two, towed
+ cl_col = '0.0'
+ IF (PRESENT(cl)) cl_col = cl
+ ei_col = '1.0'
+ IF (PRESENT(ei)) ei_col = ei
+ two = .FALSE.
+ IF (PRESENT(mixed)) two = mixed
+ towed = .FALSE.
+ IF (PRESENT(tow)) towed = tow
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'wake-oscillator deck gate: taut cable in a uniform current'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ 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 '//TRIM(ei_col)//' 1.2 1.0 0.0 0.0 '// &
+ TRIM(cl_col)//' 0.08 0.18'
+ WRITE (u, '(A)') 'lift 0.10 10.0 5.0e7 -0.8 '//TRIM(ei_col)//' 1.2 1.0 0.0 0.0 '// &
+ '0.8 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'
+ IF (towed) THEN
+ WRITE (u, '(A)') '2 Coupled 100.0 0.0 -50.0 0 0 0 0'
+ ELSE
+ WRITE (u, '(A)') '2 Fixed 100.0 0.0 -50.0 0 0 0 0'
+ END IF
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID NodeA NodeB Outputs'
+ WRITE (u, '(A)') '1 1 2 -'
+ WRITE (u, '(A)') '----------------------- SECTIONS --------------------------------------------'
+ WRITE (u, '(A)') 'LineID LineType Length NumSegs'
+ IF (two) THEN
+ WRITE (u, '(A)') '1 riser 49.950050 25'
+ WRITE (u, '(A)') '1 lift 49.950050 25'
+ ELSE
+ WRITE (u, '(A)') '1 riser 99.900100 50'
+ END IF
+ IF (PRESENT(viv_row)) THEN
+ WRITE (u, '(A)') '----------------------- VIV -------------------------------------------------'
+ WRITE (u, '(A)') 'TypeName ClX alpha'
+ WRITE (u, '(A)') viv_row
+ END IF
+ IF (LEN_TRIM(wake_rows) > 0) THEN
+ WRITE (u, '(A)') '----------------------- WAKE OSCILLATOR -------------------------------------'
+ WRITE (u, '(A)') 'TypeName CL0 St eps A'
+ i0 = 1
+ DO
+ i1 = INDEX(wake_rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(wake_rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') wake_rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END IF
+ IF (PRESENT(frame_rows)) THEN
+ WRITE (u, '(A)') '----------------------- VIV FRAME -------------------------------------------'
+ WRITE (u, '(A)') 'TypeName Tf'
+ WRITE (u, '(A)') '(-) (s)'
+ i0 = 1
+ DO
+ i1 = INDEX(frame_rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(frame_rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') frame_rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '0.01 dtM'
+ WRITE (u, '(A)') '100.0 WtrDpth'
+ WRITE (u, '(A)') '1025.0 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ IF (towed) THEN
+ WRITE (u, '(A)') 'wod_tow.txt motionFile'
+ ELSE
+ WRITE (u, '(A)') 'wod_current.dat WaterKin'
+ END IF
+ WRITE (u, '(A,F8.3,A)') ' ', tmax, ' TMax'
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ WRITE (u, '(A)') 'L1N25PZ'
+ WRITE (u, '(A)') 'VIVPow1'
+ WRITE (u, '(A)') 'DragPow1'
+ WRITE (u, '(A)') 'DampPow1'
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK .AND. conv
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, tab, n)
+ !! The rows (time, L1N25PZ, VIVPow1, DragPow1, DampPow1) of a deck's main output file.
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(1024) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(5, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ REAL(wp) FUNCTION peak_frequency(tt, x) RESULT(fpk)
+ !! The frequency of the largest Fourier amplitude of x - mean(x) on 0.05-2 Hz (0.001 Hz grid).
+ REAL(wp), INTENT(IN) :: tt(:), x(:)
+ REAL(wp) :: xm(SIZE(x)), f, best, re, im
+ INTEGER :: j
+ xm = x - SUM(x)/REAL(SIZE(x), wp)
+ best = -1.0_wp
+ fpk = 0.0_wp
+ DO j = 0, 1950
+ f = 0.05_wp + 0.001_wp*REAL(j, wp)
+ re = SUM(xm*COS(2.0_wp*PI*f*tt))
+ im = SUM(xm*SIN(2.0_wp*PI*f*tt))
+ IF (re*re + im*im > best) THEN
+ best = re*re + im*im
+ fpk = f
+ END IF
+ END DO
+ END FUNCTION peak_frequency
+
+ SUBROUTINE window_stats(tab, n, t0, t1, ad, f)
+ !! Half peak-to-peak mid-span amplitude over D and dominant frequency on [t0, t1].
+ REAL(wp), INTENT(IN) :: tab(:, :), t0, t1
+ INTEGER, INTENT(IN) :: n
+ REAL(wp), INTENT(OUT) :: ad, f
+ LOGICAL :: keep(n)
+ REAL(wp), ALLOCATABLE :: tt(:), z(:)
+ keep = tab(1, 1:n) >= t0 .AND. tab(1, 1:n) <= t1
+ tt = PACK(tab(1, 1:n), keep)
+ z = PACK(tab(2, 1:n), keep)
+ ad = 0.5_wp*(MAXVAL(z) - MINVAL(z))/D
+ f = peak_frequency(tt, z)
+ END SUBROUTINE window_stats
+
+ SUBROUTINE check_runs(ei, tag, res)
+ !! W1-W3 on the cable of EI ei ('1.0' finite-EI, '0.0' the EI = 0 line), the files named
+ !! after tag; res = (coupled A/D, f, uncoupled A/D, f) over the steady windows.
+ CHARACTER(*), INTENT(IN) :: ei, tag
+ REAL(wp), INTENT(OUT) :: res(4)
+ REAL(wp), ALLOCATABLE :: tw(:, :), t0(:, :), tn(:, :), tz(:, :)
+ INTEGER :: nw, n0, nn, nz
+ REAL(wp) :: ad_w, f_w, ad_w2, f_w2, ad_0, f_0, pv, pd, pb
+ LOGICAL :: ok, keep(20000)
+ CHARACTER(1024) :: msg
+ CHARACTER(:), ALLOCATABLE :: lab
+ res = 0.0_wp
+ lab = ' (EI '//ei//')'
+ CALL write_deck(tag//'_wake.dat', 'riser 0.3', 100.0_wp, ei=ei)
+ CALL run(tag//'_wake.dat', tag//'_wake', ok, msg)
+ CALL require(ok, 'W1: the wake-oscillator deck runs'//lab//': '//TRIM(msg))
+ CALL write_deck(tag//'_a0.dat', 'riser 0.3 0.2 0.3 0.0', 100.0_wp, ei=ei)
+ CALL run(tag//'_a0.dat', tag//'_a0', ok, msg)
+ CALL require(ok, 'W1: the uncoupled deck (A 0) runs'//lab//': '//TRIM(msg))
+ CALL read_out(tag//'_wake.out', tw, nw)
+ CALL read_out(tag//'_a0.out', t0, n0)
+ CALL require(nw > 1000 .AND. n0 == nw, 'W1: the runs wrote matching rows'//lab)
+ IF (.NOT. (nw > 1000 .AND. n0 == nw)) RETURN
+ CALL window_stats(tw, nw, 50.0_wp, 75.0_wp, ad_w, f_w)
+ CALL window_stats(tw, nw, 75.0_wp, 100.0_wp, ad_w2, f_w2)
+ CALL window_stats(t0, n0, 50.0_wp, 100.0_wp, ad_0, f_0)
+ res = [ad_w, f_w, ad_0, f_0]
+ WRITE (*, '(A,2F8.4,A,2F8.4,A,F7.4)') 'W1'//lab//': coupled A/D, f [Hz] (50-75 s, 75-100 s) ', ad_w, f_w, &
+ ', ', ad_w2, f_w2, '; wake frequency ', F_WAKE
+ WRITE (*, '(A,2F8.4)') 'W1'//lab//': uncoupled (A 0) A/D, f [Hz] ', ad_0, f_0
+ CALL require(f_w < F_WAKE - 0.01_wp .AND. ad_w > 0.4_wp .AND. ad_w < 0.8_wp, &
+ 'W1: the coupled response locks in below the wake frequency at A/D 0.4-0.8'//lab)
+ CALL require(ABS(ad_w2/ad_w - 1.0_wp) <= 0.01_wp .AND. ABS(f_w2 - f_w) <= 0.002_wp, 'W1: and is steady'//lab)
+ CALL require(ABS(f_0 - F_WAKE) <= 0.005_wp, 'W1: uncoupled, the wake drives the cable at its own frequency'//lab)
+ CALL require(ad_w >= 3.0_wp*ad_0, 'W1: lock-in at least triples the uncoupled amplitude'//lab)
+ ! W2: the power balance of the steady lock-in
+ keep(1:nw) = tw(1, 1:nw) >= 60.0_wp
+ pv = SUM(PACK(tw(3, 1:nw), keep(1:nw)))/COUNT(keep(1:nw))
+ pd = SUM(PACK(tw(4, 1:nw), keep(1:nw)))/COUNT(keep(1:nw))
+ pb = SUM(PACK(tw(5, 1:nw), keep(1:nw)))/COUNT(keep(1:nw))
+ WRITE (*, '(A,3ES12.4)') 'W2'//lab//': mean VIVPow, DragPow, DampPow [W] over 60-100 s: ', pv, pd, pb
+ CALL require(pv > 0.0_wp .AND. ABS(pv + pd + pb) <= 0.005_wp*pv, &
+ 'W2: the drag and damping take out the wake-lift power within 0.5 %'//lab)
+ ! W3: CL0 0 is no wake oscillator
+ CALL write_deck(tag//'_none.dat', '', 20.0_wp, ei=ei)
+ CALL run(tag//'_none.dat', tag//'_none', ok, msg)
+ CALL require(ok, 'W3: the deck without the section runs'//lab//': '//TRIM(msg))
+ CALL write_deck(tag//'_zero.dat', 'riser 0.0', 20.0_wp, ei=ei)
+ CALL run(tag//'_zero.dat', tag//'_zero', ok, msg)
+ CALL require(ok, 'W3: the CL0 0 deck runs'//lab//': '//TRIM(msg))
+ CALL read_out(tag//'_none.out', tn, nn)
+ CALL read_out(tag//'_zero.out', tz, nz)
+ CALL require(nn > 100 .AND. nz == nn, 'W3: the runs wrote matching rows'//lab)
+ IF (nn > 100 .AND. nz == nn) CALL require(ALL(tz(:, 1:nz) == tn(:, 1:nn)), &
+ 'W3: a row with CL0 0 is the deck without the section'//lab)
+ END SUBROUTINE check_runs
+
+ SUBROUTINE write_tow(path)
+ !! Both ends (points 1 and 2) moved along -y at 0.15 m/s after a 10 s half-cosine velocity ramp,
+ !! every 0.01 s to 100 s: y = -U (t/2 - T sin(pi t/T)/(2 pi)) in the ramp (T 10 s).
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), PARAMETER :: U = 0.15_wp, TR = 10.0_wp
+ INTEGER :: u_, k
+ REAL(wp) :: t, y, v, a
+ OPEN (NEWUNIT=u_, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u_, '(A)') '# time point x y z vx vy vz ax ay az'
+ DO k = 0, 10000
+ t = 0.01_wp*REAL(k, wp)
+ IF (t < TR) THEN
+ y = -U*(0.5_wp*t - TR*SIN(PI*t/TR)/(2.0_wp*PI))
+ v = -U*0.5_wp*(1.0_wp - COS(PI*t/TR))
+ a = -U*0.5_wp*(PI/TR)*SIN(PI*t/TR)
+ ELSE
+ y = -U*(0.5_wp*TR + (t - TR))
+ v = -U
+ a = 0.0_wp
+ END IF
+ WRITE (u_, '(F9.3,A,3ES17.9,A,ES17.9,A,ES17.9,A)') t, ' 1 ', 0.0_wp, y, -50.0_wp, ' 0 ', v, ' 0 0 ', a, ' 0'
+ WRITE (u_, '(F9.3,A,3ES17.9,A,ES17.9,A,ES17.9,A)') t, ' 2 ', 100.0_wp, y, -50.0_wp, ' 0 ', v, ' 0 0 ', a, ' 0'
+ END DO
+ CLOSE (u_)
+ END SUBROUTINE write_tow
+
+ SUBROUTINE check_tow(tag, ref)
+ !! W6 on the finite-EI cable: towed with Tf 10 s against the fixed cable in the current (ref,
+ !! from check_runs), and without Tf.
+ CHARACTER(*), INTENT(IN) :: tag
+ REAL(wp), INTENT(IN) :: ref(4)
+ CHARACTER(*), PARAMETER :: ei = '1.0'
+ REAL(wp), ALLOCATABLE :: tf(:, :), t0(:, :)
+ INTEGER :: nf, n0
+ REAL(wp) :: ad_f, f_f, ad_0, f_0
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CHARACTER(:), ALLOCATABLE :: lab
+ lab = ' (EI '//ei//')'
+ CALL write_deck(tag//'_tf.dat', 'riser 0.3', 100.0_wp, ei=ei, tow=.TRUE., frame_rows='riser 10')
+ CALL run(tag//'_tf.dat', tag//'_tf', ok, msg)
+ CALL require(ok, 'W6: the towed deck with Tf runs'//lab//': '//TRIM(msg))
+ CALL write_deck(tag//'_amb.dat', 'riser 0.3', 100.0_wp, ei=ei, tow=.TRUE.)
+ CALL run(tag//'_amb.dat', tag//'_amb', ok, msg)
+ CALL require(ok, 'W6: the towed deck without Tf runs'//lab//': '//TRIM(msg))
+ CALL read_out(tag//'_tf.out', tf, nf)
+ CALL read_out(tag//'_amb.out', t0, n0)
+ CALL require(nf > 1000 .AND. n0 == nf, 'W6: the towed runs wrote matching rows'//lab)
+ IF (.NOT. (nf > 1000 .AND. n0 == nf)) RETURN
+ CALL window_stats(tf, nf, 50.0_wp, 75.0_wp, ad_f, f_f)
+ CALL window_stats(t0, n0, 50.0_wp, 75.0_wp, ad_0, f_0)
+ WRITE (*, '(A,2F8.4,A,2F8.4,A,F8.4)') 'W6'//lab//': towed A/D, f [Hz] with Tf ', ad_f, f_f, &
+ '; in the current ', ref(1:2), '; towed without Tf A/D ', ad_0
+ CALL require(ABS(ad_f/ref(1) - 1.0_wp) <= 0.05_wp .AND. ABS(f_f - ref(2)) <= 0.003_wp, &
+ 'W6: towed with Tf, the cable locks in as the fixed cable in the current'//lab)
+ CALL require(ad_0 < 0.1_wp*ref(1), 'W6: towed without Tf (the ambient flow), the wake does not lock in'//lab)
+ END SUBROUTINE check_tow
+
+ SUBROUTINE check_filter_fixed(ei, tag, ref, res)
+ !! W6 on the fixed cable of EI ei in the current: with Tf 10 s against without it (ref, from
+ !! check_runs); res = (A/D, f) with Tf.
+ CHARACTER(*), INTENT(IN) :: ei, tag
+ REAL(wp), INTENT(IN) :: ref(4)
+ REAL(wp), INTENT(OUT) :: res(2)
+ REAL(wp), ALLOCATABLE :: tf(:, :)
+ INTEGER :: nf
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CHARACTER(:), ALLOCATABLE :: lab
+ lab = ' (EI '//ei//')'
+ res = 0.0_wp
+ CALL write_deck(tag//'.dat', 'riser 0.3', 100.0_wp, ei=ei, frame_rows='riser 10')
+ CALL run(tag//'.dat', tag, ok, msg)
+ CALL require(ok, 'W6: the fixed cable with Tf runs'//lab//': '//TRIM(msg))
+ CALL read_out(tag//'.out', tf, nf)
+ CALL require(nf > 1000, 'W6: the fixed run with Tf wrote its rows'//lab)
+ IF (nf <= 1000) RETURN
+ CALL window_stats(tf, nf, 50.0_wp, 75.0_wp, res(1), res(2))
+ WRITE (*, '(A,2F8.4,A,2F8.4)') 'W6'//lab//': fixed in the current A/D, f [Hz] with Tf ', res, '; without ', &
+ ref(1:2)
+ CALL require(ABS(res(1)/ref(1) - 1.0_wp) <= 0.02_wp .AND. ABS(res(2) - ref(2)) <= 0.002_wp, &
+ 'W6: fixed in the current, Tf leaves the lock-in as the ambient flow gives it'//lab)
+ 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 [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')
+ CALL refused('riser 0.3', 'filter time Tf must be >= 0', 'W7: a negative Tf', frame_rows='riser -1')
+ CALL refused('', 'give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row', 'W7: a type without VIV', &
+ frame_rows='riser 10')
+ CALL refused('riser 0.3 x', 'plain numbers', 'a non-numeric St')
+ CALL refused('cable 0.3', 'undefined LINE TYPE', 'an unknown type')
+ CALL refused('riser 0.3;riser 0.2', 'twice', 'a repeated type')
+ CALL refused('riser -0.1', 'CL0 must be non-negative', 'a negative CL0')
+ CALL refused('riser 0.3 0.0', 'St > 0, eps > 0 and A >= 0', 'St = 0')
+ CALL refused('riser 0.3 0.2 0.0', 'St > 0, eps > 0 and A >= 0', 'eps = 0')
+ CALL refused('riser 0.3 0.2 0.3 -1', 'St > 0, eps > 0 and A >= 0', 'a negative A')
+ CALL refused('riser 0.3', 'give the type LINE TYPES Cl 0', 'a type that keeps its lift', cl='0.8')
+ CALL refused('riser 0.3', 'a line takes one VIV model', 'a line mixing the two models', mixed=.TRUE.)
+ CALL refused('riser 0.3', 'a line takes one VIV model', 'an EI = 0 line mixing the two models', ei='0.0', &
+ mixed=.TRUE.)
+ CALL refused('riser 0.3', 'give the type LINE TYPES Cl 0', 'an EI = 0 type that keeps its lift', cl='0.8', &
+ ei='0.0')
+ END SUBROUTINE check_refusals
+
+ SUBROUTINE refused(rows, needle, what, cl, ei, viv_row, mixed, frame_rows)
+ CHARACTER(*), INTENT(IN) :: rows, needle, what
+ CHARACTER(*), INTENT(IN), OPTIONAL :: cl, ei, viv_row, frame_rows
+ LOGICAL, INTENT(IN), OPTIONAL :: mixed
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ ! an absent optional passes on absent
+ CALL write_deck('wod_bad.dat', rows, 1.0_wp, cl=cl, ei=ei, viv_row=viv_row, mixed=mixed, frame_rows=frame_rows)
+ CALL run('wod_bad.dat', 'wod_bad', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, needle) > 0, 'W4: '//what//' is refused: '//TRIM(msg))
+ END SUBROUTINE refused
+
+END PROGRAM test_viv_wake_deck
diff --git a/tests/test_viv_wake_kernel.f90 b/tests/test_viv_wake_kernel.f90
new file mode 100644
index 00000000..418c42ef
--- /dev/null
+++ b/tests/test_viv_wake_kernel.f90
@@ -0,0 +1,174 @@
+! File: tests/test_viv_wake_kernel.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_viv_wake_kernel
+ !! The wake-oscillator kernel CD_VIV_Wake_Advance (Facchinetti, de Langre and Biolley, J. Fluids
+ !! Struct. 19, 2004, 123-140) against its published properties, with eps 0.3 and A 12:
+ !! K1 the free oscillator (no forcing) from q = 0.1 settles on the limit cycle q = 2 cos(om t):
+ !! amplitude 2 and period 2 pi/om within 1 %;
+ !! K2 forced at its own frequency by a structure moving as y0 D cos(om t), the lift
+ !! magnification K, half the first-harmonic amplitude of q, follows the closed form of their
+ !! Eq. 17, a one-harmonic balance, for y0 = 0.05-0.5;
+ !! K3 one call over an interval equals the same interval in two calls with the forcing split
+ !! at its midpoint, and refining the sub-steps converges at fourth order;
+ !! K4 a large eps (20, om 1) from (2, 0), whose damping rate eps om (q^2 - 1) is sixty times the
+ !! oscillation, stays finite in 0.1 s calls and matches 0.001 s calls within 1e-6 at t = 1.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_VIV, ONLY: CD_VIV_Wake_Advance, CD_VIV_WAKE_DEFAULT_EPS, CD_VIV_WAKE_DEFAULT_A
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp
+ REAL(wp), PARAMETER :: EPS = CD_VIV_WAKE_DEFAULT_EPS, A = CD_VIV_WAKE_DEFAULT_A
+ REAL(wp), PARAMETER :: D = 0.1_wp, OM = 2.0_wp*PI ! 1 Hz wake frequency
+ INTEGER :: nfail = 0
+
+ CALL check_free()
+ CALL check_forced()
+ CALL check_steps()
+ CALL check_stiff()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: wake-oscillator kernel'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE check_free()
+ REAL(wp) :: s(2), dt, qmax, t, t_up(2), q_old
+ INTEGER :: i, n_up
+ s = [0.1_wp, 0.0_wp]
+ dt = 0.01_wp
+ qmax = 0.0_wp
+ n_up = 0
+ t_up = 0.0_wp
+ DO i = 1, 8000 ! 80 periods
+ q_old = s(1)
+ CALL CD_VIV_Wake_Advance(s, OM, EPS, A/D, 0.0_wp, 0.0_wp, dt)
+ t = REAL(i, wp)*dt
+ IF (t < 70.0_wp) CYCLE
+ qmax = MAX(qmax, ABS(s(1)))
+ ! upward zero crossings, interpolated
+ IF (q_old < 0.0_wp .AND. s(1) >= 0.0_wp .AND. n_up < 2) THEN
+ n_up = n_up + 1
+ t_up(n_up) = t - dt*s(1)/(s(1) - q_old)
+ END IF
+ END DO
+ WRITE (*, '(A,F9.5,A,F9.5,A)') 'K1: limit-cycle amplitude ', qmax, ', period ', t_up(2) - t_up(1), ' s'
+ CALL require(ABS(qmax/2.0_wp - 1.0_wp) <= 0.01_wp, 'K1: the free limit cycle has the amplitude 2')
+ CALL require(n_up == 2 .AND. ABS(t_up(2) - t_up(1) - 1.0_wp) <= 0.01_wp, 'K1: and the wake period')
+ END SUBROUTINE check_free
+
+ REAL(wp) FUNCTION eq17(y0) RESULT(k)
+ !! Facchinetti et al. (2004), Eq. 17: K = (X/36)^(1/3) + (4/(3X))^(1/3),
+ !! X = 9 (A/eps) y0 + sqrt((9 (A/eps) y0)^2 - 48).
+ REAL(wp), INTENT(IN) :: y0
+ REAL(wp) :: x, b
+ b = 9.0_wp*(A/EPS)*y0
+ x = b + SQRT(b*b - 48.0_wp)
+ k = (x/36.0_wp)**(1.0_wp/3.0_wp) + (4.0_wp/(3.0_wp*x))**(1.0_wp/3.0_wp)
+ END FUNCTION eq17
+
+ SUBROUTINE check_forced()
+ !! Eq. 17 keeps the first harmonic only; the cubic damping term also makes a third harmonic,
+ !! so the computed K exceeds it by a share that grows with the forcing (about 2 % at
+ !! y0 = 0.5). The step is converged: halving it changes K by under 1e-4 of itself.
+ REAL(wp), PARAMETER :: Y0S(5) = [0.05_wp, 0.1_wp, 0.2_wp, 0.3_wp, 0.5_wp]
+ REAL(wp) :: k_num, k_ref, worst, k_half
+ INTEGER :: j
+ worst = 0.0_wp
+ DO j = 1, SIZE(Y0S)
+ k_num = forced_k(Y0S(j), 0.005_wp)
+ k_ref = eq17(Y0S(j))
+ worst = MAX(worst, ABS(k_num/k_ref - 1.0_wp))
+ WRITE (*, '(A,F5.2,A,F8.4,A,F8.4)') 'K2: y0 ', Y0S(j), ': K ', k_num, ', Eq. 17 ', k_ref
+ END DO
+ k_half = forced_k(0.5_wp, 0.0025_wp)
+ WRITE (*, '(A,ES10.3)') 'K2: change of K at y0 0.5 with half the step: ', ABS(k_half - k_num)
+ CALL require(worst <= 0.02_wp, 'K2: the forced lift magnification follows Eq. 17 within 2 %')
+ CALL require(ABS(k_half - k_num) <= 1.0e-4_wp*k_num, 'K2: with a converged step')
+ END SUBROUTINE check_forced
+
+ REAL(wp) FUNCTION forced_k(y0, dt) RESULT(k)
+ !! Half the first-harmonic amplitude of q over periods 91-100 of the forcing y0 D cos(om t).
+ REAL(wp), INTENT(IN) :: y0, dt
+ REAL(wp) :: s(2), t, c, sn
+ INTEGER :: i, n, n_keep
+ n = NINT(100.0_wp/dt)
+ n_keep = NINT(10.0_wp/dt)
+ s = [2.0_wp, 0.0_wp]
+ c = 0.0_wp
+ sn = 0.0_wp
+ DO i = 1, n
+ t = REAL(i - 1, wp)*dt
+ CALL CD_VIV_Wake_Advance(s, OM, EPS, A/D, -OM*OM*y0*D*COS(OM*t), -OM*OM*y0*D*COS(OM*(t + dt)), dt)
+ IF (i > n - n_keep) THEN
+ c = c + s(1)*COS(OM*(t + dt))
+ sn = sn + s(1)*SIN(OM*(t + dt))
+ END IF
+ END DO
+ k = 0.5_wp*(2.0_wp/REAL(n_keep, wp))*SQRT(c*c + sn*sn)
+ END FUNCTION forced_k
+
+ SUBROUTINE check_steps()
+ REAL(wp) :: s1(2), s2(2), sc(2), sf(2), h, e1, e2
+ h = 0.4_wp
+ s1 = [1.3_wp, -4.0_wp]
+ s2 = s1
+ CALL CD_VIV_Wake_Advance(s1, OM, EPS, A/D, 0.2_wp, -0.6_wp, h)
+ CALL CD_VIV_Wake_Advance(s2, OM, EPS, A/D, 0.2_wp, -0.2_wp, 0.5_wp*h)
+ CALL CD_VIV_Wake_Advance(s2, OM, EPS, A/D, -0.2_wp, -0.6_wp, 0.5_wp*h)
+ WRITE (*, '(A,ES10.3)') 'K3: one call against two halves: ', MAXVAL(ABS(s1 - s2))
+ CALL require(MAXVAL(ABS(s1 - s2)) <= 1.0e-12_wp*MAXVAL(ABS(s1)), 'K3: an interval in two calls is one call')
+ ! fourth order: calls short enough for one sub-step each (om h/N <= 0.1) set the step; 32 and
+ ! 64 of them against 1024
+ sf = march(1024, h)
+ e1 = MAXVAL(ABS(march(32, h) - sf))
+ e2 = MAXVAL(ABS(march(64, h) - sf))
+ WRITE (*, '(A,2ES11.3,A,F7.2)') 'K3: errors with 32 and 64 steps ', e1, e2, ', ratio ', e1/e2
+ CALL require(e1 < 1.0e-5_wp*MAXVAL(ABS(sf)), 'K3: the advance is accurate at om dt = 0.08')
+ CALL require(e1/e2 > 12.0_wp, 'K3: and converges at fourth order (ratio near 16)')
+ ! the kernel's own sub-steps in one call match the reference as closely
+ sc = [1.3_wp, -4.0_wp]
+ CALL CD_VIV_Wake_Advance(sc, OM, EPS, A/D, 0.2_wp, -0.6_wp, h)
+ CALL require(MAXVAL(ABS(sc - sf)) < 1.0e-5_wp*MAXVAL(ABS(sf)), 'K3: one call sub-steps as finely')
+ END SUBROUTINE check_steps
+
+ FUNCTION march(n, h) RESULT(x)
+ !! The K3 interval in n equal calls, the forcing linear from 0.2 to -0.6 over it.
+ INTEGER, INTENT(IN) :: n
+ REAL(wp), INTENT(IN) :: h
+ REAL(wp) :: x(2)
+ INTEGER :: k
+ x = [1.3_wp, -4.0_wp]
+ DO k = 1, n
+ CALL CD_VIV_Wake_Advance(x, OM, EPS, A/D, 0.2_wp - 0.8_wp*REAL(k - 1, wp)/REAL(n, wp), &
+ 0.2_wp - 0.8_wp*REAL(k, wp)/REAL(n, wp), h/REAL(n, wp))
+ END DO
+ END FUNCTION march
+
+ SUBROUTINE check_stiff()
+ !! The sub-steps follow the damping rate as well as the oscillation (eps 20, om 1).
+ REAL(wp) :: sc(2), sf(2)
+ INTEGER :: k
+ sc = [2.0_wp, 0.0_wp]
+ sf = sc
+ DO k = 1, 10
+ CALL CD_VIV_Wake_Advance(sc, 1.0_wp, 20.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.1_wp)
+ END DO
+ DO k = 1, 1000
+ CALL CD_VIV_Wake_Advance(sf, 1.0_wp, 20.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.001_wp)
+ END DO
+ WRITE (*, '(A,2ES12.4,A,ES10.3)') 'K4: eps 20 at t = 1 s: ', sc, ', against 1 ms calls ', MAXVAL(ABS(sc - sf))
+ CALL require(ALL(ABS(sc) < 10.0_wp) .AND. MAXVAL(ABS(sc - sf)) <= 1.0e-6_wp, 'K4: a large eps stays '// &
+ 'resolved in long calls')
+ END SUBROUTINE check_stiff
+
+END PROGRAM test_viv_wake_kernel
diff --git a/validation/README.md b/validation/README.md
index 95d2c185..410d55c8 100644
--- a/validation/README.md
+++ b/validation/README.md
@@ -16,7 +16,7 @@ redistributed.
| [`RELEASE_0_1_1.md`](RELEASE_0_1_1.md) | The same for v0.1.1 |
| [`RELEASE_0_1_0.md`](RELEASE_0_1_0.md) | The same for v0.1.0 |
| [`bodies/`](bodies/README.md) | Rigid-body, rod and shared-anchor cases with MoorDyn-C twins, stored references and pass limits |
-| [`experiments/`](experiments/README.md) | Holcombe et al. (2025) static lazy-wave and Bergdahl et al. (2016) dynamic-chain comparisons |
+| [`experiments/`](experiments/README.md) | Holcombe et al. (2025) static lazy-wave, Bergdahl et al. (2016) dynamic-chain, Chaplin et al. (2005) riser natural-frequency and stepped-current VIV, Wang et al. (2014) catenary-riser VIV in current and heave, Trim et al. (2005) NDP high-mode riser VIV, de Wilde et al. (2021) FLOTANT power-cable VIV, Fu et al. (2014) oscillatory-flow cylinder VIV and Chaplin & King (2018) untensioned catenary-riser VIV comparisons |
| [`PERFORMANCE_0_1_0.md`](PERFORMANCE_0_1_0.md) | Wall time of CableDyn 0.1.0, MoorDyn-C and MoorDyn-F at equal accuracy on five mooring, cable, buoy and coupled cases |
| [`performance/`](performance/README.md) | Same-host wall-clock records of the L5 cases: the resolved lazy-wave spans, the one-hour VolturnUS-S mooring and the tension-only chain |
| [`PAPER_REPRODUCTION.md`](PAPER_REPRODUCTION.md) | Every CableDyn result in the journal article, re-run with the release defaults and in paper mode |
diff --git a/validation/experiments/README.md b/validation/experiments/README.md
index 35b65de4..8d718652 100644
--- a/validation/experiments/README.md
+++ b/validation/experiments/README.md
@@ -2,7 +2,7 @@
# Experimental comparisons
-This directory lets reviewers reproduce CableDyn's comparisons with two published physical
+This directory lets reviewers reproduce CableDyn's comparisons with eight published physical
experiments. Each subdirectory gives the data source, the translation of the published
parameters into a CableDyn model, the assessed quantity, the reproduction commands and the
committed results.
@@ -11,5 +11,12 @@ committed results.
| --- | --- | --- |
| [`holcombe/`](holcombe/README.md) | Holcombe et al. (2025), 1:70 static lazy-wave cable | Finite-EI power cable |
| [`bergdahl/`](bergdahl/README.md) | Bergdahl et al. (2016), 33 m dynamically scaled chain | Tension-only mooring chain |
+| [`chaplin/`](chaplin/README.md) | Chaplin et al. (2005), 13.12 m vertical tension riser, still-water natural frequencies | Finite-EI riser, modal analysis |
+| [`delta_flume/`](delta_flume/README.md) | Chaplin et al. (2005), 13.12 m vertical tension riser, stepped current, blind-trial cases 1–9 | Finite-EI riser, synchronisation VIV, cross-flow and in-line |
+| [`wang_scr/`](wang_scr/README.md) | Wang et al. (2014), truncated steel catenary riser in uniform current and under heave motion of its upper end, cross-flow VIV | Finite-EI riser, synchronisation VIV |
+| [`ndp_riser/`](ndp_riser/README.md) | Trim et al. (2005), NDP 38 m high-mode riser in uniform flow, cross-flow VIV with a generic and three published coefficient sets | Finite-EI riser, synchronisation VIV |
+| [`flotant/`](flotant/README.md) | de Wilde et al. (2021), FLOTANT OD 48 mm power-cable specimen with a clump weight, tow tests and forced-oscillation RAOs, cross-flow and in-line VIV with three published coefficient sets | Finite-EI cable, synchronisation and wake-oscillator VIV |
+| [`fu_oscillatory/`](fu_oscillatory/README.md) | Fu et al. (2014), SJTU 4 m flexible cylinder moved harmonically through still water, cross-flow VIV on the acceleration and deceleration paths with three published coefficient sets | Finite-EI cylinder, synchronisation and wake-oscillator VIV, `VIV FRAME` |
+| [`chaplin_catenary/`](chaplin_catenary/README.md) | Chaplin & King (2018), 5.36 m untensioned catenary riser with high curvature and floor touchdown in current of both directions, two mass ratios: mean top tension, cross-flow frequency, inclination, with three published coefficient sets | Finite-EI riser with floor contact, synchronisation and wake-oscillator VIV |
-The results are summarised as cases L3-H and L3-B in [`VALIDATION.md`](../../VALIDATION.md).
+The results are summarised as cases L3-H, L3-B, L3-C, L3-D, L3-W, L3-Wh, L3-N, L3-F and L3-K in [`VALIDATION.md`](../../VALIDATION.md).
diff --git a/validation/experiments/bergdahl/README.md b/validation/experiments/bergdahl/README.md
index 485f610e..c597323a 100644
--- a/validation/experiments/bergdahl/README.md
+++ b/validation/experiments/bergdahl/README.md
@@ -76,8 +76,8 @@ mean absolute percentage error of 3.11%, a mean bias of +0.47 N, a Pearson corre
conditions, halving the nominal element length and the time step changes the mean cycle maximum
by no more than 0.29% and 0.27%, respectively. The phase-averaged force histories had RMSEs
of 5.93% and 2.56% of the measured force range with 0.3.0; that comparison was not rerun for
-0.4.0, 0.4.1 or 0.4.2 (its waveform files and metrics are the 0.3.0 run's, `provenance.json`). The
-0.4.1 and 0.4.2 reruns reproduce the 0.4.0 force maxima, metrics and refinement summaries byte for byte. The line's upper
+0.4.0, 0.4.1, 0.4.2 or 0.4.3 (its waveform files and metrics are the 0.3.0 run's, `provenance.json`). The
+0.4.1, 0.4.2 and 0.4.3 reruns reproduce the 0.4.0 force maxima, metrics and refinement summaries byte for byte. The line's upper
end lies 0.3 m above the still-water level, so 0.4.0's dry weight of the part above the surface
changed the results: the RMSE from 1.583 N to 1.577 N and the mean absolute percentage
error from 3.13% to 3.11%. The waveform CSVs carry the measured phase averages computed from the
diff --git a/validation/experiments/bergdahl/provenance.json b/validation/experiments/bergdahl/provenance.json
index 457f959b..c70a0eaa 100644
--- a/validation/experiments/bergdahl/provenance.json
+++ b/validation/experiments/bergdahl/provenance.json
@@ -1,8 +1,8 @@
{
- "CableDyn_release": "v0.4.2",
- "validation_date": "2026-11-09",
+ "CableDyn_release": "v0.4.3",
+ "validation_date": "2026-11-20",
"executable_name": "cabledyn.exe",
- "executable_sha256": "0ab8649f0d5532450ff5f99e8277e498ff8f8f24556ef98f46bf2d52fb5417e0",
+ "executable_sha256": "84a1f1ff4fda48cca59afcf7313b023425e45d7229a1e7db5199310e52fb14de",
"compiler": "GNU Fortran 16.2.0",
"build_type": "Release",
"platform": "Windows 11 x86-64",
@@ -22,5 +22,5 @@
"waveform_metrics_sha256": "0fb6015cb30aa2bbb1cd8951b603f9201af50372ee6d3633a72fc70ea5280d1a",
"refinement_summary_sha256": "75342ed4f3ebe2d7acb19af56394e24e6ce909bb3df7445bf3a1d884280f9eb6",
"waveform_comparison_release": "v0.3.0",
- "waveform_comparison_note": "not rerun with 0.4.0, 0.4.1 or 0.4.2: the supplement expData.dat was not available when the record was rerun; the waveform files and metrics are those of the v0.3.0 run"
+ "waveform_comparison_note": "not rerun with 0.4.0, 0.4.1, 0.4.2 or 0.4.3: the supplement expData.dat was not available when the record was rerun; the waveform files and metrics are those of the v0.3.0 run"
}
diff --git a/validation/experiments/chaplin/README.md b/validation/experiments/chaplin/README.md
new file mode 100644
index 00000000..20052e91
--- /dev/null
+++ b/validation/experiments/chaplin/README.md
@@ -0,0 +1,58 @@
+
+
+# Delta Flume vertical riser: still-water natural frequencies
+
+This directory compares CableDyn's modal analysis with the still-water natural frequencies of the
+13.12 m vertical tension riser that Chaplin et al. (2005) tested in the Delta Flume,
+. The riser is the subject of the paper's
+stepped-current VIV measurements. Its frequencies at five top tensions (Table 2) check the riser
+model, the mass, added mass and tension along the line, which a VIV comparison then builds on. No
+model parameter is fitted to the measurements.
+
+## Model and data
+
+- From Section 2 of the paper: length 13.12 m, diameter 28 mm, bending stiffness 29.9 N m², mass
+ ratio 3.0 with the internal water (so 1.847 kg/m in fresh water, whose submerged weight
+ 12.08 N/m matches the paper's 12.1 N/m), universal joints at both ends (pinned in bending). The
+ riser was submerged over its whole length, the upper part in the water-filled tank.
+- `natural_frequencies.csv` holds the top tensions and the first seven measured frequencies of
+ Table 2, typed from the article, next to CableDyn's.
+- Assumed: fresh water (1000 kg/m³), the normal added-mass coefficient 1, and an axial stiffness
+ of 5.5e6 N, which the paper does not give. The unstretched length of each series gives its
+ Table 2 top tension, with the tension falling by the submerged weight down the riser.
+- CableDyn: a finite-EI line between two stationary points, 64 elements, `nModes` about the
+ static state (TMax 0). The two transverse planes of the straight riser give each frequency
+ twice; the script checks that they agree and keeps one.
+
+## Reproduce
+
+From the repository root, with `path/to/cabledyn.exe` the release executable or a local build:
+
+```powershell
+python validation/experiments/chaplin/chaplin_natural_frequencies.py `
+ path/to/cabledyn.exe validation/experiments/chaplin/work `
+ --summary validation/experiments/chaplin
+```
+
+`--segments`, `--ca` and `--ea` change the mesh, the added-mass coefficient and the axial
+stiffness.
+
+## Results
+
+| Statistic (34 frequencies, series C mode 2 left out) | Value |
+| --- | ---: |
+| Mean error | +1.87 % |
+| Mean absolute error | 2.28 % |
+| Largest absolute error | 4.88 % (series A, mode 1) |
+
+- CableDyn is 2–3 % high in most modes. The difference corresponds to a slightly larger added
+ mass: with `--ca 1.1` the mean error is +0.62 % and with `--ca 1.2` it is −0.59 %. The default
+ keeps the potential-flow value 1.
+- Series C mode 2 is measured at 1.423 Hz, where CableDyn gives 1.619 Hz (+13.8 %). Its ratio
+ to the first mode, 1.82, departs from the near-harmonic ratios of the other four series
+ (1.97–2.16), while the neighbouring C modes agree with CableDyn within 3.3 %. It is reported
+ in the CSV and counted in the all-35 statistic (mean absolute error 2.61 %).
+- 128 elements change no frequency by more than 3e-6, and ten times the axial stiffness by more
+ than 1.2e-4 (relative).
+
+`natural_frequencies_summary.json` records the statistics and the SHA-256 of the executable.
diff --git a/validation/experiments/chaplin/chaplin_natural_frequencies.py b/validation/experiments/chaplin/chaplin_natural_frequencies.py
new file mode 100644
index 00000000..1304848c
--- /dev/null
+++ b/validation/experiments/chaplin/chaplin_natural_frequencies.py
@@ -0,0 +1,231 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+"""Still-water natural frequencies of the Delta Flume riser of Chaplin et al. (2005).
+
+Writes a CableDyn deck for each of the five test series (Table 2 top tensions), runs the modal
+analysis about the static state, and compares the first seven frequencies with Table 2.
+
+ python chaplin_natural_frequencies.py path/to/cabledyn.exe WORKDIR [--segments 64]
+ [--ca 1.0] [--ea 5.5e6] [--summary DIR]
+
+Source: J.R. Chaplin, P.W. Bearman, F.J. Huera Huarte, R.J. Pattenden (2005), Laboratory
+measurements of vortex-induced vibrations of a vertical tension riser in a stepped current,
+Journal of Fluids and Structures 21(1), 3-24, https://doi.org/10.1016/j.jfluidstructs.2005.04.010
+"""
+
+from __future__ import annotations
+
+import argparse
+import csv
+import hashlib
+import json
+import math
+import os
+import subprocess
+from pathlib import Path
+
+# Section 2 of the paper: length, diameter, bending stiffness, mass ratio including the internal
+# water, submerged weight (12.1 N/m, reproduced by the mass ratio below), universal joints at
+# both ends. The tank was filled with water, so the whole riser is submerged.
+LENGTH = 13.12 # m
+DIAMETER = 0.028 # m
+EI = 29.9 # N m^2
+MASS_RATIO = 3.0 # mass / displaced mass, internal water included
+RHO_W = 1000.0 # kg/m^3, fresh water (assumed)
+GRAVITY = 9.80665 # m/s^2
+AREA = math.pi * DIAMETER**2 / 4.0
+MASS = MASS_RATIO * RHO_W * AREA # kg/m
+SUBMERGED_WEIGHT = (MASS - RHO_W * AREA) * GRAVITY # N/m
+Z_BOTTOM = -14.0 # m; any depth that keeps the riser submerged
+WATER_DEPTH = 20.0 # m
+
+# Table 2: still-water top tension [N] and the first seven natural frequencies [Hz] of each series
+TABLE2: dict[str, tuple[float, tuple[float, ...]]] = {
+ "A": (389.0, (0.405, 0.873, 1.326, 1.804, 2.278, 2.797, 3.389)),
+ "B": (813.0, (0.633, 1.329, 1.954, 2.625, 3.312, 4.028, 4.753)),
+ "C": (1185.0, (0.782, 1.423, 2.394, 3.203, 4.024, 4.875, 5.704)),
+ "D": (1546.0, (0.899, 1.815, 2.741, 3.614, 4.561, 5.525, 6.439)),
+ "E": (1925.0, (1.037, 2.046, 3.084, 4.099, 5.127, 6.222, 7.298)),
+}
+N_MODES = 7
+
+
+def unstretched_length(top_tension: float, ea: float) -> float:
+ """Unstretched length that gives ``top_tension`` on the vertical riser of length LENGTH.
+
+ The effective tension falls linearly with the submerged weight from the top joint down,
+ and an element ds of the stretched riser has the unstretched length ds / (1 + T/EA).
+ """
+ t_bottom = top_tension - SUBMERGED_WEIGHT * LENGTH
+ # exact integral of ds / (1 + T(s)/EA) with T linear in s
+ return ea / SUBMERGED_WEIGHT * math.log((ea + top_tension) / (ea + t_bottom))
+
+
+def deck_text(
+ series: str, top_tension: float, segments: int, ca: float, ea: float
+) -> str:
+ l0 = unstretched_length(top_tension, ea)
+ return f"""--------------------- CableDyn Input File ---------------------------------
+Delta Flume riser of Chaplin et al. (2005), series {series}: still-water top tension {top_tension:g} N
+----------------------- LINE TYPES ------------------------------------------
+TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t
+(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-)
+riser {DIAMETER} {MASS:.6f} {ea:.6e} 0.0 {EI} 1.2 0.0 {ca} 0.0
+----------------------- POINTS ----------------------------------------------
+ID Attachment X Y Z M V CdA CA
+(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
+1 Coupled 0.0 0.0 {Z_BOTTOM + LENGTH:.6f} 0 0 0 0
+2 Fixed 0.0 0.0 {Z_BOTTOM:.6f} 0 0 0 0
+----------------------- LINES -----------------------------------------------
+ID LineType AttachA AttachB UnstrLen NumSegs Outputs
+(-) (-) (-) (-) (m) (-) (-)
+1 riser 1 2 {l0:.9f} {segments} -
+---------------------- OPTIONS ----------------------------------------------
+{RHO_W} rhoW
+{GRAVITY} g
+{WATER_DEPTH} WtrDpth
+{2 * (N_MODES + 1)} nModes
+0.01 dtM
+0.0 TMax
+---------------------- OUTPUTS -----------------------------------------------
+FairTen1
+AnchTen1
+END
+------------------------- need this line --------------------------------------
+"""
+
+
+def frequencies(path: Path) -> list[float]:
+ """The distinct frequencies of a straight line's .modes.out (each in both planes)."""
+ lines = path.read_text(encoding="utf-8").splitlines()
+ start = lines.index("# Natural frequencies") + 3
+ values = []
+ for line in lines[start:]:
+ if not line.strip() or line.startswith("#"):
+ break
+ values.append(float(line.split()[2]))
+ pairs = values[0::2]
+ for a, b in zip(values[0::2], values[1::2]):
+ if not math.isclose(a, b, rel_tol=1e-6):
+ raise SystemExit(f"{path.name}: the two planes differ ({a} and {b} Hz)")
+ return pairs
+
+
+def top_tension(path: Path) -> float:
+ rows = [line.split() for line in path.read_text(encoding="utf-8").splitlines()[2:]]
+ return float(rows[0][1])
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
+ parser.add_argument("executable", type=Path)
+ parser.add_argument("workdir", type=Path)
+ parser.add_argument("--segments", type=int, default=64)
+ parser.add_argument(
+ "--ca", type=float, default=1.0, help="normal added-mass coefficient"
+ )
+ parser.add_argument(
+ "--ea", type=float, default=5.5e6, help="axial stiffness [N] (not given)"
+ )
+ parser.add_argument(
+ "--summary", type=Path, help="write the committed summary files here"
+ )
+ args = parser.parse_args()
+
+ work = args.workdir.resolve()
+ work.mkdir(parents=True, exist_ok=True)
+ env = os.environ.copy()
+ env.setdefault("OMP_NUM_THREADS", "1")
+ rows = []
+ for series, (tension, measured) in TABLE2.items():
+ stem = f"chaplin_{series}"
+ (work / f"{stem}.dat").write_text(
+ deck_text(series, tension, args.segments, args.ca, args.ea),
+ encoding="utf-8",
+ )
+ run = subprocess.run(
+ [str(args.executable.resolve()), f"{stem}.dat", stem],
+ cwd=work,
+ env=env,
+ capture_output=True,
+ text=True,
+ encoding="utf-8",
+ errors="replace",
+ check=False,
+ )
+ (work / f"{stem}.console.txt").write_text(
+ run.stdout + run.stderr, encoding="utf-8"
+ )
+ if run.returncode != 0:
+ raise SystemExit(f"{stem}: CableDyn exited with {run.returncode}")
+ computed = frequencies(work / f"{stem}.modes.out")[:N_MODES]
+ t_top = top_tension(work / f"{stem}.out")
+ for mode, (f_c, f_m) in enumerate(zip(computed, measured), start=1):
+ rows.append(
+ {
+ "series": series,
+ "top_tension_N": tension,
+ "computed_top_tension_N": round(t_top, 3),
+ "mode": mode,
+ "measured_Hz": f_m,
+ "cabledyn_Hz": round(f_c, 5),
+ "error_percent": round(100.0 * (f_c / f_m - 1.0), 2),
+ }
+ )
+
+ errors = [abs(float(r["error_percent"])) for r in rows]
+ # Series C mode 2 (Table 2: 1.423 Hz) breaks the near-harmonic pattern of every other series
+ # (f2/f1 of 1.82 against 1.97-2.16): reported, and also left out of a second statistic
+ regular = [
+ abs(float(r["error_percent"]))
+ for r in rows
+ if (r["series"], r["mode"]) != ("C", 2)
+ ]
+ signed = [
+ float(r["error_percent"]) for r in rows if (r["series"], r["mode"]) != ("C", 2)
+ ]
+ summary = {
+ "source": "Chaplin et al. (2005), J. Fluids Struct. 21, 3-24, Table 2",
+ "doi": "10.1016/j.jfluidstructs.2005.04.010",
+ "segments": args.segments,
+ "added_mass_coefficient": args.ca,
+ "axial_stiffness_N": args.ea,
+ "mass_kg_per_m": round(MASS, 5),
+ "submerged_weight_N_per_m": round(SUBMERGED_WEIGHT, 3),
+ "frequencies_compared": len(rows),
+ "mean_abs_error_percent": round(sum(errors) / len(errors), 2),
+ "max_abs_error_percent": round(max(errors), 2),
+ "without_C2": {
+ "frequencies_compared": len(regular),
+ "mean_error_percent": round(sum(signed) / len(signed), 2),
+ "mean_abs_error_percent": round(sum(regular) / len(regular), 2),
+ "max_abs_error_percent": round(max(regular), 2),
+ },
+ "executable_sha256": hashlib.sha256(args.executable.read_bytes()).hexdigest(),
+ }
+ for row in rows:
+ print(
+ f"{row['series']} mode {row['mode']}: measured {row['measured_Hz']:.3f} Hz, "
+ f"CableDyn {row['cabledyn_Hz']:.3f} Hz, {row['error_percent']:+.1f} %"
+ )
+ print(
+ json.dumps(
+ {k: v for k, v in summary.items() if k != "executable_sha256"}, indent=2
+ )
+ )
+ if args.summary is not None:
+ args.summary.mkdir(parents=True, exist_ok=True)
+ with (args.summary / "natural_frequencies.csv").open(
+ "w", newline="", encoding="utf-8"
+ ) as f:
+ writer = csv.DictWriter(f, fieldnames=list(rows[0]), lineterminator="\n")
+ writer.writeheader()
+ writer.writerows(rows)
+ (args.summary / "natural_frequencies_summary.json").write_text(
+ json.dumps(summary, indent=2) + "\n", encoding="utf-8", newline="\n"
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/validation/experiments/chaplin/natural_frequencies.csv b/validation/experiments/chaplin/natural_frequencies.csv
new file mode 100644
index 00000000..2dd84818
--- /dev/null
+++ b/validation/experiments/chaplin/natural_frequencies.csv
@@ -0,0 +1,36 @@
+series,top_tension_N,computed_top_tension_N,mode,measured_Hz,cabledyn_Hz,error_percent
+A,389.0,388.995,1,0.405,0.42478,4.88
+A,389.0,388.995,2,0.873,0.85758,-1.77
+A,389.0,388.995,3,1.326,1.30488,-1.59
+A,389.0,388.995,4,1.804,1.77337,-1.7
+A,389.0,388.995,5,2.278,2.26904,-0.39
+A,389.0,388.995,6,2.797,2.79716,0.01
+A,389.0,388.995,7,3.389,3.36239,-0.79
+B,813.0,812.989,1,0.633,0.65754,3.88
+B,813.0,812.989,2,1.329,1.31988,-0.69
+B,813.0,812.989,3,1.954,1.99141,1.91
+B,813.0,812.989,4,2.625,2.67665,1.97
+B,813.0,812.989,5,3.312,3.37989,2.05
+B,813.0,812.989,6,4.028,4.10525,1.92
+B,813.0,812.989,7,4.753,4.85662,2.18
+C,1185.0,1184.984,1,0.782,0.80761,3.27
+C,1185.0,1184.984,2,1.423,1.61906,13.78
+C,1185.0,1184.984,3,2.394,2.438,1.84
+C,1185.0,1184.984,4,3.203,3.26811,2.03
+C,1185.0,1184.984,5,4.024,4.11299,2.21
+C,1185.0,1184.984,6,4.875,4.97611,2.07
+C,1185.0,1184.984,7,5.704,5.86083,2.75
+D,1546.0,1545.978,1,0.899,0.93027,3.48
+D,1546.0,1545.978,2,1.815,1.86386,2.69
+D,1546.0,1545.978,3,2.741,2.80394,2.3
+D,1546.0,1545.978,4,3.614,3.75374,3.87
+D,1546.0,1545.978,5,4.561,4.7164,3.41
+D,1546.0,1545.978,6,5.525,5.69501,3.08
+D,1546.0,1545.978,7,6.439,6.69255,3.94
+E,1925.0,1924.973,1,1.037,1.04361,0.64
+E,1925.0,1924.973,2,2.046,2.09017,2.16
+E,1925.0,1924.973,3,3.084,3.14252,1.9
+E,1925.0,1924.973,4,4.099,4.20354,2.55
+E,1925.0,1924.973,5,5.127,5.27606,2.91
+E,1925.0,1924.973,6,6.222,6.36284,2.26
+E,1925.0,1924.973,7,7.298,7.46662,2.31
diff --git a/validation/experiments/chaplin/natural_frequencies_summary.json b/validation/experiments/chaplin/natural_frequencies_summary.json
new file mode 100644
index 00000000..c8ab7007
--- /dev/null
+++ b/validation/experiments/chaplin/natural_frequencies_summary.json
@@ -0,0 +1,19 @@
+{
+ "source": "Chaplin et al. (2005), J. Fluids Struct. 21, 3-24, Table 2",
+ "doi": "10.1016/j.jfluidstructs.2005.04.010",
+ "segments": 64,
+ "added_mass_coefficient": 1.0,
+ "axial_stiffness_N": 5500000.0,
+ "mass_kg_per_m": 1.84726,
+ "submerged_weight_N_per_m": 12.077,
+ "frequencies_compared": 35,
+ "mean_abs_error_percent": 2.61,
+ "max_abs_error_percent": 13.78,
+ "without_C2": {
+ "frequencies_compared": 34,
+ "mean_error_percent": 1.87,
+ "mean_abs_error_percent": 2.28,
+ "max_abs_error_percent": 4.88
+ },
+ "executable_sha256": "ddf7dc1be365f0d67987bb718859362982147467c78a7a28a7df743345cc767a"
+}
diff --git a/validation/experiments/chaplin/provenance.json b/validation/experiments/chaplin/provenance.json
new file mode 100644
index 00000000..5958c499
--- /dev/null
+++ b/validation/experiments/chaplin/provenance.json
@@ -0,0 +1,20 @@
+{
+ "source": "Chaplin, Bearman, Huera Huarte & Pattenden (2005), Journal of Fluids and Structures 21(1), 3-24",
+ "doi": "10.1016/j.jfluidstructs.2005.04.010",
+ "data_used": "Section 2 riser properties; Table 2 still-water top tensions and natural frequencies of modes 1-7, series A-E",
+ "CableDyn_commit": "a0e8c04 (dev, after 0.4.2)",
+ "validation_date": "2026-11-11",
+ "executable_name": "cabledyn.exe",
+ "executable_sha256": "see natural_frequencies_summary.json",
+ "compiler": "GNU Fortran 16.2.0",
+ "build_type": "Release",
+ "platform": "Windows 11 x86-64",
+ "cases": 5,
+ "segments": 64,
+ "sensitivity": {
+ "segments_128_max_relative_change": 3.0e-6,
+ "axial_stiffness_x10_max_relative_change": 1.2e-4,
+ "added_mass_1p1_mean_error_percent": 0.62,
+ "added_mass_1p2_mean_error_percent": -0.59
+ }
+}
diff --git a/validation/experiments/chaplin_catenary/README.md b/validation/experiments/chaplin_catenary/README.md
new file mode 100644
index 00000000..66e269ca
--- /dev/null
+++ b/validation/experiments/chaplin_catenary/README.md
@@ -0,0 +1,331 @@
+
+
+# Southampton untensioned catenary riser: VIV with high curvature and touchdown
+
+This directory compares CableDyn with the tests of Chaplin & King (2018),
+: a 5.36 m, 56 mm model riser of very low
+bending stiffness, pinned on the floor of a 2 m deep flume and 0.2 m above the surface 4.30 m
+away, tensioned only by its weight and the drag, at two mass ratios in currents of 0.2-1.4 m/s in
+both directions. Much of it lies on the floor, and the touchdown moves with the flow: a highly
+curved, untensioned catenary with touchdown in VIV, the configuration of a free-hanging dynamic
+cable near the seabed. Its frequencies test what a local time-domain VIV model does where the
+normal velocity varies threefold along the span: the article measures one cross-flow frequency
+along the whole riser, close to f = 0.11 U/d with U the flow speed, well below the Strouhal number
+of about 0.2 of a stationary cylinder. No model parameter is fitted to these tests.
+
+In short:
+
+- **All three VIV models reproduce the uniform frequency along the span** in positive current
+ (within 10 % over the suspended stations in 26 of 26 runs with the generic set, 22 with the
+ wake oscillator, 20 with Ulveseter et al.'s set), **but at their own Strouhal number, not at
+ the measured 0.11:** f d/U 0.121 (Ulveseter et al. 2019, 9 % high), 0.138 (generic set, 24 %
+ high) and 0.17 (wake oscillator, St 0.2, 53 % high). The frequency follows the flow at the
+ near-vertical top, as measured, and the lower part follows it.
+- **In negative current** the heavy riser's measured frequency stays at 1.05-1.16 Hz from
+ 1.1 m/s, where the straight part's normal velocity is constant; Ulveseter et al.'s set also
+ levels off, about 35 % higher at 1.45-1.5 Hz (f d/(U sin ψ) 0.130 against 0.119 measured), the
+ generic set gives 1.45-1.85 Hz and the wake oscillator 2.1-2.45 Hz.
+- **The mean top tension needs the drag amplification:** with it (the generic set) the light
+ riser's tension in positive current is within 9.8 % r.m.s. and rises by 88.8 N to 1.4 m/s
+ against 88.6 N measured; with C_d 1.2 it rises by 49.8 N without VIV and by 60.1 and 51.4 N
+ with the two sets that keep C_d. The same set gives the heavy riser's straight-line inclination
+ in negative current to 5.0° r.m.s. (the drag coefficient it implies by the article's Eq. 9,
+ 2.55, against 2.47 measured), and overshoots its tension rise above 1.2 m/s.
+- **The still-water tension of the heavy riser is 37 % above the measured one** (81.2 against
+ 59.1 N; light riser 15.1 against 13.4 N) with the article's length, span and weights, a
+ geometry the article's numbers do not close; the tension is therefore also compared as the
+ increment from still water.
+
+## The tests (Chaplin & King 2018)
+
+- **Riser (Table 1, Sec. 2):** a 4 mm wire rope through nylon bobbins (30 mm long, 10 mm apart) in
+ a silicone sheath, d 56 mm, 5.36 m between pinned ends; EI 1.3 N m² and EA 790 kN estimated from
+ the parts; structural damping about 3 % of critical in air (free decays, hanging vertically);
+ submerged weight 2.9 N/m (m* 1.12) and 20.9 N/m (m* 1.84, lead plugs; the twelve instrumented
+ bobbins have none), m* the mass with the internal water over the displaced mass.
+- **Set-up:** a recirculating flume, 2.0 m deep; the lower pin on the floor, the upper pin 0.2 m
+ above the surface and 4.30 m away horizontally. Positive current: the upstream pin on the floor
+ (the profile concave to the flow); negative: the upstream pin at the surface, obtained in the
+ laboratory by swapping the pin elevations (Sec. 3). U from 0.2 to 1.4 m/s in 0.05 m/s steps,
+ Re up to 70 000.
+- **Measured:** tension load cells at both ends; twelve 3-axis accelerometers 0.4 m apart; video
+ of up to three bobbins. The article reports the mean top tension with ±1 standard deviation
+ (Figs. 10 and 13), spectral peak frequencies of the cross-flow accelerations (Figs. 7-9, 15, 16),
+ the mean profile and the inclination of the straight part in negative current (Figs. 5, 11, 12),
+ and no amplitude statistics.
+- **Findings the case tests:** in positive current the cross-flow frequency is uniform along the
+ riser and close to f = 0.11 U/d, U within 3 % of the normal velocity at the near-vertical top
+ (Fig. 9), so that the local Strouhal number on the normal velocity runs from 0.11 at the top
+ to above 0.3 lower down (Fig. 8); in negative current the riser takes a straight inclined
+ profile on which the normal drag balances the normal weight (their Eq. 9; C_d 2.0-2.8 bracket
+ the measured inclinations), U sin ψ tends to a constant, and the frequency follows
+ f = 0.13 U sin ψ/d (Fig. 15(b)) except where the response locks in.
+
+### Caveats of the data
+
+- **Still-water tension.** With the stated length, span, depth and weights the riser hangs as a
+ catenary whose top tension is 81.2 N (m* 1.84) and 15.1 N (m* 1.12), with the 0.2 m above the
+ surface in air. The article's still-water points are 59.1 and 61.8 N (Figs. 10 and 13, the
+ two rigs) and 13.4 and 11.5 N. A catenary of 5.36 m between the stated pins cannot hang that
+ slack; the touchdown in Fig. 5 is also further from the floor pin than the model's. A laid part
+ that is not straight (slack held by the floor friction) or a geometry other than Table 1's would
+ explain both; the article does not say. The comparison is made on the absolute tension and on
+ its increment from still water, each figure against its own still-water point.
+- **The reference lines W h of Fig. 13** (41.8 and 5.8 N, Table 1's weight times the water
+ depth) leave out the in-air weight of the part above the surface, m g × 0.2 m, 9.0 and 5.4 N
+ in the model; the measured tensions in negative current sit on these lines.
+- **Frequencies** are spectral peaks of accelerometer signals, which gravity contaminates at the
+ vibration frequency (Sec. 3); the article shows that the peaks agree with those of video
+ displacements (Fig. 4). Several peaks are given at some speeds (Fig. 15).
+- **Not given:** the accelerometer positions (only the 0.4 m spacing; the profiles of Fig. 5 put
+ the first 0.5 m from the floor pin), the floor friction, the flume's water density, the spectral
+ method, and the scatter of the frequencies.
+
+## Model
+
+- **Line:** one finite-EI line of 54 elements (0.099 m), End A the upper pin at (4.30, 0, 0.2) m,
+ End B the lower pin on the floor at (0, 0, -2.0) m, both pinned. d 56 mm, EI 1.3 N m², EA
+ 790 kN, mass ρA + W/g (2.759 and 4.594 kg/m; Table 1's m* 1.84 gives 4.532 kg/m, 1.4 % less),
+ the same mass above the surface. Fresh water, 1000 kg/m³ (not stated; m* 1.12 and 2.9 N/m agree
+ at it). C_d 1.2, C_a 1.
+- **Structural damping:** Rayleigh damping (`EI|-zeta|f1|f2`), 3 % at 0.3 and 3.0 Hz, the range of
+ the measured cross-flow frequencies; run without it as a sensitivity.
+- **Floor:** the default penalty contact and a friction coefficient 0.5 (a silicone sheath on the
+ flume floor; not given). Without friction the laid part slides sideways under the suspended
+ part's motion; frictionless runs are a sensitivity.
+- **Current:** uniform over the depth along the riser's plane, +x positive, -x negative, ramped
+ linearly from still water over 10 s (a static solve in the full current finds no equilibrium
+ for some light-riser cases in negative current, where the riser lifts off the floor; every run
+ starts from the same still-water state). The part above the surface is dry.
+- **Runs:** dt 2.5 ms, 110 s, statistics over 30-110 s (80 s); without VIV 40 s, statistics over
+ 30-40 s. U = 0.2-1.4 m/s in 0.1 m/s steps for both mass ratios and directions (52 runs per set).
+
+### Coefficient sets
+
+The sets of the FLOTANT and NDP cases, none fitted to these tests, and a run
+without VIV:
+
+| Set | Source | Values | Fitted to |
+| --- | --- | --- | --- |
+| `uls19` | Ulveseter et al. (2019), Table 1 | C_l 0.85, f̂0 0.144 ± 0.064; in-line C_x 0.75, α 0.15, C_hh 1.5 | the NDP riser in uniform flow: blind here |
+| `b1` | The generic set of the Delta Flume case | C_l 0.8, f̂0 0.18 ± 0.08; in-line C_x 0.85, α 0.15 (Ulveseter et al. 2018, Table 3); `VIV AMPLITUDE` C_v 0.8 with the drag amplification of Chaplin et al. (2005, Eq. 4); `VIV DAMPING` `0 0 1` | nothing from these tests: blind |
+| `wake` | Facchinetti et al. (2004) | `WAKE OSCILLATOR` C_L0 0.3, St 0.2, ε 0.3, A 12; cross-flow only | rigid-cylinder data: blind |
+| `none` | | no VIV force, C_d 1.2 | |
+
+Only `b1` amplifies the drag with the response; `uls19` and `wake` keep C_d 1.2, so their mean
+tension differs from `none` only by the dynamics.
+
+### Processing
+
+- **Tension:** mean and standard deviation of the tension at the upper pin (`FairTen1`); the
+ measured value of each figure at the same speed; the increment from still water, each against
+ its own still-water value.
+- **Frequency:** the peak of the averaged spectrum (20 s Hann segments, half overlapping,
+ 0.05 Hz resolution) of the cross-flow (y) displacement within 0.3-6 Hz (the lowest measured
+ frequency is 0.34 Hz; below it some runs wander slowly sideways), the dominant frequency the
+ article shows to agree in its acceleration and video-displacement spectra (Fig. 4); the peak
+ of the same spectrum weighted by ω⁴, the acceleration spectrum, within 0.15-6 Hz, is in
+ `response_comparison.csv` (`model_f_acc_…`). Compared points, by their mean elevation: the two
+ dots of the inset of Fig. 9(a) (0.65 and 0.37 of the height between the pins; the mean of the
+ two) and the dot of Fig. 9(b) (0.19) in positive current, mid-depth (Fig. 15, "around
+ mid-depth") in negative current. The model's frequency is set against the nearest measured
+ peak at the same speed and mass ratio (`nearest_measured_…`) and against the median measured
+ f d/U. The spread along the span is (max - min)/median over the twelve accelerometer stations,
+ taken 0.48 m from each pin and 0.4 m apart, that are off the floor and under water.
+- **Inclination:** of the mean profile to the horizontal at mid-depth; the drag coefficient it
+ implies by the article's Eq. 9, C_d = 2 W cos ψ / (ρ d U² sin² ψ), for the model and the
+ measurement, as a comparison only: nothing is fitted to it.
+
+### Measurements
+
+`extract_chaplin2018.py` reads the article's PDF (not distributed; PyMuPDF, NumPy, SciPy, Pillow)
+into `measured_chaplin2018.csv`. The figures are greyscale raster images:
+
+- each panel is calibrated on its frame and the tick marks on both opposite sides of it (largest
+ residual 0.0010 m/s, 0.0036 Hz, 0.07°, 0.14 N);
+- the markers are found by a circle Hough transform, classed solid or open by their fill and
+ snapped to the 0.05 m/s test grid (largest snap 0.012 m/s); peaks off the grid or between the
+ classes are dropped and listed by the script; the error bars are read from their caps;
+- **checks:** the line f d/U = 0.11 drawn in Fig. 9 reads 0.105 and 0.108; the lines W h in
+ Fig. 13 read 41.9 and 5.65 N against Table 1's 41.8 and 5.8 N;
+- **points read:** Fig. 10, 26 open and 24 solid (every marker; 46 standard deviations); Fig. 13,
+ 25 and 26 (one open marker lost where the series cross; 44 standard deviations); Fig. 12(a),
+ 20 and 25; Fig. 15(a), 26 and 47; Fig. 9(a), 12 and 40, Fig. 9(b), 22 and 34. Markers hidden
+ under others are lost, which in Fig. 9(a), where both series and both accelerometers fall on
+ one line, is most of the open ones; `--check DIR` draws what was read over each figure.
+
+The data are digitised from the article; its figures are not reproduced.
+
+## Reproduce
+
+From the repository root, with `path/to/cabledyn.exe` the release executable or a local build:
+
+```powershell
+python validation/experiments/chaplin_catenary/extract_chaplin2018.py CHAPLIN2018.pdf
+python validation/experiments/chaplin_catenary/chaplin_catenary_viv.py `
+ path/to/cabledyn.exe validation/experiments/chaplin_catenary/work --jobs 4 `
+ --summary validation/experiments/chaplin_catenary
+```
+
+The default is the committed record: 2 still-water runs, 208 primary runs, 12 convergence runs and
+72 sensitivity runs, about an hour with 4 parallel runs. `--runs` selects runs by name; a run
+whose folder holds the same input files and executable is not repeated; `--keep` keeps the output
+tables (about 110 MB a run). `response_comparison.csv` holds every run, `summary.json` the scores
+and the SHA-256 of the executable, `provenance.json` the sources and assumptions.
+
+## Results
+
+`response_comparison.csv` holds every run against the measured values at its speed;
+`summary.json` the scores below.
+
+### Still water
+
+| m* | CableDyn (N) | Measured, Fig. 10 (N) | Measured, Fig. 13 (N) |
+| --- | --- | --- | --- |
+| 1.12 | 15.1 | 13.4 | 11.5 |
+| 1.84 | 81.2 | 59.1 | 61.8 |
+
+The model's touchdown is 2.18 m (m* 1.84) and 1.99 m (m* 1.12) from the floor pin; Fig. 5 puts
+the heavy riser's touchdown at the lowest speeds near 2.6 m (by eye). See the caveats above.
+
+### Mean top tension
+
+r.m.s. relative error of the mean tension over the 13 speeds (12 where Fig. 10 has no marker),
+r.m.s. error of its increment from still water (N), and the median ratio of the standard
+deviations (CableDyn over measured, where the error bar was read):
+
+| Set | Positive, m* 1.12 | Positive, m* 1.84 | Negative, m* 1.12 | Negative, m* 1.84 |
+| --- | --- | --- | --- | --- |
+| `none` (C_d 1.2) | 0.245; 19.6 N | 0.135; 18.4 N | 0.365; 11.5 N | 0.385; 22.8 N |
+| `uls19` | 0.178; 14.5 N; sd 0.81 | 0.150; 12.2 N; sd 1.14 | 0.322; 6.9 N; sd 1.43 | 0.296; 14.3 N; sd 1.61 |
+| `b1` | **0.098; 1.8 N**; sd 0.59 | 0.238; **4.9 N**; sd 0.69 | 0.301; **3.9 N**; sd 1.22 | 0.248; 13.7 N; sd 1.21 |
+| `wake` | 0.234; 18.8 N; sd 0.19 | 0.139; 17.7 N; sd 0.42 | 0.351; 10.5 N; sd 0.42 | 0.316; 16.4 N; sd 0.76 |
+
+Tension at 1.4 m/s (N; the increment from still water in brackets):
+
+| | Positive, m* 1.12 | Positive, m* 1.84 | Negative, m* 1.12 | Negative, m* 1.84 |
+| --- | --- | --- | --- | --- |
+| Measured | 102.0 (+88.6) | 154.9 (+95.8) | 58.3 (+46.8) | 49.5 (−12.3) |
+| `none` | 64.9 (+49.8) | 145.6 (+64.4) | 39.7 (+24.6) | 41.9 (−39.3) |
+| `uls19` | 75.2 (+60.1) | 158.5 (+77.3) | 48.2 (+33.1) | 50.8 (−30.4) |
+| `b1` | 103.8 (+88.8) | 188.8 (+107.6) | 70.7 (+55.7) | 68.4 (−12.8) |
+| `wake` | 66.5 (+51.4) | 146.4 (+65.2) | 41.5 (+26.4) | 49.7 (−31.5) |
+
+- **Positive current:** the tension rises with the drag on the suspended part. Only the generic
+ set, whose drag grows with the response (Chaplin et al. 2005, Eq. 4), follows the light
+ riser's rise: within 5.6 N at every speed and within 1.8 N from 1.0 m/s (80.2 against
+ 80.2 N at 1.2 m/s). The sets that keep C_d 1.2 fall 13-36 N short at 1.0-1.4 m/s, close to
+ the run without VIV: Ulveseter et al.'s response adds 5-10 N to it, the wake oscillator's
+ 1-2 N. For the heavy riser the still-water offset dominates the absolute error; the generic
+ set's increment is 12 % above the measured at 1.4 m/s, the others 19-33 % below.
+- **Negative current:** the heavy riser's tension falls from the still-water value as the drag
+ lifts it into a straight line whose top tension the article puts at W h (41.8 N): measured
+ 59 → 40 N at 0.2-0.65 m/s, then 41-49 N to 1.4 m/s. Every set reproduces the fall, at higher
+ speeds: the generic set reaches 40 N at 0.7 m/s, Ulveseter et al.'s and the wake oscillator
+ near 0.9 m/s. Above 1.2 m/s the generic set rises to 68 N where the measured stays below
+ 50 N. The light riser lifts off the floor entirely from 0.5-0.6 m/s in the model, as measured
+ (lifted at 0.6 m/s, Sec. 4.2); its tension rise to 1.4 m/s is 55.7 N with the generic set
+ against 46.8 N measured, 33.1 N with Ulveseter et al.'s.
+- **Fluctuation:** the generic set's standard deviation is 0.59-0.69 of the measured in positive
+ current; Ulveseter et al.'s is 0.81-1.14; the wake oscillator's 0.19-0.42.
+
+### Cross-flow frequency
+
+Median f d/U of CableDyn at the points compared and of the measured points read (all speeds),
+and the median ratio of CableDyn's frequency to the nearest measured point at the same speed:
+
+| Set | Positive, upper (Fig. 9(a)) | Positive, lower (Fig. 9(b)) | Negative, mid-depth (Fig. 15(a)) | Uniform along the span (positive / negative runs) |
+| --- | --- | --- | --- | --- |
+| Measured, m* 1.12 / 1.84 | 0.111 / 0.113 | 0.090 / 0.102 | 0.064 / 0.061 | uniform (Fig. 7) |
+| `uls19` | 0.121; ratio 1.11 / 1.07 | 0.121; 1.37 / 1.08 | 0.090 / 0.103; 1.47 / 1.32 | 20 of 26 / 12 of 26 |
+| `b1` | 0.138; 1.24 / 1.25 | 0.138; 1.52 / 1.28 | 0.128 / 0.098; 1.84 / 1.45 | 26 of 26 / 15 of 26 |
+| `wake` | 0.173 / 0.168; 1.31 / 1.40 | 0.168; 1.83 / 1.47 | 0.074 / 0.128; 0.98 / 2.03 | 22 of 26 / 22 of 26 |
+
+Uniform: the spread of the frequency over the suspended stations under water within 10 % of its
+median.
+
+- **Positive current: one frequency along the span.** In every set the cross-flow response of
+ the whole suspended span, the curved and nearly horizontal lower part included, is at one
+ frequency set by the flow at the near-vertical top; the local normal velocity there is within
+ 3 % of U, and further down the same frequency means a local f d/(U sin ψ) rising towards the
+ touchdown, as Fig. 8 measures. The lower part does not respond at the frequency of its own
+ normal velocity: its synchronisation or wake follows the motion the span imposes on it. The
+ level is each model's own: Ulveseter et al.'s set, whose band is centred at 0.144, settles at
+ 0.121, 9 % above the measured 0.11 (7 of 12 heavy-riser speeds within 10 % of a measured
+ peak); the generic set (centre 0.18) at 0.138; the wake oscillator at its Strouhal number,
+ 0.17.
+- **Not reproduced in positive current:** the heavy riser's second branch at the lower
+ accelerometer, 0.67-0.83 Hz at 0.6-1.0 m/s (about half the dominant frequency, Fig. 9(b)),
+ and the light riser's frequency at the same point levelling at 1.57-1.81 Hz from 0.9 m/s;
+ CableDyn keeps the dominant frequency there.
+- **Negative current, heavy riser:** the measured frequency at mid-depth rises to about 1.05 Hz
+ at 0.5-0.6 m/s, dips (the article attributes it to lock-in while the touchdown moves) and
+ stays at 1.05-1.16 Hz from 1.1 m/s, where U sin ψ is constant. Ulveseter et al.'s set has the
+ same plateau at 1.45-1.5 Hz from 1.0 m/s, f d/(U sin ψ) 0.130 on the model's own inclination
+ (measured 0.119 on the measured one, the article's line 0.13); the generic set 1.45-1.85 Hz;
+ the wake oscillator 2.1-2.45 Hz.
+- **Negative current, light riser:** the measured spectra have a low branch at 0.34-0.45 Hz to
+ 0.85 m/s and a branch rising from 0.5 Hz at 0.6 m/s to 1.75 Hz at 1.3 m/s, which the article
+ attributes to lock-in under the rising tension; Ulveseter et al.'s and the generic set have
+ 0.5-0.85 Hz to 0.8 m/s and then mostly 2.2-3.6 Hz at mid-depth, above the measured branch; the
+ wake oscillator stays at 0.9-1.15 Hz.
+- **Slow sideways wandering:** with Ulveseter et al.'s set the light riser at 0.4-0.5 m/s, where
+ it lifts off the floor, and the heavy riser at 1.0-1.3 m/s in negative current drift sideways
+ at under 0.3 Hz (A/D_rms 2-7.3 with the drift, 0.5-0.7 without); the article does not report
+ it.
+- **The acceleration spectrum** (`model_f_acc_…`), the article's measured quantity, peaks at a
+ higher harmonic of the displacement's peak in 2-5 of the 13 runs of a point with Ulveseter et
+ al.'s set (its higher-harmonic force, C_hh 1.5) and in 8 of 13 with the wake oscillator in
+ light negative current, at most 2 with the generic set; the measured acceleration spectra
+ peak where the displacement's do (Fig. 4).
+
+### Inclination of the straight part in negative current
+
+r.m.s. difference of the inclination at mid-depth from Fig. 12(a), and the median drag
+coefficient the inclination implies by Eq. 9 (measured: 1.84 for m* 1.12 and 2.47 for m* 1.84):
+
+| Set | m* 1.12 | m* 1.84 |
+| --- | --- | --- |
+| `none` (C_d 1.2) | 18.6°; C_d 0.80 | 10.1°; C_d 1.33 |
+| `uls19` | 15.0°; 0.90 | 10.1°; 1.36 |
+| `b1` | 14.7°; 0.94 | **5.0°; 2.55** |
+| `wake` | 15.7°; 0.92 | 10.3°; 1.36 |
+
+- For the heavy riser the generic set's drag amplification gives the measured inclination and
+ drag: the article's C_d 2.0-2.8 follows from the response, not from an input. The sets with
+ C_d 1.2 differ by 10° r.m.s., steeper at the higher speeds (34° against 25° at 1.2 m/s).
+- The light riser's model inclination at mid-depth is not a tension-free straight line: the run
+ without VIV, C_d 1.2 by input, reads 0.80 through Eq. 9. Its comparison is a profile check,
+ not a drag check; every set differs by 15-19° r.m.s., steeper on average.
+
+### Sensitivity and convergence
+
+- **Convergence** (`uls19`, `b1`, `wake` at m* 1.84, +0.8 m/s and m* 1.12, −1.2 m/s): half the
+ time step changes the mean tension by at most 0.6 % except one run (+5.3 %, `b1`, light,
+ −1.2 m/s, whose frequency moves by −11 %); the standard deviation by at most 5.5 % and the
+ largest A/D_rms by at most 7.9 %. Twice the elements change the mean
+ tension by at most 2.9 %, its standard deviation by at most 17 % (`uls19`, light, −1.2 m/s)
+ and the frequency by at most one bin.
+- **Without structural damping** (36 runs at 0.4, 0.8 and 1.2 m/s): the mean tension changes by
+ −1.3 to +15.5 % (above 5 % in five runs, all in negative current); the standard deviation of
+ the tension by up to +296 % (the wake oscillator, light, +0.8 m/s), so the 3 % damping
+ matters for the fluctuation and not for the mean; 12 of the 54 compared frequencies change.
+- **Frictionless floor** (36 runs): the mean tension changes by −3 to +40 % (above 5 % in five
+ runs, the largest the wake oscillator, light, −0.4 m/s, where the riser lifts off); the
+ standard deviation by up to +412 %, the laid part sliding sideways; 34 of the 54 frequencies
+ change, by −15 % to +150 %. The friction coefficient, not given, is the largest modelling
+ uncertainty of the case after the still-water geometry.
+- The default command, run into a new work directory, reproduces `response_comparison.csv` and
+ `summary.json` byte for byte.
+
+## Limitations
+
+- The still-water top tension of the heavy riser is not reproduced (+37 %), so the absolute
+ tension carries that offset; the article's numbers do not close the geometry.
+- The frequencies are read from raster figures in which many markers overlap: in Fig. 9(a) most
+ of the light riser's points are hidden (12 read), and the accelerometer positions are assumed.
+- The floor friction and the representation of the 3 % structural damping are assumptions, and
+ the tension fluctuation depends on both.
+- The current is uniform to the floor; the flume's boundary layer is not modelled, and the laid
+ part sees the full current.
+- One 80 s record per speed; the article does not give the scatter of its frequencies.
diff --git a/validation/experiments/chaplin_catenary/chaplin_catenary_viv.py b/validation/experiments/chaplin_catenary/chaplin_catenary_viv.py
new file mode 100644
index 00000000..8088e888
--- /dev/null
+++ b/validation/experiments/chaplin_catenary/chaplin_catenary_viv.py
@@ -0,0 +1,882 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+"""VIV of the Southampton untensioned catenary model riser with high curvature in steady current.
+
+The tests of Chaplin & King (2018): a 5.36 m, 56 mm riser of very low bending stiffness, pinned
+on the floor of a 2 m deep flume and 0.2 m above the surface 4.30 m away, tensioned only by its
+weight and the drag, at two mass ratios (submerged weight 2.9 and 20.9 N/m) in currents up to
+1.4 m/s in both directions: positive with the upstream end on the floor, negative with it at
+the surface. Writes a deck per run, runs them in parallel (a run whose folder holds the same
+input files and executable is reused) and compares with the measurements of the article (read
+by extract_chaplin2018.py):
+ the mean top tension and its standard deviation against U (Figs. 10 and 13);
+ the dominant cross-flow frequency against U (Fig. 9, positive; Fig. 15(a), negative) and its
+ spread along the suspended span (uniform in the tests);
+ the inclination of the straight part in negative current (Fig. 12(a)) and the drag
+ coefficient it implies by the article's Eq. 9, as a comparison only;
+for three published VIV coefficient sets and without VIV (C_d 1.2).
+
+The default runs are the committed record: every set at U = 0.2-1.4 m/s in steps of 0.1 m/s for
+both mass ratios and directions, the still-water runs, and the convergence runs and the runs
+without structural damping and without floor friction (README).
+
+ python chaplin_catenary_viv.py path/to/cabledyn.exe WORKDIR [--runs NAME,...] [--jobs N]
+ [--keep] [--summary DIR]
+
+Sources:
+ J.R. Chaplin, R. King (2018), Laboratory measurements of the vortex-induced vibrations of an
+ untensioned catenary riser with high curvature, Journal of Fluids and Structures 79, 26-38,
+ https://doi.org/10.1016/j.jfluidstructs.2018.01.008 (Table 1; Secs. 2-4; Eqs. 9-10;
+ Figs. 9, 10, 12, 13 and 15)
+ J.V. Ulveseter, M.J. Thorsen, S. Saevik, C.M. Larsen (2019), Simulating fundamental and higher
+ harmonic VIV of slender structures, Applied Ocean Research 90, 101856,
+ https://doi.org/10.1016/j.apor.2019.101856 (Table 1)
+ J.V. Ulveseter, M.J. Thorsen, S. Saevik, C.M. Larsen (2018), Time domain simulation of riser
+ VIV in current and irregular waves, Marine Structures 60, 241-260,
+ https://doi.org/10.1016/j.marstruc.2018.04.001 (Table 3)
+ J.R. Chaplin, P.W. Bearman, F.J. Huera Huarte, R.J. Pattenden (2005), Laboratory measurements
+ of vortex-induced vibrations of a vertical tension riser in a stepped current, Journal of
+ Fluids and Structures 21(1), 3-24, https://doi.org/10.1016/j.jfluidstructs.2005.04.010 (Eq. 4)
+ M.L. Facchinetti, E. de Langre, F. Biolley (2004), Coupling of structure and wake oscillators
+ in vortex-induced vibrations, Journal of Fluids and Structures 19(2), 123-140,
+ https://doi.org/10.1016/j.jfluidstructs.2003.12.004
+"""
+
+from __future__ import annotations
+
+import argparse
+import csv
+import hashlib
+import json
+import math
+import os
+import shutil
+import subprocess
+from concurrent.futures import ThreadPoolExecutor
+from pathlib import Path
+
+import numpy as np
+
+HERE = Path(__file__).resolve().parent
+GRAVITY = 9.80665 # m/s^2
+RHO = 1000.0 # kg/m^3: fresh water (not stated; Table 1's W and m* agree at 1000 for m* 1.12)
+# Chaplin & King (2018), Table 1
+LENGTH = 5.36 # m, between the pin ends
+DIAMETER = 0.056 # m
+EI = 1.3 # N m^2, estimated
+EA = 7.9e5 # N, estimated
+ZETA = 0.03 # structural damping in air, "about 3 % of critical"
+WEIGHT = {"1.12": 2.9, "1.84": 20.9} # N/m submerged, by mass ratio m*
+DEPTH = 2.0 # m, the lower pin on the floor
+TOP = 0.2 # m, the upper pin above the surface
+SPAN = 4.30 # m, horizontal distance between the pins
+CD, CA = 1.2, 1.0
+FRICTION = (
+ 0.5 # floor friction coefficient (not given: a silicone sheath on the flume floor)
+)
+SEGMENTS, DT = 54, 0.0025 # about 0.1 m elements
+# The current is ramped up linearly from still water over RAMP s: a static solve in the full
+# current finds no equilibrium for some light-riser cases in negative current, where the riser
+# lifts off the floor, so every run starts from the same still-water state.
+RAMP = 10.0 # s
+TMAX, T0 = 110.0, 30.0 # s: run length, statistics from T0
+TMAX_NONE, T0_NONE = 40.0, 30.0 # s: the runs without VIV settle to a steady state
+WELCH = 20.0 # s, the segment of the averaged spectra (0.05 Hz resolution)
+# Hz, where the dominant cross-flow frequency is sought: in the displacement spectrum from 0.3 Hz
+# (below the lowest measured frequency, 0.35 Hz; a light riser lifted in negative current also
+# wanders slowly sideways), in the acceleration spectrum from 0.15 Hz
+BAND = {0: (0.3, 6.0), 4: (0.15, 6.0)}
+SPEEDS = [round(0.1 * k, 1) for k in range(2, 15)] # m/s
+DIRECTIONS = {"pos": 1.0, "neg": -1.0}
+# Rayleigh damping 3 % at the ends of the band of the measured cross-flow frequencies
+RAYLEIGH = (0.3, 3.0) # Hz
+# The points compared with the measured frequencies, by their mean elevation [m]: the dots of
+# the insets of Fig. 9 (two near the top, (a); one low down, (b)), at their share of the height
+# between the pins (0.65 and 0.37; 0.19), and mid-depth for Fig. 15 ("around mid-depth").
+PROBES = {
+ "upper_a": -DEPTH + 0.65 * (DEPTH + TOP),
+ "upper_b": -DEPTH + 0.37 * (DEPTH + TOP),
+ "lower": -DEPTH + 0.19 * (DEPTH + TOP),
+ "mid_depth": -0.5 * DEPTH,
+}
+ANALYSIS = "2" # part of the reuse key: bump when an analysis changes
+
+
+def chaplin_amplification(ad: float) -> float:
+ """Chaplin et al. (2005, Eq. 4): Cd/Cd0 = 1 + 2.3 s + 1.7 s^2, s = (A/D)/sqrt(2)."""
+ s = ad / math.sqrt(2.0)
+ return 1.0 + 2.3 * s + 1.7 * s * s
+
+
+# The coefficient sets of the FLOTANT, NDP and V701 cases: LINE TYPES Cl dF cF; VIV row (ClX,
+# alpha, Chh); VIV AMPLITUDE with Chaplin's drag amplification; VIV DAMPING (a, b, c); WAKE
+# OSCILLATOR (CL0, St, eps, A). none: no VIV, C_d 1.2.
+SETS: dict[str, dict] = {
+ "uls19": {
+ "label": "Ulveseter et al. (2019), Table 1, Chh 1.5",
+ "cl": (0.85, 0.064, 0.144),
+ "viv": (0.75, 0.15, 1.5),
+ "amp": False,
+ "damping": None,
+ "wake": None,
+ },
+ "b1": {
+ "label": "generic set (Delta Flume case)",
+ "cl": (0.8, 0.08, 0.18),
+ "viv": (0.85, 0.15, None),
+ "amp": True,
+ "damping": (0, 0, 1),
+ "wake": None,
+ },
+ "wake": {
+ "label": "Facchinetti et al. (2004) wake oscillator",
+ "cl": (0, 0.08, 0.18),
+ "viv": None,
+ "amp": False,
+ "damping": None,
+ "wake": (0.3, 0.2, 0.3, 12),
+ },
+ "none": {
+ "label": "no VIV, C_d 1.2",
+ "cl": (0, 0.08, 0.18),
+ "viv": None,
+ "amp": False,
+ "damping": None,
+ "wake": None,
+ },
+}
+
+
+def viv_sections(hset: str) -> str:
+ s = SETS[hset]
+ text = ""
+ if s["viv"]:
+ clx, alpha, chh = s["viv"]
+ cols, vals = "ClX alpha", f"{clx} {alpha}"
+ if chh is not None:
+ cols, vals = cols + " Chh", vals + f" {chh}"
+ text += (
+ "--------------------- VIV ----------------------------------------------\n"
+ f"TypeName {cols}\n(-){' (-)' * len(cols.split())}\nriser {vals}\n"
+ )
+ if s["amp"]:
+ text += (
+ "--------------------- VIV AMPLITUDE ------------------------------------\n"
+ "TypeName AD Cv CdAmp\n(-) (-) (-) (-)\n"
+ + "".join(
+ f"riser {0.1 * k:.2f} {s['cl'][0]} {chaplin_amplification(0.1 * k):.5f}\n"
+ for k in range(16)
+ )
+ )
+ if s["damping"]:
+ a, b, c = s["damping"]
+ text += (
+ "--------------------- VIV DAMPING ------------------------------------\n"
+ f"TypeName a b c\n(-) (-) (-) (-)\nriser {a} {b} {c}\n"
+ )
+ if s["wake"]:
+ text += (
+ "--------------------- WAKE OSCILLATOR ----------------------------------\n"
+ "TypeName CL0 St eps A\n(-) (-) (-) (-) (-)\n"
+ f"riser {' '.join(f'{v:g}' for v in s['wake'])}\n"
+ )
+ return text
+
+
+def mass(mstar: str) -> float:
+ """Mass per metre with the internal water, from the submerged weight of Table 1."""
+ return RHO * math.pi * DIAMETER**2 / 4.0 + WEIGHT[mstar] / GRAVITY
+
+
+def deck_files(
+ hset: str,
+ mstar: str,
+ direction: str,
+ u: float,
+ segments: int,
+ dt: float,
+ damping: bool,
+ friction: float = FRICTION,
+) -> dict[str, str]:
+ """The deck: End A the upper pin, End B the lower pin on the floor at x = 0; the current
+ along +x (positive: the upstream end on the floor) or -x (negative)."""
+ ux = DIRECTIONS[direction] * u
+ cl = " ".join(f"{v:g}" for v in SETS[hset]["cl"])
+ ei = f"{EI}|-{ZETA}|{RAYLEIGH[0]}|{RAYLEIGH[1]}" if damping else f"{EI}"
+ outs = ["FairTen1"] + [f"L1N{j}p{c}" for j in range(1, segments + 2) for c in "xyz"]
+ tmax = TMAX_NONE if hset == "none" else TMAX
+ deck = f"""--------------------- CableDyn Input File ---------------------------------
+Chaplin & King (2018) catenary riser, m* {mstar}, U {ux:+.2f} m/s, set {hset}
+----------------------- LINE TYPES ------------------------------------------
+TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t Cl dF cF
+(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-) (-) (-) (-)
+riser {DIAMETER} {mass(mstar):.6f} {EA:.6e} 0.0 {ei} {CD} 0.0 {CA} 0.0 {cl}
+----------------------- POINTS ----------------------------------------------
+ID Attachment X Y Z M V CdA CA
+(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
+1 Coupled {SPAN} 0.0 {TOP} 0 0 0 0
+2 Fixed 0.0 0.0 {-DEPTH} 0 0 0 0
+----------------------- LINES -----------------------------------------------
+ID LineType AttachA AttachB UnstrLen NumSegs Outputs
+(-) (-) (-) (-) (m) (-) (-)
+1 riser 1 2 {LENGTH} {segments} -
+{viv_sections(hset)}---------------------- OPTIONS ----------------------------------------------
+{RHO} rhoW
+{GRAVITY} g
+{DEPTH} WtrDpth
+{friction:g} frictionMu
+{dt:.6f} dtM
+{tmax:.6f} TMax
+2 Currents
+---------------------- OUTPUTS -----------------------------------------------
+{chr(10).join(outs)}
+END
+------------------------- need this line --------------------------------------
+"""
+ # a depth profile in time (Currents 2): uniform over the depth, zero at t = 0, U from RAMP
+ # on; the last row past the end of the run (the table repeats past its last sample)
+ profile = (
+ "Chaplin & King (2018) flume current\n"
+ "uniform over the depth, ramped from still water\n\n"
+ "depths (m)\n"
+ f"{-DEPTH - 0.5:.2f} 0.00\n"
+ "t (s), ux at each depth (m/s)\n"
+ + "".join(
+ f"{t:g} {v:.4f} {v:.4f}\n"
+ for t, v in (
+ (0.0, 0.0),
+ (RAMP, ux),
+ (RAMP * math.ceil(tmax / RAMP + 1.0), ux),
+ )
+ )
+ )
+ return {"ck.dat": deck, "current_profile_dynamic.txt": profile}
+
+
+def read_output(out: Path) -> tuple[list[str], np.ndarray]:
+ with open(out, encoding="utf-8") as fh:
+ fh.readline()
+ head = fh.readline().split()
+ fh.readline()
+ a = np.loadtxt(fh)
+ return head, a
+
+
+def stations() -> list[float]:
+ """Arc lengths from the upper pin of the twelve accelerometers: 0.4 m apart (Sec. 2), taken
+ as centred on the line (0.48 m from each pin; the article gives no positions)."""
+ first = 0.5 * (LENGTH - 11 * 0.4)
+ return [first + 0.4 * k for k in range(12)]
+
+
+def peak_frequency(y: np.ndarray, dt: float, power: int) -> float:
+ """The peak of the averaged spectrum (Hann segments of WELCH s, half overlapping) of y,
+ weighted by omega^power (4: the acceleration spectrum of a displacement), within its BAND."""
+ n = int(round(WELCH / dt))
+ win = np.hanning(n)
+ f = np.fft.rfftfreq(n, dt)
+ sp = np.zeros(len(f))
+ for k in range(0, len(y) - n + 1, n // 2):
+ seg = y[k : k + n] - y[k : k + n].mean()
+ sp += np.abs(np.fft.rfft(seg * win)) ** 2
+ sp *= (2.0 * np.pi * f) ** power
+ lo, hi = BAND[power]
+ m = (f >= lo) & (f <= hi)
+ return float(f[m][np.argmax(sp[m])])
+
+
+def highpassed_rms(y: np.ndarray, dt: float) -> float:
+ """r.m.s. of y above the lower edge of the displacement BAND (the vibration without the
+ slow sideways wandering)."""
+ f = np.fft.rfftfreq(len(y), dt)
+ sp = np.fft.rfft(y - y.mean())
+ sp[f < BAND[0][0]] = 0.0
+ return float(np.fft.irfft(sp, len(y)).std())
+
+
+def analyse(out: Path, hset: str, direction: str, u: float, segments: int) -> dict:
+ """Mean and standard deviation of the top tension; the mean profile; at each accelerometer
+ station and probe the cross-flow A/D_rms (all of it and above 0.3 Hz) and the peak
+ frequencies of its displacement and acceleration spectra; the inclination of the mean
+ profile at mid-depth."""
+ head, a = read_output(out)
+ t = a[:, 0]
+ dt = float(t[1] - t[0])
+ t0 = T0 if hset != "none" else T0_NONE
+ k = t > t0 + 1e-9
+ nodes = range(1, segments + 2)
+ col = {h: i for i, h in enumerate(head)}
+ ten = a[k, col["FairTen1"]]
+ xm = np.array([a[k, col[f"L1N{j}px"]].mean() for j in nodes])
+ zm = np.array([a[k, col[f"L1N{j}pz"]].mean() for j in nodes])
+ s0 = np.linspace(0.0, LENGTH, segments + 1) # unstretched arc length of each node
+ grounded = zm < -DEPTH + 0.01
+ res: dict = {
+ "mean_top_tension_N": float(ten.mean()),
+ "sd_top_tension_N": float(ten.std()),
+ "suspended_length_m": float(s0[~grounded].max()) if (~grounded).any() else 0.0,
+ "touchdown_x_m": float(xm[~grounded][-1]) if grounded.any() else None,
+ }
+ # inclination of the mean profile to the horizontal at mid-depth (z = -DEPTH/2)
+ j = int(np.argmin(np.abs(zm + 0.5 * DEPTH)))
+ dz = zm[j - 1] - zm[j + 1]
+ dx = abs(xm[j - 1] - xm[j + 1])
+ res["psi_mid_depth_deg"] = float(math.degrees(math.atan2(abs(dz), dx)))
+ res["x_mid_depth_m"] = float(xm[j])
+ st = []
+ for s in stations():
+ n = int(round(s / LENGTH * segments)) + 1
+ y = a[k, col[f"L1N{n}py"]]
+ row = {
+ "s_m": round(s, 3),
+ "node": n,
+ "x_m": float(xm[n - 1]),
+ "z_m": float(zm[n - 1]),
+ "suspended": bool(not grounded[n - 1]),
+ "AD_rms": float(y.std() / DIAMETER),
+ "AD_rms_above_0p3hz": highpassed_rms(y, dt) / DIAMETER,
+ }
+ if hset != "none":
+ row["f_acc_hz"] = peak_frequency(y, dt, 4)
+ row["f_disp_hz"] = peak_frequency(y, dt, 0)
+ st.append(row)
+ res["stations"] = st
+ for name, zp in PROBES.items():
+ free = np.where(~grounded)[0]
+ n = int(free[np.argmin(np.abs(zm[free] - zp))]) + 1
+ y = a[k, col[f"L1N{n}py"]]
+ p = {"node": n, "x_m": float(xm[n - 1]), "z_m": float(zm[n - 1])}
+ p["AD_rms"] = float(y.std() / DIAMETER)
+ p["AD_rms_above_0p3hz"] = highpassed_rms(y, dt) / DIAMETER
+ if hset != "none":
+ p["f_acc_hz"] = peak_frequency(y, dt, 4)
+ p["f_disp_hz"] = peak_frequency(y, dt, 0)
+ res[name] = p
+ res["frequency_resolution_hz"] = 1.0 / WELCH
+ res["steps"] = int(len(t))
+ return res
+
+
+def run_case(
+ exe: Path, folder: Path, files: dict, analyse_fn, key: str, keep: bool, sha: str
+) -> dict:
+ """Write the deck, run it and analyse it. A folder that holds the same input files run by
+ the same executable is not run again: its result is reused when the analysis key is also
+ the same, and its output is analysed again if it was kept."""
+ folder.mkdir(parents=True, exist_ok=True)
+ result, out, ran = (
+ folder / "result.json",
+ folder / "ck.out",
+ folder / "executable_sha256.txt",
+ )
+ same = all(
+ (folder / n).is_file() and (folder / n).read_text(encoding="utf-8") == v
+ for n, v in files.items()
+ )
+ if same and result.is_file():
+ old = json.loads(result.read_text(encoding="utf-8"))
+ if old.pop("reuse_key", None) == f"{sha}:{key}":
+ return old
+ if not (
+ same and out.is_file() and ran.is_file() and ran.read_text().strip() == sha
+ ):
+ # A run that fails or is interrupted must not leave the previous model's result next
+ # to the new inputs, where the next attempt would reuse it.
+ result.unlink(missing_ok=True)
+ ran.unlink(missing_ok=True)
+ out.unlink(missing_ok=True)
+ for n, v in files.items():
+ (folder / n).write_text(v, encoding="utf-8", newline="\n")
+ proc = subprocess.run(
+ [str(exe), "ck.dat", "ck"],
+ cwd=folder,
+ capture_output=True,
+ text=True,
+ encoding="utf-8",
+ errors="replace",
+ env=dict(os.environ, OMP_NUM_THREADS="1"),
+ check=False,
+ )
+ (folder / "console.txt").write_text(proc.stdout + proc.stderr, encoding="utf-8")
+ if proc.returncode != 0:
+ raise SystemExit(f"{folder}: CableDyn exited with {proc.returncode}")
+ ran.write_text(sha + "\n", encoding="utf-8")
+ res = analyse_fn(out)
+ result.write_text(
+ json.dumps({**res, "reuse_key": f"{sha}:{key}"}, indent=1) + "\n",
+ encoding="utf-8",
+ )
+ if not keep:
+ out.unlink()
+ return res
+
+
+# name -> (set, m*, direction, U, role, segments, dt, structural damping, floor friction)
+RUNS: dict[str, tuple] = {}
+for _m in WEIGHT:
+ RUNS[f"none_m{_m}_still"] = (
+ "none",
+ _m,
+ "pos",
+ 0.0,
+ "still water",
+ SEGMENTS,
+ DT,
+ True,
+ FRICTION,
+ )
+for _s in SETS:
+ for _m in WEIGHT:
+ for _d in DIRECTIONS:
+ for _u in SPEEDS:
+ RUNS[f"{_s}_m{_m}_{_d}{_u:g}"] = (
+ _s,
+ _m,
+ _d,
+ _u,
+ "primary",
+ SEGMENTS,
+ DT,
+ True,
+ FRICTION,
+ )
+CONVERGENCE = (("1.84", "pos", 0.8), ("1.12", "neg", 1.2))
+for _s in ("uls19", "b1", "wake"):
+ for _m, _d, _u in CONVERGENCE:
+ _base = f"{_s}_m{_m}_{_d}{_u:g}"
+ RUNS[_base + "_dt"] = (
+ _s,
+ _m,
+ _d,
+ _u,
+ "half the time step",
+ SEGMENTS,
+ DT / 2,
+ True,
+ FRICTION,
+ )
+ RUNS[_base + "_n108"] = (
+ _s,
+ _m,
+ _d,
+ _u,
+ "twice the elements",
+ 2 * SEGMENTS,
+ DT,
+ True,
+ FRICTION,
+ )
+for _s in ("uls19", "b1", "wake"):
+ for _m in WEIGHT:
+ for _d in DIRECTIONS:
+ for _u in (0.4, 0.8, 1.2):
+ _base = f"{_s}_m{_m}_{_d}{_u:g}"
+ RUNS[_base + "_undamped"] = (
+ _s,
+ _m,
+ _d,
+ _u,
+ "no structural damping",
+ SEGMENTS,
+ DT,
+ False,
+ FRICTION,
+ )
+ RUNS[_base + "_frictionless"] = (
+ _s,
+ _m,
+ _d,
+ _u,
+ "frictionless floor",
+ SEGMENTS,
+ DT,
+ True,
+ 0.0,
+ )
+
+
+def measured() -> dict:
+ """{(figure, m*): {U: [(value, sd), ...]}} of the extracted points (extract_chaplin2018.py)."""
+ data: dict = {}
+ with open(HERE / "measured_chaplin2018.csv", encoding="utf-8") as fh:
+ for r in csv.DictReader(fh):
+ key = (r["figure"], r["m_star"])
+ sd = float(r["sd"]) if r["sd"] else None
+ data.setdefault(key, {}).setdefault(round(float(r["U_mps"]), 2), []).append(
+ (float(r["value"]), sd)
+ )
+ return data
+
+
+def implied_cd(psi_deg: float, u: float, w: float) -> float | None:
+ """The drag coefficient of a straight line at the inclination psi by the article's Eq. 9,
+ 0.5 rho Cd d (U sin psi)^2 = W cos psi."""
+ p = math.radians(psi_deg)
+ if u <= 0.0 or p <= 0.0:
+ return None
+ return 2.0 * w * math.cos(p) / (RHO * DIAMETER * (u * math.sin(p)) ** 2)
+
+
+def rounded(x):
+ """Six significant digits, so the record does not carry the last bits of the arithmetic."""
+ if isinstance(x, float):
+ return float(f"{x:.6g}")
+ if isinstance(x, dict):
+ return {k: rounded(v) for k, v in x.items()}
+ if isinstance(x, list):
+ return [rounded(v) for v in x]
+ return x
+
+
+def fmt(value: float | None, spec: str = ".3f") -> str:
+ """A score for the console; n/a when the selection holds nothing for it."""
+ return "n/a" if value is None else format(value, spec)
+
+
+def nearest(values: list[float], v: float) -> float | None:
+ return min(values, key=lambda q: abs(q - v)) if values else None
+
+
+def compare_run(name: str, res: dict, meas: dict, still: dict) -> dict:
+ """One run against the measured points at its speed."""
+ hset, mstar, direction, u, role, segments, dt, damp, mu = RUNS[name]
+ fig_t = "10" if direction == "pos" else "13"
+ row: dict = {
+ "run": name,
+ "set": hset,
+ "role": role,
+ "m_star": mstar,
+ "direction": direction,
+ "U_mps": u,
+ "segments": segments,
+ "dt_s": dt,
+ "structural_damping": int(damp),
+ "floor_friction": mu,
+ "model_mean_T_N": res["mean_top_tension_N"],
+ "model_sd_T_N": res["sd_top_tension_N"],
+ "model_still_T_N": still[mstar],
+ }
+ t = meas.get((fig_t, mstar), {}).get(round(u, 2), [])
+ row["measured_mean_T_N"] = t[0][0] if t else None
+ row["measured_sd_T_N"] = t[0][1] if t else None
+ t0 = meas.get((fig_t, mstar), {}).get(0.0, [])
+ row["measured_still_T_N"] = t0[0][0] if t0 else None
+ row["model_psi_mid_depth_deg"] = res["psi_mid_depth_deg"]
+ row["model_cd_eq9"] = implied_cd(res["psi_mid_depth_deg"], u, WEIGHT[mstar])
+ p = meas.get(("12a", mstar), {}).get(round(u, 2), []) if direction == "neg" else []
+ row["measured_psi_deg"] = p[0][0] if p else None
+ row["measured_cd_eq9"] = implied_cd(p[0][0], u, WEIGHT[mstar]) if p else None
+ if hset != "none":
+ if direction == "pos":
+ probes = {"upper": ("upper_a", "upper_b"), "lower": ("lower",)}
+ figs = {"upper": "9a", "lower": "9b"}
+ else:
+ probes, figs = {"mid": ("mid_depth",)}, {"mid": "15a"}
+ for where, names in probes.items():
+ # the dominant frequency: the peak of the displacement spectrum (the article's
+ # acceleration and video-displacement peaks agree, its Fig. 4); the acceleration
+ # spectrum's peak as a second value
+ row[f"model_f_{where}_hz"] = float(
+ np.mean([res[q]["f_disp_hz"] for q in names])
+ )
+ row[f"model_f_acc_{where}_hz"] = float(
+ np.mean([res[q]["f_acc_hz"] for q in names])
+ )
+ pts = [
+ v for v, _ in meas.get((figs[where], mstar), {}).get(round(u, 2), [])
+ ]
+ row[f"measured_f_{where}_hz"] = ";".join(f"{v:.3f}" for v in sorted(pts))
+ row[f"nearest_measured_f_{where}_hz"] = nearest(
+ pts, row[f"model_f_{where}_hz"]
+ )
+ fs = [
+ s["f_disp_hz"] for s in res["stations"] if s["suspended"] and s["z_m"] < 0.0
+ ]
+ row["model_f_span_min_hz"] = min(fs) if fs else None
+ row["model_f_span_median_hz"] = float(np.median(fs)) if fs else None
+ row["model_f_span_max_hz"] = max(fs) if fs else None
+ row["model_AD_rms_max"] = max(s["AD_rms"] for s in res["stations"])
+ row["model_AD_rms_above_0p3hz_max"] = max(
+ s["AD_rms_above_0p3hz"] for s in res["stations"]
+ )
+ return row
+
+
+def scores(rows: list[dict]) -> dict:
+ """Scores of a set at one mass ratio and direction over the primary speeds."""
+ out: dict = {}
+ t = [
+ (r["model_mean_T_N"], r["measured_mean_T_N"])
+ for r in rows
+ if r["measured_mean_T_N"]
+ ]
+ if t:
+ e = np.array([m / x - 1.0 for m, x in t])
+ out["T_rms_rel_error"] = float(np.sqrt(np.mean(e**2)))
+ out["T_mean_rel_error"] = float(np.mean(e))
+ out["T_points"] = len(t)
+ inc = [
+ (
+ r["model_mean_T_N"] - r["model_still_T_N"],
+ r["measured_mean_T_N"] - r["measured_still_T_N"],
+ )
+ for r in rows
+ if r["measured_mean_T_N"] and r["measured_still_T_N"]
+ ]
+ if inc:
+ out["dT_rms_error_N"] = float(np.sqrt(np.mean([(m - x) ** 2 for m, x in inc])))
+ out["dT_mean_error_N"] = float(np.mean([m - x for m, x in inc]))
+ sd = [
+ r["model_sd_T_N"] / r["measured_sd_T_N"] for r in rows if r["measured_sd_T_N"]
+ ]
+ if sd:
+ out["sd_T_ratio_median"] = float(np.median(sd))
+ out["sd_T_points"] = len(sd)
+ psi = [
+ r["model_psi_mid_depth_deg"] - r["measured_psi_deg"]
+ for r in rows
+ if r["measured_psi_deg"] is not None
+ ]
+ if psi:
+ out["psi_rms_error_deg"] = float(np.sqrt(np.mean(np.square(psi))))
+ out["psi_mean_error_deg"] = float(np.mean(psi))
+ out["cd_eq9_model_median"] = float(
+ np.median([r["model_cd_eq9"] for r in rows if r["model_cd_eq9"]])
+ )
+ out["cd_eq9_measured_median"] = float(
+ np.median([r["measured_cd_eq9"] for r in rows if r["measured_cd_eq9"]])
+ )
+ for where in ("upper", "lower", "mid"):
+ k = f"model_f_{where}_hz"
+ if not rows or k not in rows[0]:
+ continue
+ # runs whose acceleration spectrum peaks at a higher harmonic of the displacement's
+ out[f"f_{where}_acc_peak_at_harmonic"] = int(
+ sum(r[f"model_f_acc_{where}_hz"] >= 1.5 * r[k] for r in rows)
+ )
+ out[f"f_{where}_model_fd_over_U_median"] = float(
+ np.median([r[k] * DIAMETER / r["U_mps"] for r in rows])
+ )
+ meas_fd = [
+ float(v) * DIAMETER / r["U_mps"]
+ for r in rows
+ for v in r[f"measured_f_{where}_hz"].split(";")
+ if v
+ ]
+ if meas_fd:
+ out[f"f_{where}_measured_fd_over_U_median"] = float(np.median(meas_fd))
+ out[f"f_{where}_measured_points"] = len(meas_fd)
+ if where == "mid":
+ # on the normal velocity U sin(psi) of the straight part (Fig. 15(b)): the model's
+ # inclination at mid-depth, the measured one of Fig. 12(a)
+ out["f_mid_model_fd_over_Un_median"] = float(
+ np.median(
+ [
+ r[k]
+ * DIAMETER
+ / (
+ r["U_mps"]
+ * math.sin(math.radians(r["model_psi_mid_depth_deg"]))
+ )
+ for r in rows
+ ]
+ )
+ )
+ mn = [
+ float(v)
+ * DIAMETER
+ / (r["U_mps"] * math.sin(math.radians(r["measured_psi_deg"])))
+ for r in rows
+ if r["measured_psi_deg"]
+ for v in r["measured_f_mid_hz"].split(";")
+ if v
+ ]
+ if mn:
+ out["f_mid_measured_fd_over_Un_median"] = float(np.median(mn))
+ sel = [r for r in rows if r[f"nearest_measured_f_{where}_hz"]]
+ if sel:
+ ratio = [r[k] / r[f"nearest_measured_f_{where}_hz"] for r in sel]
+ out[f"f_{where}_ratio_to_nearest_measured_median"] = float(np.median(ratio))
+ out[f"f_{where}_within_10pct"] = int(
+ sum(abs(q - 1.0) <= 0.1 for q in ratio)
+ )
+ out[f"f_{where}_points"] = len(sel)
+ sp = [
+ (r["model_f_span_max_hz"] - r["model_f_span_min_hz"])
+ / r["model_f_span_median_hz"]
+ for r in rows
+ if r.get("model_f_span_median_hz")
+ ]
+ if sp:
+ out["f_span_spread_median"] = float(np.median(sp))
+ return out
+
+
+def change(r: dict, base: dict) -> dict:
+ """Relative change of a sensitivity or convergence run from its primary run."""
+
+ def rel(k):
+ if r.get(k) is None or not base.get(k):
+ return None
+ return r[k] / base[k] - 1.0
+
+ ch = {
+ "role": r["role"],
+ "mean_T": rel("model_mean_T_N"),
+ "sd_T": rel("model_sd_T_N"),
+ }
+ ch["AD_rms_max"] = rel("model_AD_rms_max")
+ for w in ("upper", "lower", "mid"):
+ if f"model_f_{w}_hz" in r:
+ ch[f"f_{w}"] = rel(f"model_f_{w}_hz")
+ return ch
+
+
+def main() -> None:
+ ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
+ ap.add_argument("exe")
+ ap.add_argument("workdir")
+ ap.add_argument(
+ "--runs", default="all", help="comma list of run names (see RUNS), or all"
+ )
+ ap.add_argument("--jobs", type=int, default=os.cpu_count() or 1)
+ ap.add_argument("--keep", action="store_true", help="keep the output tables")
+ ap.add_argument(
+ "--summary",
+ default=None,
+ help="directory for the comparison CSV and summary JSON",
+ )
+ a = ap.parse_args()
+ found = a.exe if Path(a.exe).is_file() else shutil.which(a.exe)
+ if found is None:
+ raise SystemExit(f"CableDyn executable not found: {a.exe}")
+ exe = Path(found).resolve()
+ sha = hashlib.sha256(exe.read_bytes()).hexdigest()
+ names = (
+ list(RUNS)
+ if a.runs == "all"
+ else [n.strip() for n in a.runs.split(",") if n.strip()]
+ )
+ if not names or any(n not in RUNS for n in names):
+ raise SystemExit(f"--runs: choose from {', '.join(RUNS)}, got {a.runs!r}")
+ # the still-water runs are the reference of the tension increments: always run
+ names = [n for n in RUNS if n.endswith("_still") and n not in names] + names
+ work = Path(a.workdir).resolve()
+
+ def one(name: str) -> dict:
+ hset, mstar, direction, u, _, segments, dt, damp, mu = RUNS[name]
+ folder = work / (
+ f"{hset}_m{mstar}_{direction}{u:g}_n{segments}_dt{dt:g}_mu{mu:g}"
+ + ("" if damp else "_undamped")
+ )
+ return run_case(
+ exe,
+ folder,
+ deck_files(hset, mstar, direction, u, segments, dt, damp, mu),
+ lambda out: analyse(out, hset, direction, u, segments),
+ f"{segments}:{ANALYSIS}",
+ a.keep,
+ sha,
+ )
+
+ with ThreadPoolExecutor(max_workers=max(1, min(a.jobs, len(names)))) as pool:
+ results = dict(zip(names, pool.map(one, names), strict=True))
+
+ meas = measured()
+ still = {
+ RUNS[n][1]: results[n]["mean_top_tension_N"]
+ for n in results
+ if n.endswith("_still")
+ }
+ rows = [compare_run(n, results[n], meas, still) for n in RUNS if n in results]
+ by = {r["run"]: r for r in rows}
+ groups: dict = {}
+ for r in rows:
+ if r["role"] == "primary":
+ groups.setdefault(f"{r['set']}_m{r['m_star']}_{r['direction']}", []).append(
+ r
+ )
+ summary_scores = {k: scores(v) for k, v in groups.items()}
+ for k, sc in summary_scores.items():
+ freq = "; ".join(
+ f"f_{w} fd/U {fmt(sc.get(f'f_{w}_model_fd_over_U_median'))} [nearest measured "
+ f"ratio {fmt(sc.get(f'f_{w}_ratio_to_nearest_measured_median'), '.2f')}]"
+ for w in ("upper", "lower", "mid")
+ if f"f_{w}_model_fd_over_U_median" in sc
+ )
+ print(
+ f"{k:18s} T r.m.s. rel. error {fmt(sc.get('T_rms_rel_error'))} "
+ f"(mean {fmt(sc.get('T_mean_rel_error'), '+.3f')}); increment r.m.s. "
+ f"{fmt(sc.get('dT_rms_error_N'), '.2f')} N; sd ratio "
+ f"{fmt(sc.get('sd_T_ratio_median'), '.2f')}; {freq}"
+ )
+ changes = {
+ r["run"]: change(r, by[r["run"].rsplit("_", 1)[0]])
+ for r in rows
+ if r["role"] not in ("primary", "still water")
+ and r["run"].rsplit("_", 1)[0] in by
+ }
+ summary = rounded(
+ {
+ "sets": {k: v["label"] for k, v in SETS.items()},
+ "model": {
+ "length_m": LENGTH,
+ "diameter_m": DIAMETER,
+ "EI_Nm2": EI,
+ "EA_N": EA,
+ "mass_kg_per_m": {m: mass(m) for m in WEIGHT},
+ "submerged_weight_N_per_m": WEIGHT,
+ "rayleigh_damping": {
+ "zeta": ZETA,
+ "f1_hz": RAYLEIGH[0],
+ "f2_hz": RAYLEIGH[1],
+ },
+ "floor_friction": FRICTION,
+ "segments": SEGMENTS,
+ "dt_s": DT,
+ "tmax_s": TMAX,
+ "statistics_from_s": T0,
+ "current_ramp_s": RAMP,
+ "welch_segment_s": WELCH,
+ "probe_elevations_m": PROBES,
+ },
+ "still_water_top_tension_N": {
+ m: {
+ "model": still[m],
+ "measured_fig10": meas.get(("10", m), {}).get(0.0, [(None,)])[0][0],
+ "measured_fig13": meas.get(("13", m), {}).get(0.0, [(None,)])[0][0],
+ }
+ for m in still
+ },
+ "scores": summary_scores,
+ "sensitivity_and_convergence": changes,
+ "executable_sha256": sha,
+ }
+ )
+ if a.summary:
+ out = Path(a.summary)
+ out.mkdir(parents=True, exist_ok=True)
+ fields = list(dict.fromkeys(k for r in rows for k in r))
+
+ def cell(v):
+ if v is None:
+ return ""
+ if isinstance(v, float):
+ return f"{v:.6g}"
+ return v
+
+ with open(
+ out / "response_comparison.csv", "w", newline="", encoding="utf-8"
+ ) as fh:
+ w = csv.DictWriter(fh, fieldnames=fields, lineterminator="\n")
+ w.writeheader()
+ for r in rows:
+ w.writerow({k: cell(r.get(k)) for k in fields})
+ (out / "summary.json").write_text(
+ json.dumps(summary, indent=2) + "\n", encoding="utf-8", newline="\n"
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/validation/experiments/chaplin_catenary/extract_chaplin2018.py b/validation/experiments/chaplin_catenary/extract_chaplin2018.py
new file mode 100644
index 00000000..201d534e
--- /dev/null
+++ b/validation/experiments/chaplin_catenary/extract_chaplin2018.py
@@ -0,0 +1,493 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+"""Read the measured points of Chaplin & King (2018), Figs. 9, 10, 12(a), 13 and 15(a), from the PDF.
+
+The figures are embedded greyscale raster images. Each panel is calibrated on its plot frame and
+its tick marks: the frame's left and bottom lines are the zero of each axis (printed there), the
+marks found on both opposite sides of the frame give the tick spacing (a mark on one side only,
+or a reference line drawn across the frame, is not a tick), and the axis is the least-squares
+line through the origin and the ticks; its largest residual is reported.
+
+The markers are circles of one radius per kind (open, m* 1.12; solid, m* 1.84). Each is a peak of
+the share of dark pixels among the dark and white ones on a circle about the point (a circle
+Hough transform: grey pixels, an error bar drawn over the outline, count neither way), classed
+by the share of dark pixels inside it (less its centre column, where a frame line can pass) as
+solid or open; one between the classes is reported and dropped, and so is a peak off the
+0.05 m/s grid of the tested speeds by more than a quarter step (two overlapping markers make
+such a peak). A marker hidden under another is lost. The speeds are snapped to the grid.
+
+The error bars of Figs. 10 and 13 (one standard deviation of the top tension each way) end in
+caps, grey rows at least a marker radius wide through the marker's column: the bar is the
+nearest pair of caps about equally far above and below the marker, its half-length the
+standard deviation and its centre the mean (the bar is drawn about it). A bar hidden by its
+marker (shorter than the radius), or among the overlapping bars of the two series, is not read
+(`sd` blank). Two lines drawn in the figures check the reading: f d/U = 0.11 in Fig. 9 (read
+where no marker or tick is near it) and the total submerged weight times the water depth, W h,
+in Fig. 13 (Table 1: 41.8 and 5.8 N).
+
+ python extract_chaplin2018.py CHAPLIN2018.pdf [--out measured_chaplin2018.csv] [--check DIR]
+
+Source:
+ J.R. Chaplin, R. King (2018), Laboratory measurements of the vortex-induced vibrations of an
+ untensioned catenary riser with high curvature, Journal of Fluids and Structures 79, 26-38,
+ https://doi.org/10.1016/j.jfluidstructs.2018.01.008 (Figs. 9, 10, 12, 13 and 15)
+"""
+
+from __future__ import annotations
+
+import argparse
+import csv
+import io
+import json
+from pathlib import Path
+
+import numpy as np
+import pymupdf
+from PIL import Image, ImageDraw
+from scipy import ndimage
+
+HERE = Path(__file__).resolve().parent
+U_GRID = 0.05 # m/s, the speed step of the tests
+DIAMETER = 0.056 # m (Table 1), for the slope of the line f d/U = 0.11 in Fig. 9
+DEPTH = 2.0 # m (Table 1), for the lines W h in Fig. 13
+
+# Panel: figure label, page index (from 0), image index on the page, panel (0 the left frame, 1
+# the right), quantity, current direction, the point on the riser, x and y tick steps, the grey
+# level below which a pixel is dark, marker radii (open, solid) in pixels, masked boxes
+# (x0, y0, x1, y1) in pixels (insets, legends, panel labels, notes), and the grey levels of the
+# error bars or None.
+PANELS = (
+ {
+ "figure": "9a",
+ "page": 8,
+ "image": 1,
+ "panel": 0,
+ "quantity": "f_cf_hz",
+ "current": "positive",
+ "where": "upper (two points of the inset)",
+ "x_step": 0.25,
+ "y_step": 0.5,
+ "black": 128,
+ "radius": (7.5, 7.5),
+ "masks": ((150, 18, 340, 125), (265, 312, 470, 378), (455, 325, 516, 380)),
+ "bars": None,
+ },
+ {
+ "figure": "9b",
+ "page": 8,
+ "image": 1,
+ "panel": 1,
+ "quantity": "f_cf_hz",
+ "current": "positive",
+ "where": "lower (the point of the inset)",
+ "x_step": 0.25,
+ "y_step": 0.5,
+ "black": 128,
+ "radius": (7.5, 7.5),
+ "masks": ((585, 18, 790, 125), (655, 318, 880, 378), (890, 325, 951, 380)),
+ "bars": None,
+ },
+ {
+ "figure": "10",
+ "page": 8,
+ "image": 2,
+ "panel": 0,
+ "quantity": "mean_top_tension_N",
+ "current": "positive",
+ "where": "top",
+ "x_step": 0.25,
+ "y_step": 50.0,
+ "black": 70,
+ "radius": (9.5, 9.5),
+ "masks": (),
+ "bars": (75, 140),
+ },
+ {
+ "figure": "12a",
+ "page": 9,
+ "image": 3,
+ "panel": 0,
+ "quantity": "psi_deg",
+ "current": "negative",
+ "where": "straight part",
+ "x_step": 0.25,
+ "y_step": 15.0,
+ "black": 128,
+ "radius": (7.0, 7.0),
+ "masks": ((330, 8, 556, 120), (142, 270, 200, 328)),
+ "bars": None,
+ },
+ {
+ "figure": "13",
+ "page": 10,
+ "image": 0,
+ "panel": 0,
+ "quantity": "mean_top_tension_N",
+ "current": "negative",
+ "where": "top",
+ "x_step": 0.25,
+ "y_step": 25.0,
+ "black": 110,
+ "radius": (10.0, 10.0),
+ "masks": ((390, 40, 720, 160),),
+ "bars": (140, 225),
+ },
+ {
+ "figure": "15a",
+ "page": 11,
+ "image": 0,
+ "panel": 0,
+ "quantity": "f_cf_hz",
+ "current": "negative",
+ "where": "around mid-depth",
+ "x_step": 0.4,
+ "y_step": 0.5,
+ "black": 128,
+ "radius": (7.5, 4.5),
+ "masks": ((165, 17, 225, 70),),
+ "bars": None,
+ },
+)
+
+
+def image(doc, page: int, index: int) -> np.ndarray:
+ xref = doc[page].get_images(full=True)[index][0]
+ return np.asarray(
+ Image.open(io.BytesIO(doc.extract_image(xref)["image"])).convert("L")
+ ).astype(int)
+
+
+def groups(idx: np.ndarray) -> list[float]:
+ if not len(idx):
+ return []
+ return [float(g.mean()) for g in np.split(idx, np.where(np.diff(idx) > 1)[0] + 1)]
+
+
+def frames(dark: np.ndarray) -> list[tuple[float, float, float, float]]:
+ """The plot frames of the image, left to right: (left, right, top, bottom) centre lines."""
+ h, w = dark.shape
+ rows = groups(np.where(dark.sum(axis=1) > 0.35 * w)[0])
+ top, bottom = rows[0], rows[-1]
+ t, b = int(top) + 3, int(bottom) - 2
+ cols = groups(np.where(dark[t:b].sum(axis=0) > 0.9 * (b - t))[0])
+ return [(cols[i], cols[i + 1], top, bottom) for i in range(0, len(cols) - 1, 2)]
+
+
+def axis(
+ dark: np.ndarray, frame: tuple, horizontal: bool, step: float
+) -> tuple[float, float, float, int]:
+ """Origin pixel and pixels per unit of one axis from the frame and its tick marks, the
+ largest residual of the ticks (in axis units) and their number."""
+ left, right, top, bottom = (int(round(v)) for v in frame)
+ if horizontal:
+ near = groups(
+ np.where(dark[bottom - 13 : bottom - 3, left + 4 : right - 3].sum(0) >= 7)[
+ 0
+ ]
+ + left
+ + 4
+ )
+ far = groups(
+ np.where(dark[top + 3 : top + 13, left + 4 : right - 3].sum(0) >= 7)[0]
+ + left
+ + 4
+ )
+ origin = frame[0]
+ else:
+ near = groups(
+ np.where(dark[top + 4 : bottom - 3, left + 3 : left + 13].sum(1) >= 7)[0]
+ + top
+ + 4
+ )
+ far = groups(
+ np.where(dark[top + 4 : bottom - 3, right - 13 : right - 3].sum(1) >= 7)[0]
+ + top
+ + 4
+ )
+ origin = frame[3]
+ ticks = [p for p in near if any(abs(p - q) <= 1.5 for q in far)]
+ # the spacing that puts marks on the most whole steps from the origin, less the steps
+ # without a mark (a reference line drawn across the frame is not on a step)
+ cands = [abs(p - origin) / k for p in ticks for k in range(1, 11)]
+
+ def score(s: float) -> int:
+ steps = [abs(p - origin) / s for p in ticks]
+ on = {round(k) for k in steps if abs(k - round(k)) < 0.1 and round(k) > 0}
+ return 2 * len(on) - max(on, default=0)
+
+ spacing = max(cands, key=lambda s: (score(s), s))
+ pix, val = [origin], [0.0]
+ for p in ticks:
+ k = (p - origin) / spacing * (1 if horizontal else -1)
+ if abs(k - round(k)) < 0.15 and round(k) > 0:
+ pix.append(p)
+ val.append(round(k) * step)
+ slope, icept = np.polyfit(val, pix, 1)
+ resid = max(abs((p - icept) / slope - v) for p, v in zip(pix, val, strict=True))
+ return icept, slope, float(resid), len(pix) - 1
+
+
+def ring_votes(black: np.ndarray, white: np.ndarray, radius: float) -> np.ndarray:
+ """The share of dark pixels among the dark and white ones on the circle of the radius about
+ each pixel (a grey pixel, an error bar drawn over the outline, is no evidence either way);
+ zero where under half the circle is dark or white."""
+ h, w = black.shape
+ pad = int(radius) + 3
+ pb, pw = np.pad(black.astype(float), pad), np.pad(white.astype(float), pad)
+ ang = np.linspace(0.0, 2.0 * np.pi, 96, endpoint=False)
+ offs = {(round(radius * np.sin(a)), round(radius * np.cos(a))) for a in ang}
+ nb, nw = np.zeros((h, w)), np.zeros((h, w))
+ for dy, dx in offs:
+ nb += pb[pad + dy : pad + dy + h, pad + dx : pad + dx + w]
+ nw += pw[pad + dy : pad + dy + h, pad + dx : pad + dx + w]
+ seen = nb + nw
+ return np.where(seen >= 0.5 * len(offs), nb / np.maximum(seen, 1.0), 0.0)
+
+
+def disc_fill(black: np.ndarray, white: np.ndarray, radius: float) -> np.ndarray:
+ """The share of dark pixels among the dark and white ones in the disc of the radius, less
+ its centre column on a large disc (where a frame line passes through a marker)."""
+ r = int(np.ceil(radius))
+ yy, xx = np.mgrid[-r : r + 1, -r : r + 1]
+ k = (
+ (xx * xx + yy * yy <= radius * radius)
+ & (np.abs(xx) > (2 if radius > 4.0 else -1))
+ ).astype(float)
+ nb = ndimage.convolve(black.astype(float), k, mode="constant")
+ nw = ndimage.convolve(white.astype(float), k, mode="constant")
+ return nb / np.maximum(nb + nw, 1.0)
+
+
+def markers(
+ black: np.ndarray, white: np.ndarray, r_open: float, r_solid: float, vote: float
+) -> list[tuple]:
+ """(x, y, kind, ring share, fill share) of the circles found: a peak of the share of dark
+ pixels on the circle (the largest of four radii, the outline being anti-aliased), classed
+ by the share of dark pixels inside it."""
+ found = []
+ for kind, r in (("open", r_open), ("solid", r_solid)):
+ v = np.max(
+ [ring_votes(black, white, r - d) for d in (0.0, 0.5, 1.0, 1.5)], axis=0
+ )
+ fill = disc_fill(black, white, max(r - 4.0, 1.5) if kind == "open" else r - 2.0)
+ size = int(2 * round(0.7 * r) + 1)
+ peak = (v == ndimage.maximum_filter(v, size=size)) & (v >= vote)
+ for y, x in zip(*np.where(peak), strict=True):
+ f = float(fill[y, x])
+ if kind == "open" and r_open == r_solid:
+ k = "solid" if f > 0.7 else ("open" if f < 0.3 else "unclassified")
+ elif kind == "open":
+ k = "open" if f < 0.3 else None
+ else:
+ k = "solid" if f > 0.7 else None
+ if k:
+ found.append((float(x), float(y), k, float(v[y, x]), f))
+ if r_open == r_solid:
+ break
+ # one marker per cluster of peaks (a plateau or an anti-aliased edge gives several)
+ found.sort(key=lambda m: -m[3])
+ out: list[tuple] = []
+ for m in found:
+ r = r_open if m[2] == "open" else r_solid
+ if all((m[0] - o[0]) ** 2 + (m[1] - o[1]) ** 2 > (0.9 * r) ** 2 for o in out):
+ out.append(m)
+ return out
+
+
+def error_bar(
+ grey: np.ndarray, x: float, y: float, r: float
+) -> tuple[float, float] | None:
+ """The centre row and half-length in pixels of the error bar of the marker at (x, y), or
+ None when the bar is hidden by the marker.
+
+ The bar ends in caps, grey rows at least a marker radius wide through the marker's column;
+ the bar is the nearest pair of caps about equally far (within half a radius) above and below
+ the marker's centre. The bar is drawn about the mean, so its centre refines the marker's."""
+ c = int(round(x))
+ caps = []
+ for row in range(grey.shape[0]):
+ if not grey[row, c - 1 : c + 2].any():
+ continue
+ a = b = c
+ while a > 0 and grey[row, a - 1]:
+ a -= 1
+ while b < grey.shape[1] - 1 and grey[row, b + 1]:
+ b += 1
+ if b - a + 1 >= r:
+ caps.append(row)
+ centres = groups(np.array(caps, dtype=int))
+ pairs = [
+ (0.5 * (d - u), 0.5 * (u + d))
+ for u in centres
+ if u < y
+ for d in centres
+ if d > y and abs((y - u) - (d - y)) <= 0.5 * r
+ ]
+ return min(pairs, key=lambda q: q[0])[::-1] if pairs else None
+
+
+def extract(pdf: Path, check: Path | None) -> tuple[list[dict], dict]:
+ doc = pymupdf.open(pdf)
+ rows, report = [], {}
+ for p in PANELS:
+ g = image(doc, p["page"], p["image"])
+ dark = g < 110
+ fr = frames(dark)[p["panel"]]
+ x0, sx, rx, nx = axis(dark, fr, True, p["x_step"])
+ y0, sy, ry, ny = axis(dark, fr, False, p["y_step"])
+ black = g < p["black"]
+ left, right, top, bottom = (int(round(v)) for v in fr)
+ inner = np.zeros_like(black)
+ inner[top + 3 : bottom - 2, left - 12 : right + 12] = True
+ if p["figure"] not in ("10", "13"): # no marker on the side lines
+ inner[:, : left + 3] = False
+ inner[:, right - 2 :] = False
+ for a, b, c, d in p["masks"]:
+ inner[b:d, a:c] = False
+ black &= inner
+ white = (g > 215) & inner
+ # reference lines drawn across the frame are no evidence for or against a marker
+ h, w = g.shape
+ for q in groups(np.where(dark.sum(axis=1) > 0.35 * w)[0])[1:-1]:
+ black[int(q) - 2 : int(q) + 3] = False
+ white[int(q) - 2 : int(q) + 3] = False
+ found = markers(black, white, *p["radius"], p.get("vote", 0.8))
+ grey = None
+ if p["bars"]:
+ lo, hi = p["bars"]
+ grey = (g >= lo) & (g <= hi) & inner
+ snaps, dropped, off_grid, shifts, panel_rows = [], [], [], [], []
+ for x, y, kind, vote, fill in sorted(found):
+ u = (x - x0) / sx
+ val = (y - y0) / sy
+ ug = round(u / U_GRID) * U_GRID
+ if kind == "unclassified":
+ dropped.append(
+ {"U": round(u, 3), "value": round(val, 3), "fill": round(fill, 2)}
+ )
+ continue
+ if abs(u - ug) > 0.25 * U_GRID: # between two tested speeds: not a marker
+ off_grid.append(
+ {"U": round(u, 3), "value": round(val, 3), "kind": kind}
+ )
+ continue
+ snaps.append(abs(u - ug))
+ row = {
+ "figure": p["figure"],
+ "quantity": p["quantity"],
+ "current": p["current"],
+ "where": p["where"],
+ "m_star": "1.84" if kind == "solid" else "1.12",
+ "U_mps": f"{ug:.2f}",
+ "value": round(float(val), 4),
+ "sd": "",
+ }
+ bar = None if grey is None else error_bar(grey, x, y, p["radius"][0])
+ if bar is not None:
+ shifts.append(abs(bar[0] - y))
+ row["value"] = round(float((bar[0] - y0) / sy), 4)
+ row["sd"] = round(abs(bar[1] / sy), 3)
+ panel_rows.append(row)
+ panel_rows.sort(key=lambda q: (q["m_star"], float(q["U_mps"]), q["value"]))
+ rows += panel_rows
+ anchor = {}
+ if p["figure"] in ("9a", "9b"):
+ # the line f = 0.11 U/d drawn in the panel, read where no marker or tick mark is
+ # near it (below the markers, and in (b) above them at the higher speeds), as the
+ # slope through the origin
+ us, fs = [], []
+ for c in range(left + 4, right - 3):
+ u = (c - x0) / sx
+ if not (
+ 0.07 <= u <= 0.15 or (p["figure"] == "9b" and 1.1 <= u <= 1.45)
+ ):
+ continue
+ rr = np.where(dark[top + 14 : bottom - 14, c])[0] + top + 14
+ if len(rr) and np.ptp(rr) < 6:
+ us.append(u)
+ fs.append((float(np.mean(rr)) - y0) / sy)
+ us_a, fs_a = np.array(us), np.array(fs)
+ anchor = {
+ "line_fd_over_U": round(
+ float(us_a @ fs_a / (us_a @ us_a)) * DIAMETER, 4
+ ),
+ "line_columns": len(us),
+ "stated": 0.11,
+ }
+ if p["figure"] == "13":
+ # the lines of the total submerged weight times the water depth, W h
+ h, w = g.shape
+ lines = groups(np.where(dark.sum(axis=1) > 0.35 * w)[0])[1:-1]
+ anchor = {
+ "W_h_lines_N": [round(float((q - y0) / sy), 3) for q in lines],
+ "table_1_W_h_N": [round(wt * DEPTH, 3) for wt in (20.9, 2.9)],
+ }
+ report[p["figure"]] = {
+ **({"anchor": anchor} if anchor else {}),
+ "x_ticks": nx,
+ "x_residual": round(rx, 4),
+ "y_ticks": ny,
+ "y_residual": round(ry, 4),
+ "points": {
+ m: int(sum(q["m_star"] == m for q in panel_rows))
+ for m in ("1.12", "1.84")
+ },
+ "sd_read": {
+ m: int(sum(q["m_star"] == m and q["sd"] != "" for q in panel_rows))
+ for m in ("1.12", "1.84")
+ }
+ if grey is not None
+ else None,
+ "unclassified": dropped,
+ "off_grid": off_grid,
+ "largest_U_snap": round(max(snaps), 4) if snaps else None,
+ "largest_bar_centre_shift": round(max(shifts) / abs(sy), 4)
+ if shifts
+ else None,
+ }
+ if check is not None:
+ check.mkdir(parents=True, exist_ok=True)
+ vis = Image.fromarray(g.astype(np.uint8)).convert("RGB")
+ dr = ImageDraw.Draw(vis)
+ for x, y, kind, _v, _f in found:
+ r = p["radius"][0] if kind == "open" else p["radius"][1]
+ col = {"open": (0, 90, 255), "solid": (230, 0, 0)}.get(
+ kind, (255, 160, 0)
+ )
+ dr.ellipse((x - r, y - r, x + r, y + r), outline=col, width=2)
+ bar = None if grey is None else error_bar(grey, x, y, p["radius"][0])
+ if bar is not None:
+ yc, half = bar
+ dr.line(
+ (x + 3, yc - half, x + 3, yc + half), fill=(0, 180, 0), width=1
+ )
+ for k in range(0, 40):
+ xx = x0 + k * p["x_step"] * sx
+ if left - 1 <= xx <= right + 1:
+ dr.line((xx, bottom - 20, xx, bottom), fill=(255, 0, 255))
+ yy = y0 + k * p["y_step"] * sy
+ if top - 1 <= yy <= bottom + 1:
+ dr.line((left, yy, left + 20, yy), fill=(255, 0, 255))
+ vis.save(check / f"fig{p['figure']}_check.png")
+ return rows, report
+
+
+def main() -> None:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("pdf", type=Path)
+ ap.add_argument("--out", type=Path, default=HERE / "measured_chaplin2018.csv")
+ ap.add_argument(
+ "--check", type=Path, help="write the markers found over each figure into DIR"
+ )
+ a = ap.parse_args()
+ rows, report = extract(a.pdf, a.check)
+ with open(a.out, "w", encoding="utf-8", newline="\n") as fh:
+ w = csv.DictWriter(fh, fieldnames=list(rows[0]), lineterminator="\n")
+ w.writeheader()
+ w.writerows(rows)
+ print(json.dumps(report, indent=1))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/validation/experiments/chaplin_catenary/measured_chaplin2018.csv b/validation/experiments/chaplin_catenary/measured_chaplin2018.csv
new file mode 100644
index 00000000..490d2c74
--- /dev/null
+++ b/validation/experiments/chaplin_catenary/measured_chaplin2018.csv
@@ -0,0 +1,328 @@
+figure,quantity,current,where,m_star,U_mps,value,sd
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,0.25,0.6065,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,0.30,0.8144,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,0.35,0.8944,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,0.40,0.8064,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,0.50,1.1104,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,0.55,1.1424,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,1.20,2.1183,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,1.20,2.3503,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,1.25,2.4383,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,1.35,2.2703,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,1.35,2.5503,
+9a,f_cf_hz,positive,upper (two points of the inset),1.12,1.40,2.3023,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.25,0.5425,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.30,0.6625,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.30,0.7184,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.35,0.7504,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.35,0.9984,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.40,0.9504,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.40,1.0064,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.45,0.9024,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.45,0.9584,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.45,1.0944,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.50,0.9824,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.55,1.0464,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.60,1.2784,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.60,1.3344,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.65,1.3504,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.70,1.3904,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.70,1.4464,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.75,1.4544,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.75,1.5424,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.80,1.5824,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.80,1.6384,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.80,1.6944,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.85,1.7743,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.90,1.7344,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.90,1.8223,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,0.95,1.9423,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.00,1.9583,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.00,2.0143,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.05,2.0463,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.10,2.0463,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.15,2.1503,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.15,2.2063,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.20,2.2783,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.25,2.2943,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.30,2.3103,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.30,2.4223,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.30,2.4863,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.35,2.4943,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.40,2.4543,
+9a,f_cf_hz,positive,upper (two points of the inset),1.84,1.40,2.5743,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.20,0.5268,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.45,0.9097,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.50,0.8698,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.60,0.9894,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.65,0.9575,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.65,1.3883,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.70,1.125,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.75,1.2527,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.75,1.5637,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.80,1.2766,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.85,1.2925,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.90,1.5717,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,0.95,1.6515,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.00,1.6435,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.05,1.6993,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.10,1.7472,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.15,1.6515,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.20,1.7392,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.25,1.6674,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.30,1.6993,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.35,1.7791,
+9b,f_cf_hz,positive,lower (the point of the inset),1.12,1.40,1.811,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.25,0.5826,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.30,0.6784,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.35,0.798,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.40,0.8219,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.45,0.7661,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.50,0.9815,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.55,1.0453,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.60,0.6704,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.60,1.2846,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.65,0.7182,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.65,1.3165,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.70,0.7023,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.70,1.4042,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.70,1.46,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.75,0.6624,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.75,1.5079,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.80,0.8219,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.80,1.6116,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.85,0.7661,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.85,1.7312,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.90,0.7661,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.90,1.827,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.95,0.9416,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,0.95,1.8429,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.00,0.8299,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.00,1.9466,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.05,1.9147,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.10,1.9945,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.15,2.0104,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.20,2.0503,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.25,2.146,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.30,2.2337,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.35,2.2816,
+9b,f_cf_hz,positive,lower (the point of the inset),1.84,1.40,2.3454,
+10,mean_top_tension_N,positive,top,1.12,0.00,13.3836,
+10,mean_top_tension_N,positive,top,1.12,0.20,15.2686,
+10,mean_top_tension_N,positive,top,1.12,0.25,16.2111,1.178
+10,mean_top_tension_N,positive,top,1.12,0.30,17.6249,1.414
+10,mean_top_tension_N,positive,top,1.12,0.35,19.5099,1.885
+10,mean_top_tension_N,positive,top,1.12,0.40,21.3949,2.356
+10,mean_top_tension_N,positive,top,1.12,0.45,23.5156,2.592
+10,mean_top_tension_N,positive,top,1.12,0.50,25.8718,3.534
+10,mean_top_tension_N,positive,top,1.12,0.55,28.5815,3.417
+10,mean_top_tension_N,positive,top,1.12,0.60,31.5269,4.477
+10,mean_top_tension_N,positive,top,1.12,0.65,34.59,5.184
+10,mean_top_tension_N,positive,top,1.12,0.70,36.9463,6.126
+10,mean_top_tension_N,positive,top,1.12,0.75,40.9519,7.304
+10,mean_top_tension_N,positive,top,1.12,0.80,45.311,7.893
+10,mean_top_tension_N,positive,top,1.12,0.85,49.0811,8.6
+10,mean_top_tension_N,positive,top,1.12,0.90,53.2045,10.132
+10,mean_top_tension_N,positive,top,1.12,0.95,56.3855,11.192
+10,mean_top_tension_N,positive,top,1.12,1.00,60.7446,12.017
+10,mean_top_tension_N,positive,top,1.12,1.05,65.9284,13.431
+10,mean_top_tension_N,positive,top,1.12,1.10,69.2271,14.373
+10,mean_top_tension_N,positive,top,1.12,1.15,75.1178,16.023
+10,mean_top_tension_N,positive,top,1.12,1.20,80.1838,16.612
+10,mean_top_tension_N,positive,top,1.12,1.25,85.4854,17.908
+10,mean_top_tension_N,positive,top,1.12,1.30,90.9048,18.615
+10,mean_top_tension_N,positive,top,1.12,1.35,96.7955,20.264
+10,mean_top_tension_N,positive,top,1.12,1.40,101.9793,21.678
+10,mean_top_tension_N,positive,top,1.84,0.00,59.0952,
+10,mean_top_tension_N,positive,top,1.84,0.20,67.1065,
+10,mean_top_tension_N,positive,top,1.84,0.25,66.9887,1.06
+10,mean_top_tension_N,positive,top,1.84,0.30,68.2846,1.178
+10,mean_top_tension_N,positive,top,1.84,0.35,69.934,1.414
+10,mean_top_tension_N,positive,top,1.84,0.40,71.1122,1.885
+10,mean_top_tension_N,positive,top,1.84,0.45,73.5862,2.945
+10,mean_top_tension_N,positive,top,1.84,0.60,82.6579,5.655
+10,mean_top_tension_N,positive,top,1.84,0.65,85.9566,6.598
+10,mean_top_tension_N,positive,top,1.84,0.70,89.0198,6.833
+10,mean_top_tension_N,positive,top,1.84,0.75,93.968,8.483
+10,mean_top_tension_N,positive,top,1.84,0.80,95.7352,9.072
+10,mean_top_tension_N,positive,top,1.84,0.85,100.8011,10.132
+10,mean_top_tension_N,positive,top,1.84,0.90,104.8068,11.781
+10,mean_top_tension_N,positive,top,1.84,0.95,109.0481,12.253
+10,mean_top_tension_N,positive,top,1.84,1.00,111.8756,13.195
+10,mean_top_tension_N,positive,top,1.84,1.05,119.8869,14.609
+10,mean_top_tension_N,positive,top,1.84,1.10,123.8926,16.258
+10,mean_top_tension_N,positive,top,1.84,1.15,126.7201,16.258
+10,mean_top_tension_N,positive,top,1.84,1.20,133.082,18.379
+10,mean_top_tension_N,positive,top,1.84,1.25,138.9727,20.971
+10,mean_top_tension_N,positive,top,1.84,1.30,144.0386,19.675
+10,mean_top_tension_N,positive,top,1.84,1.35,150.8718,23.68
+10,mean_top_tension_N,positive,top,1.84,1.40,154.8775,23.68
+12a,psi_deg,negative,straight part,1.12,0.25,56.599,
+12a,psi_deg,negative,straight part,1.12,0.30,44.7277,
+12a,psi_deg,negative,straight part,1.12,0.35,38.1864,
+12a,psi_deg,negative,straight part,1.12,0.40,33.0988,
+12a,psi_deg,negative,straight part,1.12,0.45,28.4956,
+12a,psi_deg,negative,straight part,1.12,0.50,25.3461,
+12a,psi_deg,negative,straight part,1.12,0.55,21.9543,
+12a,psi_deg,negative,straight part,1.12,0.60,19.5316,
+12a,psi_deg,negative,straight part,1.12,0.65,16.8666,
+12a,psi_deg,negative,straight part,1.12,0.75,13.9594,
+12a,psi_deg,negative,straight part,1.12,0.80,13.4749,
+12a,psi_deg,negative,straight part,1.12,0.85,12.748,
+12a,psi_deg,negative,straight part,1.12,0.95,12.5058,
+12a,psi_deg,negative,straight part,1.12,1.00,12.0212,
+12a,psi_deg,negative,straight part,1.12,1.10,12.2635,
+12a,psi_deg,negative,straight part,1.12,1.20,12.2635,
+12a,psi_deg,negative,straight part,1.12,1.25,11.779,
+12a,psi_deg,negative,straight part,1.12,1.30,11.5367,
+12a,psi_deg,negative,straight part,1.12,1.35,11.2944,
+12a,psi_deg,negative,straight part,1.12,1.40,11.5367,
+12a,psi_deg,negative,straight part,1.84,0.20,66.2898,
+12a,psi_deg,negative,straight part,1.84,0.25,65.3207,
+12a,psi_deg,negative,straight part,1.84,0.30,64.8362,
+12a,psi_deg,negative,straight part,1.84,0.35,62.1712,
+12a,psi_deg,negative,straight part,1.84,0.40,58.2949,
+12a,psi_deg,negative,straight part,1.84,0.45,58.2949,
+12a,psi_deg,negative,straight part,1.84,0.50,59.0217,
+12a,psi_deg,negative,straight part,1.84,0.55,57.5681,
+12a,psi_deg,negative,straight part,1.84,0.60,54.1763,
+12a,psi_deg,negative,straight part,1.84,0.65,49.3309,
+12a,psi_deg,negative,straight part,1.84,0.70,46.4236,
+12a,psi_deg,negative,straight part,1.84,0.75,42.305,
+12a,psi_deg,negative,straight part,1.84,0.80,38.671,
+12a,psi_deg,negative,straight part,1.84,0.85,37.2174,
+12a,psi_deg,negative,straight part,1.84,0.90,35.2792,
+12a,psi_deg,negative,straight part,1.84,0.95,33.5833,
+12a,psi_deg,negative,straight part,1.84,1.00,30.4338,
+12a,psi_deg,negative,straight part,1.84,1.05,30.1915,
+12a,psi_deg,negative,straight part,1.84,1.10,28.0111,
+12a,psi_deg,negative,straight part,1.84,1.15,27.042,
+12a,psi_deg,negative,straight part,1.84,1.20,25.1038,
+12a,psi_deg,negative,straight part,1.84,1.25,25.1038,
+12a,psi_deg,negative,straight part,1.84,1.30,23.1657,
+12a,psi_deg,negative,straight part,1.84,1.35,22.4389,
+12a,psi_deg,negative,straight part,1.84,1.40,22.1966,
+13,mean_top_tension_N,negative,top,1.12,0.00,11.4975,
+13,mean_top_tension_N,negative,top,1.12,0.20,7.7903,0.992
+13,mean_top_tension_N,negative,top,1.12,0.25,7.6337,0.835
+13,mean_top_tension_N,negative,top,1.12,0.30,6.3283,0.783
+13,mean_top_tension_N,negative,top,1.12,0.35,6.2761,
+13,mean_top_tension_N,negative,top,1.12,0.40,6.6938,
+13,mean_top_tension_N,negative,top,1.12,0.45,6.9549,0.992
+13,mean_top_tension_N,negative,top,1.12,0.50,7.216,0.835
+13,mean_top_tension_N,negative,top,1.12,0.55,7.6337,0.835
+13,mean_top_tension_N,negative,top,1.12,0.60,8.3124,0.783
+13,mean_top_tension_N,negative,top,1.12,0.65,11.132,1.41
+13,mean_top_tension_N,negative,top,1.12,0.70,13.2728,1.253
+13,mean_top_tension_N,negative,top,1.12,0.75,15.3613,1.462
+13,mean_top_tension_N,negative,top,1.12,0.80,16.249,2.036
+13,mean_top_tension_N,negative,top,1.12,0.85,18.0764,2.924
+13,mean_top_tension_N,negative,top,1.12,0.90,22.9845,4.073
+13,mean_top_tension_N,negative,top,1.12,0.95,25.282,4.177
+13,mean_top_tension_N,negative,top,1.12,1.00,28.0493,4.229
+13,mean_top_tension_N,negative,top,1.12,1.05,31.7565,5.013
+13,mean_top_tension_N,negative,top,1.12,1.10,34.4716,5.326
+13,mean_top_tension_N,negative,top,1.12,1.15,37.8133,
+13,mean_top_tension_N,negative,top,1.12,1.20,41.5205,6.736
+13,mean_top_tension_N,negative,top,1.12,1.30,49.8747,8.72
+13,mean_top_tension_N,negative,top,1.12,1.35,52.7464,8.354
+13,mean_top_tension_N,negative,top,1.12,1.40,58.2811,
+13,mean_top_tension_N,negative,top,1.84,0.00,61.7794,1.514
+13,mean_top_tension_N,negative,top,1.84,0.20,58.8555,1.827
+13,mean_top_tension_N,negative,top,1.84,0.25,58.0723,1.88
+13,mean_top_tension_N,negative,top,1.84,0.30,55.6182,2.036
+13,mean_top_tension_N,negative,top,1.84,0.35,55.1483,
+13,mean_top_tension_N,negative,top,1.84,0.40,51.2322,3.185
+13,mean_top_tension_N,negative,top,1.84,0.45,49.1959,3.133
+13,mean_top_tension_N,negative,top,1.84,0.50,47.8383,
+13,mean_top_tension_N,negative,top,1.84,0.55,44.0267,4.334
+13,mean_top_tension_N,negative,top,1.84,0.60,41.6771,4.177
+13,mean_top_tension_N,negative,top,1.84,0.65,40.3195,3.551
+13,mean_top_tension_N,negative,top,1.84,0.70,40.685,3.812
+13,mean_top_tension_N,negative,top,1.84,0.75,40.8939,4.334
+13,mean_top_tension_N,negative,top,1.84,0.80,40.9461,4.908
+13,mean_top_tension_N,negative,top,1.84,0.85,41.7293,5.9
+13,mean_top_tension_N,negative,top,1.84,0.90,42.6692,6.422
+13,mean_top_tension_N,negative,top,1.84,0.95,42.3559,6.109
+13,mean_top_tension_N,negative,top,1.84,1.00,42.1992,6.161
+13,mean_top_tension_N,negative,top,1.84,1.05,43.6612,6.892
+13,mean_top_tension_N,negative,top,1.84,1.10,44.1312,6.109
+13,mean_top_tension_N,negative,top,1.84,1.15,44.2356,6.213
+13,mean_top_tension_N,negative,top,1.84,1.20,46.1153,6.109
+13,mean_top_tension_N,negative,top,1.84,1.25,46.4808,7.519
+13,mean_top_tension_N,negative,top,1.84,1.30,47.0551,5.9
+13,mean_top_tension_N,negative,top,1.84,1.35,47.7339,6.37
+13,mean_top_tension_N,negative,top,1.84,1.40,49.457,6.944
+15a,f_cf_hz,negative,around mid-depth,1.12,0.40,0.344,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.45,0.3865,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.50,0.3759,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.55,0.3546,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.60,0.344,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.60,0.5354,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.65,0.3971,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.65,0.7002,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.70,0.445,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.70,0.8756,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.75,0.4609,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.75,0.8969,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.80,0.3918,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.80,0.9075,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.85,0.3918,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.85,0.9872,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.90,1.1308,
+15a,f_cf_hz,negative,around mid-depth,1.12,0.95,1.1733,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.00,1.2956,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.05,1.3806,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.10,1.4498,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.15,1.5455,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.20,1.5986,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.25,1.673,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.30,1.7528,
+15a,f_cf_hz,negative,around mid-depth,1.12,1.35,1.7847,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.20,0.3759,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.20,0.445,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.25,0.5832,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.25,0.6045,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.30,0.5991,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.30,0.647,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.30,0.6523,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.35,0.647,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.35,0.6683,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.35,0.8278,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.40,0.8596,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.45,0.8437,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.45,0.865,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.50,0.8596,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.50,1.067,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.55,0.95,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.55,0.9713,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.60,1.0564,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.60,1.0776,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.65,0.4769,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.65,1.0298,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.70,0.7321,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.70,0.9872,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.75,0.95,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.75,1.051,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.80,0.8703,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.85,0.8331,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.85,0.8543,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.90,0.8384,
+15a,f_cf_hz,negative,around mid-depth,1.84,0.95,0.7959,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.00,0.7693,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.00,0.7905,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.05,0.7852,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.05,1.1361,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.10,1.0989,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.10,1.1201,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.10,1.1574,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.15,0.9872,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.15,1.1414,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.20,1.0829,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.25,1.0989,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.30,1.0457,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.30,1.067,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.35,1.0776,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.40,1.0989,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.40,1.1148,
+15a,f_cf_hz,negative,around mid-depth,1.84,1.40,1.1361,
diff --git a/validation/experiments/chaplin_catenary/provenance.json b/validation/experiments/chaplin_catenary/provenance.json
new file mode 100644
index 00000000..79a46a6a
--- /dev/null
+++ b/validation/experiments/chaplin_catenary/provenance.json
@@ -0,0 +1,36 @@
+{
+ "source": "Chaplin & King (2018), Laboratory measurements of the vortex-induced vibrations of an untensioned catenary riser with high curvature, Journal of Fluids and Structures 79, 26-38 (Table 1; Secs. 2, 3, 4.1, 4.2; Eqs. 9-10; Figs. 3, 5, 9, 10, 12, 13, 15 and their captions); Ulveseter, Thorsen, Saevik & Larsen (2019), Applied Ocean Research 90, 101856 (Table 1); Ulveseter, Thorsen, Saevik & Larsen (2018), Marine Structures 60, 241-260 (Table 3); Chaplin, Bearman, Huera Huarte & Pattenden (2005), Journal of Fluids and Structures 21(1), 3-24 (Eq. 4); Facchinetti, de Langre & Biolley (2004), Journal of Fluids and Structures 19(2), 123-140 (Secs. 2-3)",
+ "doi": [
+ "10.1016/j.jfluidstructs.2018.01.008",
+ "10.1016/j.apor.2019.101856",
+ "10.1016/j.marstruc.2018.04.001",
+ "10.1016/j.jfluidstructs.2005.04.010",
+ "10.1016/j.jfluidstructs.2003.12.004"
+ ],
+ "article_pdf_sha256": "0903b21f16eacc374135408e5473d5c48cc20a041fd0f63621187a7032a42984",
+ "bibliographic_data": "Chaplin & King (2018): authors, title, journal, volume, year, pages and DOI from the article's first page; the other articles as in the FLOTANT case",
+ "data_used": "the riser (Table 1: d 56 mm, 5.36 m between the pin ends, EI 1.3 N m^2 and EA 790 kN estimated, structural damping in air about 3 % of critical, submerged weight 2.9 and 20.9 N/m at m* 1.12 and 1.84, water depth 2.0 m, lower pin on the floor, upper pin 200 mm above the surface, 4.30 m between the pins horizontally, U 0 to +-1.4 m/s); the current directions (Sec. 3: positive with the upstream pin on the floor); twelve accelerometers 400 mm apart (Sec. 2); mean top tension and its standard deviation against U (Fig. 10, positive; Fig. 13, negative); cross-flow spectral peak frequencies against U (Fig. 9(a), two accelerometers near the top, and 9(b), one lower down, positive; Fig. 15(a), around mid-depth, negative); the inclination of the straight part in negative current (Fig. 12(a)); Eq. 9 (the straight-line balance of normal drag and weight) for the implied drag coefficient; the statements f d/U about 0.11 (positive, Sec. 4.1) and f d/(U sin psi) about 0.13 (negative, Sec. 4.2); the mean profiles (Fig. 5) for the touchdown, by eye",
+ "extraction": "extract_chaplin2018.py: Figs. 9, 10, 12, 13 and 15 are embedded greyscale raster images; each panel calibrated on its frame and the tick marks found on both opposite sides of it (largest tick residual 0.0010 m/s, 0.0036 Hz, 0.07 deg, 0.14 N); markers found by a circle Hough transform and classed solid (m* 1.84) or open (m* 1.12) by their fill; speeds snapped to the 0.05 m/s test grid (largest snap 0.012 m/s); peaks off the grid by more than 0.0125 m/s or with a fill between the classes dropped and reported; error bars read from their caps (the bar centre moves the marker's by at most 0.59 N); points read (open/solid): Fig. 9(a) 12/40, 9(b) 22/34, 10 26/24 (46 standard deviations), 12(a) 20/25, 13 25/26 (44 standard deviations), 15(a) 26/47; checks: the line f d/U = 0.11 drawn in Fig. 9 reads 0.105 and 0.108, the lines W h drawn in Fig. 13 read 41.9 and 5.65 N against Table 1's 41.8 and 5.8 N",
+ "assumptions": "fresh water 1000 kg/m^3 (not stated; m* 1.12 and W 2.9 N/m agree at it); mass per metre with the internal water from the submerged weight, rho A + W/g (for m* 1.84 Table 1's m* gives 1.4 % less mass); the 0.2 m above the surface in air with the same mass; pinned ends at (0, 0, -2.0) and (4.30, 0, 0.2); uniform current over the depth, in the riser's plane, ramped linearly from still water over 10 s (a static solve in the full current finds no equilibrium for some light-riser cases in negative current); Cd 1.2 and Ca 1; floor contact with the default penalty stiffness and damping and friction coefficient 0.5 (not given; a silicone sheath on the flume floor; frictionless as sensitivity); structural damping as Rayleigh damping, 3 % at 0.3 and 3.0 Hz (the range of the measured cross-flow frequencies; none as sensitivity); the accelerometers 0.48 m from each pin, 0.4 m apart (positions not given); the compared points by their mean elevation, at the share of the height between the pins of the dots of the insets of Fig. 9 (0.65 and 0.37 for (a), 0.19 for (b)) and mid-depth for Fig. 15",
+ "coefficients": {
+ "uls19": "Ulveseter et al. (2019), Table 1, fitted by them to the NDP riser in uniform flow (Sec. 4.1, Chh 1.5): Cd 1.2, CM 2, Cl 0.85, cF 0.144, dF 0.064; VIV ClX 0.75, alpha 0.15, Chh 1.5; blind here",
+ "b1": "the generic set of the Delta Flume case, nothing fitted to these tests: Cl 0.8, cF 0.18, dF 0.08, Cd 1.2; VIV ClX 0.85, alpha 0.15 (Ulveseter et al. 2018, Table 3); VIV AMPLITUDE Cv 0.8 with CdAmp = 1 + 2.3 s + 1.7 s^2, s = (A/D)/sqrt(2), at A/D 0-1.5 (Chaplin et al. 2005, Eq. 4); VIV DAMPING 0 0 1",
+ "wake": "Facchinetti et al. (2004): WAKE OSCILLATOR CL0 0.3, St 0.2, eps 0.3, A 12, LINE TYPES Cl 0, Cd 1.2; cross-flow only",
+ "none": "no VIV force, Cd 1.2: the drag of the static solution"
+ },
+ "processing": "statistics over 30-110 s (30-40 s of 40 s runs without VIV); mean and standard deviation of the tension at the upper pin (FairTen1); the mean profile from the mean node positions; the inclination to the horizontal at mid-depth from the neighbouring nodes; the dominant cross-flow frequency as the peak of the averaged spectrum (20 s Hann segments, half overlapping, 0.05 Hz resolution) of the horizontal cross-flow displacement within 0.3-6 Hz, and the peak of the same spectrum times omega^4 (the acceleration spectrum) within 0.15-6 Hz as a second value; A/D_rms of the cross-flow displacement, all of it and above 0.3 Hz; the spread along the span over the assumed accelerometer stations that are suspended and below the surface; the model's frequency compared with the nearest measured point at the same speed and mass ratio (the figures give several spectral peaks at some speeds) and as median f d/U; the tension also as the increment from the still-water value of each figure and of the model; the drag coefficient implied by an inclination through Eq. 9, Cd = 2 W cos psi / (rho d U^2 sin^2 psi)",
+ "CableDyn_commit": "15b5ebc (dev)",
+ "validation_date": "2026-11-17",
+ "executable_name": "cabledyn.exe",
+ "executable_sha256": "see summary.json",
+ "compiler": "GNU Fortran 16.2.0",
+ "build_type": "Release",
+ "platform": "Windows 11 x86-64",
+ "segments": 54,
+ "dt_s": 0.0025,
+ "tmax_s": 110.0,
+ "statistics_after_s": 30.0,
+ "reproduction": "the default command, run into a new work directory with the executable of summary.json, reproduces response_comparison.csv and summary.json byte for byte",
+ "current_ramp_s": 10.0,
+ "runs": "2 still water, 208 primary (4 sets x 2 mass ratios x 2 directions x 13 speeds), 12 convergence, 72 sensitivity"
+}
diff --git a/validation/experiments/chaplin_catenary/response_comparison.csv b/validation/experiments/chaplin_catenary/response_comparison.csv
new file mode 100644
index 00000000..b236f23e
--- /dev/null
+++ b/validation/experiments/chaplin_catenary/response_comparison.csv
@@ -0,0 +1,295 @@
+run,set,role,m_star,direction,U_mps,segments,dt_s,structural_damping,floor_friction,model_mean_T_N,model_sd_T_N,model_still_T_N,measured_mean_T_N,measured_sd_T_N,measured_still_T_N,model_psi_mid_depth_deg,model_cd_eq9,measured_psi_deg,measured_cd_eq9,model_f_upper_hz,model_f_acc_upper_hz,measured_f_upper_hz,nearest_measured_f_upper_hz,model_f_lower_hz,model_f_acc_lower_hz,measured_f_lower_hz,nearest_measured_f_lower_hz,model_f_span_min_hz,model_f_span_median_hz,model_f_span_max_hz,model_AD_rms_max,model_AD_rms_above_0p3hz_max,model_f_mid_hz,model_f_acc_mid_hz,measured_f_mid_hz,nearest_measured_f_mid_hz
+none_m1.12_still,none,still water,1.12,pos,0,54,0.0025,1,0.5,15.0821,7.40696e-07,15.0821,13.3836,,13.3836,52.9723,,,,,,,,,,,,,,,,,,,,
+none_m1.84_still,none,still water,1.84,pos,0,54,0.0025,1,0.5,81.1893,4.70667e-06,81.1893,59.0952,,59.0952,53.2598,,,,,,,,,,,,,,,,,,,,
+uls19_m1.12_pos0.2,uls19,primary,1.12,pos,0.2,54,0.0025,1,0.5,16.7982,0.505064,15.0821,15.2686,,13.3836,51.6608,2.61078,,,0.4,0.8,,,0.4,1.1,0.527,0.5268,0.4,0.4,0.4,0.290581,0.279148,,,,
+uls19_m1.12_pos0.3,uls19,primary,1.12,pos,0.3,54,0.0025,1,0.5,19.0259,0.987133,15.0821,17.6249,1.414,13.3836,50.1694,1.24989,,,0.65,1.85,0.814,0.8144,0.65,0.65,,,0.65,0.65,0.65,0.297955,0.295891,,,,
+uls19_m1.12_pos0.4,uls19,primary,1.12,pos,0.4,54,0.0025,1,0.5,21.291,1.72297,15.0821,21.3949,2.356,13.3836,48.9137,0.748849,,,0.9,0.9,0.806,0.8064,0.9,0.9,,,0.9,0.9,0.9,0.244977,0.235142,,,,
+uls19_m1.12_pos0.5,uls19,primary,1.12,pos,0.5,54,0.0025,1,0.5,24.7421,3.2214,15.0821,25.8718,3.534,13.3836,49.4818,0.465748,,,1.125,2.2,1.110,1.1104,1.15,1.15,0.870,0.8698,1.1,1.15,1.15,0.285731,0.280606,,,,
+uls19_m1.12_pos0.6,uls19,primary,1.12,pos,0.6,54,0.0025,1,0.5,28.5592,4.74229,15.0821,31.5269,4.477,13.3836,48.245,0.34427,,,1.3,2.525,,,1.3,1.3,0.989,0.9894,1.15,1.3,1.3,0.298055,0.292083,,,,
+uls19_m1.12_pos0.7,uls19,primary,1.12,pos,0.7,54,0.0025,1,0.5,32.45,5.92764,15.0821,36.9463,6.126,13.3836,46.9257,0.270537,,,1.425,1.65,,,1.45,1.65,1.125,1.125,1.4,1.65,1.65,0.281958,0.273706,,,,
+uls19_m1.12_pos0.8,uls19,primary,1.12,pos,0.8,54,0.0025,1,0.5,36.3536,6.68757,15.0821,45.311,7.893,13.3836,46.3414,0.213451,,,1.75,3.45,,,1.75,1.75,1.277,1.2766,1.75,1.75,1.75,0.293301,0.287427,,,,
+uls19_m1.12_pos0.9,uls19,primary,1.12,pos,0.9,54,0.0025,1,0.5,42.4833,9.49256,15.0821,53.2045,10.132,13.3836,41.5234,0.217833,,,1.9,1.9,,,1.9,1.9,1.572,1.5717,1.9,1.9,1.9,0.326064,0.316025,,,,
+uls19_m1.12_pos1,uls19,primary,1.12,pos,1,54,0.0025,1,0.5,47.7699,10.0317,15.0821,60.7446,12.017,13.3836,40.3932,0.187839,,,2.3,2.3,,,2.3,2.3,1.643,1.6435,2.3,2.3,2.3,0.316676,0.312013,,,,
+uls19_m1.12_pos1.1,uls19,primary,1.12,pos,1.1,54,0.0025,1,0.5,53.7868,10.1786,15.0821,69.2271,14.373,13.3836,39.5243,0.16302,,,2.45,2.45,,,2.45,2.45,1.747,1.7472,2.45,2.45,2.45,0.338084,0.332129,,,,
+uls19_m1.12_pos1.2,uls19,primary,1.12,pos,1.2,54,0.0025,1,0.5,60.3426,11.2162,15.0821,80.1838,16.612,13.3836,38.883,0.142085,,,2.6,2.6,2.118;2.350,2.3503,2.6,2.6,1.739,1.7392,2.6,2.6,2.6,0.336076,0.332256,,,,
+uls19_m1.12_pos1.3,uls19,primary,1.12,pos,1.3,54,0.0025,1,0.5,67.5869,12.428,15.0821,90.9048,18.615,13.3836,38.1945,0.125975,,,2.75,2.75,,,2.75,2.75,1.699,1.6993,0.6,2.75,2.75,0.335948,0.331869,,,,
+uls19_m1.12_pos1.4,uls19,primary,1.12,pos,1.4,54,0.0025,1,0.5,75.2104,16.9342,15.0821,101.979,21.678,13.3836,37.4696,0.113327,,,3.075,3.075,2.302,2.3023,2.85,2.85,1.811,1.811,0.65,2.95,3.2,0.334496,0.329498,,,,
+uls19_m1.12_neg0.2,uls19,primary,1.12,neg,0.2,54,0.0025,1,0.5,13.207,0.48489,15.0821,7.7903,0.992,11.4975,54.5352,2.26468,,,,,,,,,,,0.4,0.4,0.4,0.401757,0.39923,0.4,1.15,,
+uls19_m1.12_neg0.3,uls19,primary,1.12,neg,0.3,54,0.0025,1,0.5,10.64,1.46672,15.0821,6.3283,0.783,11.4975,56.5974,0.909037,44.7277,1.65088,,,,,,,,,0.6,0.6,0.6,0.358314,0.355103,0.6,0.6,,
+uls19_m1.12_neg0.4,uls19,primary,1.12,neg,0.4,54,0.0025,1,0.5,8.91868,1.48389,15.0821,6.6938,,11.4975,45.3003,0.901194,33.0988,1.81846,,,,,,,,,0.55,0.6,0.7,4.84122,0.587544,0.6,0.6,0.344,0.344
+uls19_m1.12_neg0.5,uls19,primary,1.12,neg,0.5,54,0.0025,1,0.5,9.18885,1.64364,15.0821,7.216,0.835,11.4975,29.1746,1.52223,25.3461,2.04307,,,,,,,,,0.3,0.65,0.8,7.29032,0.659966,0.8,0.8,0.376,0.3759
+uls19_m1.12_neg0.6,uls19,primary,1.12,neg,0.6,54,0.0025,1,0.5,10.7976,1.70681,15.0821,8.3124,0.783,11.4975,24.9233,1.46921,19.5316,2.42581,,,,,,,,,0.7,0.7,0.7,0.657846,0.383439,0.7,0.7,0.344;0.535,0.5354
+uls19_m1.12_neg0.7,uls19,primary,1.12,neg,0.7,54,0.0025,1,0.5,12.8915,2.66935,15.0821,13.2728,1.253,11.4975,7.81918,11.3138,,,,,,,,,,,0.7,0.75,0.75,0.481963,0.336565,0.75,4.25,0.445;0.876,0.8756
+uls19_m1.12_neg0.8,uls19,primary,1.12,neg,0.8,54,0.0025,1,0.5,15.9706,3.90666,15.0821,16.249,2.036,11.4975,13.771,2.77387,13.4749,2.89837,,,,,,,,,0.65,0.65,1.8,0.352379,0.331739,0.65,1.8,0.392;0.907,0.9075
+uls19_m1.12_neg0.9,uls19,primary,1.12,neg,0.9,54,0.0025,1,0.5,20.0349,5.14278,15.0821,22.9845,4.073,11.4975,21.4405,0.890744,,,,,,,,,,,0.7,0.725,1.95,0.42938,0.394161,0.7,1.95,1.131,1.1308
+uls19_m1.12_neg1,uls19,primary,1.12,neg,1,54,0.0025,1,0.5,24.7594,6.02741,15.0821,28.0493,4.229,11.4975,27.8851,0.418507,12.0212,2.33529,,,,,,,,,0.7,0.7,2.15,0.3942,0.37677,2.15,2.15,1.296,1.2956
+uls19_m1.12_neg1.1,uls19,primary,1.12,neg,1.1,54,0.0025,1,0.5,29.5512,6.50701,15.0821,34.4716,5.326,11.4975,30.2918,0.290497,12.2635,1.85391,,,,,,,,,0.75,0.75,2.4,0.431732,0.419519,0.75,2.4,1.450,1.4498
+uls19_m1.12_neg1.2,uls19,primary,1.12,neg,1.2,54,0.0025,1,0.5,35.5558,8.34394,15.0821,41.5205,6.736,11.4975,31.7633,0.220681,12.2635,1.5578,,,,,,,,,0.8,0.8,2.7,0.402902,0.395627,2.7,2.7,1.599,1.5986
+uls19_m1.12_neg1.3,uls19,primary,1.12,neg,1.3,54,0.0025,1,0.5,41.9534,8.93749,15.0821,49.8747,8.72,11.4975,33.2026,0.171007,11.5367,1.50123,,,,,,,,,0.85,0.9,2.85,0.377392,0.371633,2.85,2.85,1.753,1.7528
+uls19_m1.12_neg1.4,uls19,primary,1.12,neg,1.4,54,0.0025,1,0.5,48.1665,10.0241,15.0821,58.2811,,11.4975,33.5734,0.143967,11.5367,1.29443,,,,,,,,,0.8,0.8,3,0.334655,0.3307,3,3,,
+uls19_m1.84_pos0.2,uls19,primary,1.84,pos,0.2,54,0.0025,1,0.5,83.5018,0.562486,81.1893,67.1065,,59.0952,53.0688,17.5476,,,0.4,0.4,,,0.4,0.4,,,0.4,0.4,0.4,0.576817,0.575521,,,,
+uls19_m1.84_pos0.3,uls19,primary,1.84,pos,0.3,54,0.0025,1,0.5,85.3707,1.77032,81.1893,68.2846,1.178,59.0952,52.6434,7.96481,,,0.7,1.375,0.662;0.718,0.7184,0.7,0.7,0.678,0.6784,0.7,0.7,0.7,0.29515,0.294309,,,,
+uls19_m1.84_pos0.4,uls19,primary,1.84,pos,0.4,54,0.0025,1,0.5,88.0966,2.08189,81.1893,71.1122,1.885,59.0952,52.4136,4.53148,,,0.8,0.8,0.950;1.006,0.9504,0.8,2.55,0.822,0.8219,0.8,0.8,0.8,0.2599,0.258093,,,,
+uls19_m1.84_pos0.5,uls19,primary,1.84,pos,0.5,54,0.0025,1,0.5,92.1167,5.58529,81.1893,,,59.0952,51.8191,2.98693,,,1.15,3.4,0.982,0.9824,1.15,3.4,0.982,0.9815,1.15,1.15,1.15,0.257071,0.255393,,,,
+uls19_m1.84_pos0.6,uls19,primary,1.84,pos,0.6,54,0.0025,1,0.5,97.2255,6.35024,81.1893,82.6579,5.655,59.0952,51.2613,2.13256,,,1.25,2.375,1.278;1.334,1.2784,1.15,1.25,0.670;1.285,1.2846,1.15,1.25,1.25,0.308735,0.305862,,,,
+uls19_m1.84_pos0.7,uls19,primary,1.84,pos,0.7,54,0.0025,1,0.5,102.06,9.24732,81.1893,89.0198,6.833,59.0952,50.6741,1.61331,,,1.55,1.55,1.390;1.446,1.4464,1.55,1.55,0.702;1.404;1.460,1.46,1.55,1.55,1.55,0.271429,0.267213,,,,
+uls19_m1.84_pos0.8,uls19,primary,1.84,pos,0.8,54,0.0025,1,0.5,108.387,11.8418,81.1893,95.7352,9.072,59.0952,49.9678,1.27959,,,1.65,1.65,1.582;1.638;1.694,1.6384,1.65,4.8,0.822;1.612,1.6116,1.65,1.65,1.65,0.274848,0.26973,,,,
+uls19_m1.84_pos0.9,uls19,primary,1.84,pos,0.9,54,0.0025,1,0.5,114.847,12.9385,81.1893,104.807,11.781,59.0952,49.4142,1.03951,,,2,2,1.734;1.822,1.8223,2,2,0.766;1.827,1.827,2,2,2,0.281236,0.277281,,,,
+uls19_m1.84_pos1,uls19,primary,1.84,pos,1,54,0.0025,1,0.5,121.545,15.0978,81.1893,111.876,13.195,59.0952,48.8015,0.868404,,,2.05,2.05,1.958;2.014,2.0143,2.05,2.05,0.830;1.947,1.9466,2.05,2.05,2.05,0.266045,0.263599,,,,
+uls19_m1.84_pos1.1,uls19,primary,1.84,pos,1.1,54,0.0025,1,0.5,130.096,18.0775,81.1893,123.893,16.258,59.0952,47.7316,0.7577,,,2.45,2.45,2.046,2.0463,2.45,2.45,1.994,1.9945,2.45,2.45,2.45,0.284093,0.27958,,,,
+uls19_m1.84_pos1.2,uls19,primary,1.84,pos,1.2,54,0.0025,1,0.5,138.99,20.5616,81.1893,133.082,18.379,59.0952,47.0828,0.658131,,,2.6,2.6,2.278,2.2783,2.6,2.6,2.050,2.0503,2.5,2.6,2.6,0.297519,0.29508,,,,
+uls19_m1.84_pos1.3,uls19,primary,1.84,pos,1.3,54,0.0025,1,0.5,148.038,23.082,81.1893,144.039,19.675,59.0952,46.4481,0.579362,,,2.65,2.9,2.310;2.422;2.486,2.4863,2.6,2.9,2.234,2.2337,2.5,2.6,2.9,0.304974,0.302497,,,,
+uls19_m1.84_pos1.4,uls19,primary,1.84,pos,1.4,54,0.0025,1,0.5,158.499,28.4721,81.1893,154.877,23.68,59.0952,45.6708,0.520058,,,3.1,3.1,2.454;2.574,2.5743,3.1,3.1,2.345,2.3454,2.7,3.1,3.1,0.31863,0.316677,,,,
+uls19_m1.84_neg0.2,uls19,primary,1.84,neg,0.2,54,0.0025,1,0.5,78.9164,0.688175,81.1893,58.8555,1.827,61.7794,53.4022,17.2606,66.2898,8.95099,,,,,,,,,0.4,0.4,0.4,0.630941,0.629787,0.4,0.4,0.376;0.445,0.3759
+uls19_m1.84_neg0.3,uls19,primary,1.84,neg,0.3,54,0.0025,1,0.5,76.9682,1.85657,81.1893,55.6182,2.036,61.7794,53.8297,7.51106,64.8362,4.30484,,,,,,,,,0.7,0.7,0.7,0.380995,0.380378,0.7,0.7,0.599;0.647;0.652,0.6523
+uls19_m1.84_neg0.4,uls19,primary,1.84,neg,0.4,54,0.0025,1,0.5,73.618,2.70573,81.1893,51.2322,3.185,61.7794,54.133,4.16217,58.2949,3.38736,,,,,,,,,0.75,0.75,0.75,0.429528,0.427898,0.75,0.75,0.860,0.8596
+uls19_m1.84_neg0.5,uls19,primary,1.84,neg,0.5,54,0.0025,1,0.5,69.2553,7.26376,81.1893,47.8383,,61.7794,54.6664,2.59456,59.0217,2.09067,,,,,,,,,1.05,1.05,1.05,0.359293,0.356198,1.05,3.25,0.860;1.067,1.067
+uls19_m1.84_neg0.6,uls19,primary,1.84,neg,0.6,54,0.0025,1,0.5,64.4232,7.776,81.1893,41.6771,4.177,61.7794,55.0391,1.76893,54.1763,1.8459,,,,,,,,,1.1,1.1,1.1,0.38279,0.380068,1.1,3.3,1.056;1.078,1.0776
+uls19_m1.84_neg0.7,uls19,primary,1.84,neg,0.7,54,0.0025,1,0.5,57.104,11.6844,81.1893,40.685,3.812,61.7794,55.2549,1.28584,46.4236,2.00074,,,,,,,,,1.35,1.35,1.35,0.42465,0.422203,1.35,1.35,0.732;0.987,0.9872
+uls19_m1.84_neg0.8,uls19,primary,1.84,neg,0.8,54,0.0025,1,0.5,46.6838,11.7027,81.1893,40.9461,4.908,61.7794,54.9516,0.999326,38.671,2.33222,,,,,,,,,1.35,1.35,1.35,0.51698,0.513608,1.35,1.35,0.870,0.8703
+uls19_m1.84_neg0.9,uls19,primary,1.84,neg,0.9,54,0.0025,1,0.5,41.5531,10.1871,81.1893,42.6692,6.422,61.7794,51.8108,0.922272,35.2792,2.25518,,,,,,,,,1.7,1.7,1.7,0.620772,0.387479,1.7,1.7,0.838,0.8384
+uls19_m1.84_neg1,uls19,primary,1.84,neg,1,54,0.0025,1,0.5,40.9581,9.43808,81.1893,42.1992,6.161,61.7794,40.0715,1.37836,30.4338,2.50826,,,,,,,,,1.35,1.475,1.5,2.05317,0.510681,1.5,1.5,0.769;0.790,0.7905
+uls19_m1.84_neg1.1,uls19,primary,1.84,neg,1.1,54,0.0025,1,0.5,43.7696,10.2278,81.1893,44.1312,6.109,61.7794,37.1388,1.3491,28.0111,2.46921,,,,,,,,,0.3,1.45,1.7,4.22466,0.517487,1.45,1.45,1.099;1.120;1.157,1.1574
+uls19_m1.84_neg1.2,uls19,primary,1.84,neg,1.2,54,0.0025,1,0.5,44.481,10.067,81.1893,46.1153,6.109,61.7794,34.1723,1.35935,25.1038,2.60778,,,,,,,,,1.35,1.5,1.6,4.92323,0.535254,1.5,1.6,1.083,1.0829
+uls19_m1.84_neg1.3,uls19,primary,1.84,neg,1.3,54,0.0025,1,0.5,45.6169,8.97161,81.1893,47.0551,5.9,61.7794,32.0176,1.33227,23.1657,2.62387,,,,,,,,,0.3,1.45,1.45,2.32614,0.594189,1.45,1.45,1.046;1.067,1.067
+uls19_m1.84_neg1.4,uls19,primary,1.84,neg,1.4,54,0.0025,1,0.5,50.8233,11.3919,81.1893,49.457,6.944,61.7794,30.0477,1.31481,22.1966,2.4706,,,,,,,,,1.25,1.5,1.5,0.720432,0.685319,1.5,1.5,1.099;1.115;1.136,1.1361
+b1_m1.12_pos0.2,b1,primary,1.12,pos,0.2,54,0.0025,1,0.5,17.8442,0.462354,15.0821,15.2686,,13.3836,51.0541,2.69076,,,0.45,0.45,,,0.45,0.45,0.527,0.5268,0.45,0.45,0.45,0.335692,0.335062,,,,
+b1_m1.12_pos0.3,b1,primary,1.12,pos,0.3,54,0.0025,1,0.5,20.617,0.894396,15.0821,17.6249,1.414,13.3836,49.5317,1.2905,,,0.7,0.7,0.814,0.8144,0.7,0.7,,,0.7,0.7,0.7,0.256612,0.255881,,,,
+b1_m1.12_pos0.4,b1,primary,1.12,pos,0.4,54,0.0025,1,0.5,23.8264,1.08904,15.0821,21.3949,2.356,13.3836,50.587,0.688543,,,1,1,0.806,0.8064,1,1,,,1,1,1,0.205427,0.202575,,,,
+b1_m1.12_pos0.5,b1,primary,1.12,pos,0.5,54,0.0025,1,0.5,28.1924,1.98308,15.0821,25.8718,3.534,13.3836,49.1511,0.473562,,,1.3,1.3,1.110,1.1104,1.3,1.3,0.870,0.8698,1.3,1.3,1.3,0.221766,0.2184,,,,
+b1_m1.12_pos0.6,b1,primary,1.12,pos,0.6,54,0.0025,1,0.5,34.9741,4.49274,15.0821,31.5269,4.477,13.3836,46.8139,0.370351,,,1.5,1.5,,,1.5,1.5,0.989,0.9894,1.5,1.5,1.5,0.272664,0.272337,,,,
+b1_m1.12_pos0.7,b1,primary,1.12,pos,0.7,54,0.0025,1,0.5,42.4771,6.1477,15.0821,36.9463,6.126,13.3836,42.0844,0.34922,,,1.6,1.6,,,1.6,1.6,1.125,1.125,1.6,1.6,1.6,0.344173,0.343541,,,,
+b1_m1.12_pos0.8,b1,primary,1.12,pos,0.8,54,0.0025,1,0.5,49.0168,7.01484,15.0821,45.311,7.893,13.3836,40.4558,0.292474,,,1.75,1.75,,,1.75,1.75,1.277,1.2766,1.75,1.75,1.75,0.341887,0.341488,,,,
+b1_m1.12_pos0.9,b1,primary,1.12,pos,0.9,54,0.0025,1,0.5,57.239,7.69997,15.0821,53.2045,10.132,13.3836,38.6426,0.25611,,,1.9,1.9,,,1.9,1.9,1.572,1.5717,1.9,1.9,1.9,0.377248,0.376985,,,,
+b1_m1.12_pos1,b1,primary,1.12,pos,1,54,0.0025,1,0.5,60.2975,7.40786,15.0821,60.7446,12.017,13.3836,38.338,0.211133,,,2.65,2.65,,,2.65,2.65,1.643,1.6435,2.65,2.65,2.65,0.235408,0.231654,,,,
+b1_m1.12_pos1.1,b1,primary,1.12,pos,1.1,54,0.0025,1,0.5,69.6399,8.0892,15.0821,69.2271,14.373,13.3836,37.3617,0.184743,,,2.85,2.85,,,2.85,2.85,1.747,1.7472,2.85,2.85,2.85,0.246849,0.245344,,,,
+b1_m1.12_pos1.2,b1,primary,1.12,pos,1.2,54,0.0025,1,0.5,80.1743,8.78522,15.0821,80.1838,16.612,13.3836,36.5842,0.162587,,,3.05,3.05,2.118;2.350,2.3503,3.05,3.05,1.739,1.7392,3.05,3.05,3.05,0.257829,0.255474,,,,
+b1_m1.12_pos1.3,b1,primary,1.12,pos,1.3,54,0.0025,1,0.5,91.9598,9.62496,15.0821,90.9048,18.615,13.3836,36.0306,0.143241,,,3.2,3.2,,,3.2,3.2,1.699,1.6993,3.2,3.2,3.2,0.271682,0.269195,,,,
+b1_m1.12_pos1.4,b1,primary,1.12,pos,1.4,54,0.0025,1,0.5,103.84,10.6626,15.0821,101.979,21.678,13.3836,35.4957,0.127608,,,3.4,3.4,2.302,2.3023,3.4,3.4,1.811,1.811,3.4,3.4,3.4,0.278058,0.275187,,,,
+b1_m1.12_neg0.2,b1,primary,1.12,neg,0.2,54,0.0025,1,0.5,11.8077,0.331512,15.0821,7.7903,0.992,11.4975,55.8476,2.12258,,,,,,,,,,,0.4,0.4,0.4,0.361508,0.360993,0.4,0.4,,
+b1_m1.12_neg0.3,b1,primary,1.12,neg,0.3,54,0.0025,1,0.5,6.97933,0.896034,15.0821,6.3283,0.783,11.4975,55.9692,0.937718,44.7277,1.65088,,,,,,,,,0.6,0.6,0.65,2.88907,0.443817,0.6,0.65,,
+b1_m1.12_neg0.4,b1,primary,1.12,neg,0.4,54,0.0025,1,0.5,8.64443,1.17382,15.0821,6.6938,,11.4975,29.2802,2.36044,33.0988,1.81846,,,,,,,,,0.65,0.65,0.65,6.33725,0.392525,0.5,0.65,0.344,0.344
+b1_m1.12_neg0.5,b1,primary,1.12,neg,0.5,54,0.0025,1,0.5,9.62771,1.21886,15.0821,7.216,0.835,11.4975,27.2191,1.76096,25.3461,2.04307,,,,,,,,,0.8,0.8,0.8,1.59474,0.306817,0.8,0.85,0.376,0.3759
+b1_m1.12_neg0.6,b1,primary,1.12,neg,0.6,54,0.0025,1,0.5,12.7133,1.62156,15.0821,8.3124,0.783,11.4975,12.3059,6.18799,19.5316,2.42581,,,,,,,,,0.85,1.4,1.4,0.301397,0.275481,0.85,1.4,0.344;0.535,0.5354
+b1_m1.12_neg0.7,b1,primary,1.12,neg,0.7,54,0.0025,1,0.5,16.4408,2.35539,15.0821,13.2728,1.253,11.4975,9.57303,7.53607,,,,,,,,,,,0.85,1.6,1.6,0.295568,0.287685,1.6,1.6,0.445;0.876,0.8756
+b1_m1.12_neg0.8,b1,primary,1.12,neg,0.8,54,0.0025,1,0.5,20.9937,3.72381,15.0821,16.249,2.036,11.4975,20.6909,1.2127,13.4749,2.89837,,,,,,,,,0.8,0.8,2,0.317085,0.303612,0.8,2,0.392;0.907,0.9075
+b1_m1.12_neg0.9,b1,primary,1.12,neg,0.9,54,0.0025,1,0.5,27.6884,4.66769,15.0821,22.9845,4.073,11.4975,27.4542,0.533813,,,,,,,,,,,0.9,2.2,2.2,0.309022,0.302846,2.2,2.2,1.131,1.1308
+b1_m1.12_neg1,b1,primary,1.12,neg,1,54,0.0025,1,0.5,34.5055,5.42344,15.0821,28.0493,4.229,11.4975,29.372,0.375184,12.0212,2.33529,,,,,,,,,0.85,2.4,2.4,0.299756,0.292745,2.4,2.4,1.296,1.2956
+b1_m1.12_neg1.1,b1,primary,1.12,neg,1.1,54,0.0025,1,0.5,42.7488,6.50108,15.0821,34.4716,5.326,11.4975,30.6859,0.282643,12.2635,1.85391,,,,,,,,,0.95,2.6,2.6,0.293857,0.291643,2.6,2.6,1.450,1.4498
+b1_m1.12_neg1.2,b1,primary,1.12,neg,1.2,54,0.0025,1,0.5,49.6299,8.06837,15.0821,41.5205,6.736,11.4975,31.5836,0.223367,12.2635,1.5578,,,,,,,,,0.95,3.15,3.15,0.288318,0.282889,3.15,3.15,1.599,1.5986
+b1_m1.12_neg1.3,b1,primary,1.12,neg,1.3,54,0.0025,1,0.5,60.5516,10.4315,15.0821,49.8747,8.72,11.4975,32.6386,0.177415,11.5367,1.50123,,,,,,,,,1.1,3.35,3.35,0.30644,0.302574,3.35,3.35,1.753,1.7528
+b1_m1.12_neg1.4,b1,primary,1.12,neg,1.4,54,0.0025,1,0.5,70.7403,11.0166,15.0821,58.2811,,11.4975,32.826,0.151108,11.5367,1.29443,,,,,,,,,1.05,3.55,3.55,0.286056,0.28236,3.55,3.55,,
+b1_m1.84_pos0.2,b1,primary,1.84,pos,0.2,54,0.0025,1,0.5,84.5959,0.315659,81.1893,67.1065,,59.0952,53.0472,17.5663,,,0.4,0.4,,,0.4,0.4,,,0.4,0.4,0.4,0.414209,0.413506,,,,
+b1_m1.84_pos0.3,b1,primary,1.84,pos,0.3,54,0.0025,1,0.5,87.2795,1.30437,81.1893,68.2846,1.178,59.0952,52.4095,8.05763,,,0.8,0.8,0.662;0.718,0.7184,0.8,0.8,0.678,0.6784,0.8,0.8,0.8,0.299691,0.299448,,,,
+b1_m1.84_pos0.4,b1,primary,1.84,pos,0.4,54,0.0025,1,0.5,91.8078,1.65316,81.1893,71.1122,1.885,59.0952,51.9078,4.64658,,,0.85,0.875,0.950;1.006,0.9504,0.85,2.65,0.822,0.8219,0.85,0.85,0.85,0.294024,0.293808,,,,
+b1_m1.84_pos0.5,b1,primary,1.84,pos,0.5,54,0.0025,1,0.5,97.206,3.99897,81.1893,,,59.0952,51.4993,3.03475,,,1.25,1.25,0.982,0.9824,1.25,1.25,0.982,0.9815,1.25,1.25,1.25,0.278779,0.278422,,,,
+b1_m1.84_pos0.6,b1,primary,1.84,pos,0.6,54,0.0025,1,0.5,102.611,6.28011,81.1893,82.6579,5.655,59.0952,51.1333,2.14619,,,1.65,1.65,1.278;1.334,1.3344,1.65,1.65,0.670;1.285,1.2846,1.65,1.65,1.65,0.232829,0.232134,,,,
+b1_m1.84_pos0.7,b1,primary,1.84,pos,0.7,54,0.0025,1,0.5,111.354,6.58642,81.1893,89.0198,6.833,59.0952,50.4149,1.63432,,,1.7,1.7,1.390;1.446,1.4464,1.7,1.7,0.702;1.404;1.460,1.46,1.7,1.7,1.7,0.254988,0.254675,,,,
+b1_m1.84_pos0.8,b1,primary,1.84,pos,0.8,54,0.0025,1,0.5,117.248,5.44981,81.1893,95.7352,9.072,59.0952,49.7613,1.2929,,,2.15,2.15,1.582;1.638;1.694,1.6944,2.15,2.15,0.822;1.612,1.6116,2.15,2.15,2.15,0.202551,0.200234,,,,
+b1_m1.84_pos0.9,b1,primary,1.84,pos,0.9,54,0.0025,1,0.5,128.23,5.4304,81.1893,104.807,11.781,59.0952,51.3579,0.943261,,,2.2,2.25,1.734;1.822,1.8223,2.2,2.25,0.766;1.827,1.827,2.2,2.2,2.2,0.223181,0.221544,,,,
+b1_m1.84_pos1,b1,primary,1.84,pos,1,54,0.0025,1,0.5,138.562,7.35885,81.1893,111.876,13.195,59.0952,50.6823,0.790197,,,2.4,2.4,1.958;2.014,2.0143,2.4,2.4,0.830;1.947,1.9466,2.4,2.4,2.4,0.230163,0.228669,,,,
+b1_m1.84_pos1.1,b1,primary,1.84,pos,1.1,54,0.0025,1,0.5,148.977,11.1622,81.1893,123.893,16.258,59.0952,49.9679,0.676799,,,2.7,2.7,2.046,2.0463,2.7,2.7,1.994,1.9945,2.7,2.7,2.7,0.228494,0.227725,,,,
+b1_m1.84_pos1.2,b1,primary,1.84,pos,1.2,54,0.0025,1,0.5,161.442,12.2877,81.1893,133.082,18.379,59.0952,49.2552,0.589421,,,2.9,2.9,2.278,2.2783,2.9,2.9,2.050,2.0503,2.9,2.9,2.9,0.236213,0.234689,,,,
+b1_m1.84_pos1.3,b1,primary,1.84,pos,1.3,54,0.0025,1,0.5,172.672,13.2286,81.1893,144.039,19.675,59.0952,48.5104,0.521466,,,3.35,3.35,2.310;2.422;2.486,2.4863,3.35,3.35,2.234,2.2337,3.35,3.35,3.35,0.233991,0.231738,,,,
+b1_m1.84_pos1.4,b1,primary,1.84,pos,1.4,54,0.0025,1,0.5,188.787,16.9118,81.1893,154.877,23.68,59.0952,47.7798,0.466616,,,3.55,3.55,2.454;2.574,2.5743,3.55,3.55,2.345,2.3454,3.55,3.55,3.55,0.248269,0.245969,,,,
+b1_m1.84_neg0.2,b1,primary,1.84,neg,0.2,54,0.0025,1,0.5,77.5835,0.380754,81.1893,58.8555,1.827,61.7794,53.4401,17.2283,66.2898,8.95099,,,,,,,,,0.4,0.4,0.4,0.452471,0.451603,0.4,0.4,0.376;0.445,0.3759
+b1_m1.84_neg0.3,b1,primary,1.84,neg,0.3,54,0.0025,1,0.5,74.351,1.25332,81.1893,55.6182,2.036,61.7794,54.1917,7.378,64.8362,4.30484,,,,,,,,,0.75,0.75,0.75,0.364583,0.364234,0.75,0.75,0.599;0.647;0.652,0.6523
+b1_m1.84_neg0.4,b1,primary,1.84,neg,0.4,54,0.0025,1,0.5,66.3728,1.82298,81.1893,51.2322,3.185,61.7794,55.1275,3.96276,58.2949,3.38736,,,,,,,,,0.75,0.75,0.75,0.51534,0.515239,0.75,0.8,0.860,0.8596
+b1_m1.84_neg0.5,b1,primary,1.84,neg,0.5,54,0.0025,1,0.5,61.3014,3.739,81.1893,47.8383,,61.7794,54.4635,2.62067,59.0217,2.09067,,,,,,,,,1.1,1.1,1.1,0.361778,0.361137,1.1,1.1,0.860;1.067,1.067
+b1_m1.84_neg0.6,b1,primary,1.84,neg,0.6,54,0.0025,1,0.5,45.2312,3.60092,81.1893,41.6771,4.177,61.7794,52.1771,2.03774,54.1763,1.8459,,,,,,,,,1.1,1.1,1.1,0.412343,0.41208,1.1,1.1,1.056;1.078,1.0776
+b1_m1.84_neg0.7,b1,primary,1.84,neg,0.7,54,0.0025,1,0.5,39.7423,6.25808,81.1893,40.685,3.812,61.7794,47.9008,1.85501,46.4236,2.00074,,,,,,,,,1.2,1.2,1.7,1.50073,0.353537,1.2,1.75,0.732;0.987,0.9872
+b1_m1.84_neg0.8,b1,primary,1.84,neg,0.8,54,0.0025,1,0.5,36.3453,5.99557,81.1893,40.9461,4.908,61.7794,36.4359,2.66003,38.671,2.33222,,,,,,,,,1.4,1.4,1.4,0.625166,0.458806,1.4,1.4,0.870,0.8703
+b1_m1.84_neg0.9,b1,primary,1.84,neg,0.9,54,0.0025,1,0.5,39.4287,8.51141,81.1893,42.6692,6.422,61.7794,35.0859,2.2823,35.2792,2.25518,,,,,,,,,1.75,1.75,1.75,0.487621,0.401164,1.75,1.75,0.838,0.8384
+b1_m1.84_neg1,b1,primary,1.84,neg,1,54,0.0025,1,0.5,46.0085,8.90145,81.1893,42.1992,6.161,61.7794,30.2035,2.54896,30.4338,2.50826,,,,,,,,,1.45,1.45,1.45,0.640768,0.633602,1.45,1.45,0.769;0.790,0.7905
+b1_m1.84_neg1.1,b1,primary,1.84,neg,1.1,54,0.0025,1,0.5,47.0611,8.11609,81.1893,44.1312,6.109,61.7794,28.2051,2.43371,28.0111,2.46921,,,,,,,,,1.7,1.7,1.7,0.460818,0.457059,1.7,1.7,1.099;1.120;1.157,1.1574
+b1_m1.84_neg1.2,b1,primary,1.84,neg,1.2,54,0.0025,1,0.5,54.2003,7.26079,81.1893,46.1153,6.109,61.7794,25.3593,2.55351,25.1038,2.60778,,,,,,,,,1.7,1.7,1.7,0.478409,0.475229,1.7,1.7,1.083,1.0829
+b1_m1.84_neg1.3,b1,primary,1.84,neg,1.3,54,0.0025,1,0.5,68.1528,7.23587,81.1893,47.0551,5.9,61.7794,22.4299,2.80432,23.1657,2.62387,,,,,,,,,1.55,1.55,1.55,0.712186,0.708497,1.55,1.55,1.046;1.067,1.067
+b1_m1.84_neg1.4,b1,primary,1.84,neg,1.4,54,0.0025,1,0.5,68.3621,7.80477,81.1893,49.457,6.944,61.7794,22.0258,2.51016,22.1966,2.4706,,,,,,,,,1.45,1.85,1.85,0.60034,0.596298,1.85,1.85,1.099;1.115;1.136,1.1361
+wake_m1.12_pos0.2,wake,primary,1.12,pos,0.2,54,0.0025,1,0.5,16.661,0.170801,15.0821,15.2686,,13.3836,51.822,2.58997,,,0.65,0.65,,,0.65,0.65,0.527,0.5268,0.65,0.65,0.65,0.115981,0.115959,,,,
+wake_m1.12_pos0.3,wake,primary,1.12,pos,0.3,54,0.0025,1,0.5,18.4945,0.246897,15.0821,17.6249,1.414,13.3836,50.6199,1.22207,,,0.75,0.75,0.814,0.8144,0.75,0.75,,,0.75,0.75,0.75,0.141841,0.141796,,,,
+wake_m1.12_pos0.4,wake,primary,1.12,pos,0.4,54,0.0025,1,0.5,20.849,0.409665,15.0821,21.3949,2.356,13.3836,51.506,0.657736,,,1.05,1.05,0.806,0.8064,1.05,1.05,,,1.05,1.05,1.05,0.100873,0.100827,,,,
+wake_m1.12_pos0.5,wake,primary,1.12,pos,0.5,54,0.0025,1,0.5,23.6381,0.42611,15.0821,25.8718,3.534,13.3836,50.2137,0.448967,,,1.45,1.45,1.110,1.1104,1.45,1.45,0.870,0.8698,1.45,1.45,1.45,0.0723722,0.0723298,,,,
+wake_m1.12_pos0.6,wake,primary,1.12,pos,0.6,54,0.0025,1,0.5,26.8303,0.45461,15.0821,31.5269,4.477,13.3836,48.8897,0.333224,,,1.8,1.8,,,1.8,1.8,0.989,0.9894,1.8,1.8,1.8,0.0665012,0.0664786,,,,
+wake_m1.12_pos0.7,wake,primary,1.12,pos,0.7,54,0.0025,1,0.5,30.406,0.461556,15.0821,36.9463,6.126,13.3836,47.5924,0.261468,,,2.2,2.2,,,2.2,2.2,1.125,1.125,2.2,2.2,2.2,0.061609,0.0615921,,,,
+wake_m1.12_pos0.8,wake,primary,1.12,pos,0.8,54,0.0025,1,0.5,34.2969,0.752786,15.0821,45.311,7.893,13.3836,46.4124,0.212671,,,2.7,2.7,,,2.7,2.7,1.277,1.2766,2.7,2.7,2.7,0.0551598,0.0551403,,,,
+wake_m1.12_pos0.9,wake,primary,1.12,pos,0.9,54,0.0025,1,0.5,38.9532,3.94744,15.0821,53.2045,10.132,13.3836,45.1656,0.17927,,,2.8,2.8,,,2.8,2.8,1.572,1.5717,2.8,2.8,2.8,0.0924481,0.0924292,,,,
+wake_m1.12_pos1,wake,primary,1.12,pos,1,54,0.0025,1,0.5,43.5717,4.18102,15.0821,60.7446,12.017,13.3836,41.1332,0.180275,,,3,3,,,3,3,1.643,1.6435,3,3,3,0.0904283,0.0904264,,,,
+wake_m1.12_pos1.1,wake,primary,1.12,pos,1.1,54,0.0025,1,0.5,48.5331,4.22874,15.0821,69.2271,14.373,13.3836,40.1994,0.156932,,,3.5,3.5,,,3.5,3.5,1.747,1.7472,1.2,3.5,3.5,0.0908766,0.0908747,,,,
+wake_m1.12_pos1.2,wake,primary,1.12,pos,1.2,54,0.0025,1,0.5,54.1453,4.47332,15.0821,80.1838,16.612,13.3836,39.3656,0.138222,,,3.7,3.7,2.118;2.350,2.3503,3.7,3.7,1.739,1.7392,1.3,3.7,3.7,0.0955076,0.0955059,,,,
+wake_m1.12_pos1.3,wake,primary,1.12,pos,1.3,54,0.0025,1,0.5,59.9828,4.30422,15.0821,90.9048,18.615,13.3836,38.6897,0.122419,,,3.9,3.9,,,3.9,3.9,1.699,1.6993,1.35,3.9,3.9,0.08576,0.0857565,,,,
+wake_m1.12_pos1.4,wake,primary,1.12,pos,1.4,54,0.0025,1,0.5,66.5193,4.3679,15.0821,101.979,21.678,13.3836,38.1281,0.109042,,,4.45,4.45,2.302,2.3023,1.5,4.45,1.811,1.811,1.5,4.45,4.45,0.0895442,0.0895351,,,,
+wake_m1.12_neg0.2,wake,primary,1.12,neg,0.2,54,0.0025,1,0.5,13.382,0.159206,15.0821,7.7903,0.992,11.4975,54.2897,2.29229,,,,,,,,,,,0.65,0.65,0.65,0.145324,0.145322,0.65,0.65,,
+wake_m1.12_neg0.3,wake,primary,1.12,neg,0.3,54,0.0025,1,0.5,10.908,0.381385,15.0821,6.3283,0.783,11.4975,56.311,0.922007,44.7277,1.65088,,,,,,,,,0.75,0.75,0.75,0.19522,0.195196,0.75,0.75,,
+wake_m1.12_neg0.4,wake,primary,1.12,neg,0.4,54,0.0025,1,0.5,6.60157,0.618627,15.0821,6.6938,,11.4975,60.0522,0.430415,33.0988,1.81846,,,,,,,,,1.1,1.1,1.1,2.17459,0.330561,1.05,1.1,0.344,0.344
+wake_m1.12_neg0.5,wake,primary,1.12,neg,0.5,54,0.0025,1,0.5,8.96422,1.04159,15.0821,7.216,0.835,11.4975,33.3284,1.14665,25.3461,2.04307,,,,,,,,,0.3,1,1,5.84594,0.477238,1,1.05,0.376,0.3759
+wake_m1.12_neg0.6,wake,primary,1.12,neg,0.6,54,0.0025,1,0.5,9.46979,0.337079,15.0821,8.3124,0.783,11.4975,28.5169,1.1091,19.5316,2.42581,,,,,,,,,0.95,0.95,0.95,0.503508,0.171016,0.95,0.95,0.344;0.535,0.5354
+wake_m1.12_neg0.7,wake,primary,1.12,neg,0.7,54,0.0025,1,0.5,11.7779,0.494708,15.0821,13.2728,1.253,11.4975,15.8764,2.71667,,,,,,,,,,,1.05,1.05,1.05,0.375011,0.128873,1.05,2.25,0.445;0.876,0.8756
+wake_m1.12_neg0.8,wake,primary,1.12,neg,0.8,54,0.0025,1,0.5,13.9601,1.06802,15.0821,16.249,2.036,11.4975,6.55674,12.3303,13.4749,2.89837,,,,,,,,,1.05,1.05,2.35,0.132718,0.129969,1.05,2.35,0.392;0.907,0.9075
+wake_m1.12_neg0.9,wake,primary,1.12,neg,0.9,54,0.0025,1,0.5,16.9286,1.22128,15.0821,22.9845,4.073,11.4975,14.8527,1.88097,,,,,,,,,,,0.9,0.9,0.9,0.181414,0.181246,0.9,2.85,1.131,1.1308
+wake_m1.12_neg1,wake,primary,1.12,neg,1,54,0.0025,1,0.5,20.804,1.93042,15.0821,28.0493,4.229,11.4975,21.4908,0.71804,12.0212,2.33529,,,,,,,,,1,1,1,0.229624,0.229614,1,3.05,1.296,1.2956
+wake_m1.12_neg1.1,wake,primary,1.12,neg,1.1,54,0.0025,1,0.5,25.1048,2.2469,15.0821,34.4716,5.326,11.4975,27.4711,0.356885,12.2635,1.85391,,,,,,,,,1.1,1.1,1.1,0.215837,0.215836,1.1,3.25,1.450,1.4498
+wake_m1.12_neg1.2,wake,primary,1.12,neg,1.2,54,0.0025,1,0.5,29.935,2.70359,15.0821,41.5205,6.736,11.4975,29.4392,0.259292,12.2635,1.5578,,,,,,,,,0.95,0.95,0.95,0.272134,0.271988,0.95,3.8,1.599,1.5986
+wake_m1.12_neg1.3,wake,primary,1.12,neg,1.3,54,0.0025,1,0.5,35.507,3.48301,15.0821,49.8747,8.72,11.4975,30.9032,0.199355,11.5367,1.50123,,,,,,,,,1.05,1.05,1.05,0.260566,0.26054,1.05,4,1.753,1.7528
+wake_m1.12_neg1.4,wake,primary,1.12,neg,1.4,54,0.0025,1,0.5,41.5115,4.09762,15.0821,58.2811,,11.4975,31.9795,0.159801,11.5367,1.29443,,,,,,,,,1.15,1.15,4.2,0.241753,0.24172,1.15,4.25,,
+wake_m1.84_pos0.2,wake,primary,1.84,pos,0.2,54,0.0025,1,0.5,82.8629,0.0687709,81.1893,67.1065,,59.0952,53.0689,17.5475,,,0.4,0.45,,,0.4,0.45,,,0.4,0.4,0.4,0.16757,0.167172,,,,
+wake_m1.84_pos0.3,wake,primary,1.84,pos,0.3,54,0.0025,1,0.5,85.0724,0.672893,81.1893,68.2846,1.178,59.0952,52.7721,7.91423,,,0.8,0.8,0.662;0.718,0.7184,0.8,0.8,0.678,0.6784,0.8,0.8,0.8,0.22153,0.2215,,,,
+wake_m1.84_pos0.4,wake,primary,1.84,pos,0.4,54,0.0025,1,0.5,87.844,1.44613,81.1893,71.1122,1.885,59.0952,52.4521,4.52285,,,1.2,1.2,0.950;1.006,1.0064,1.2,1.2,0.822,0.8219,1.2,1.2,1.2,0.157132,0.157128,,,,
+wake_m1.84_pos0.5,wake,primary,1.84,pos,0.5,54,0.0025,1,0.5,91.4428,2.03103,81.1893,,,59.0952,52.0287,2.95603,,,1.25,1.25,0.982,0.9824,1.25,1.25,0.982,0.9815,1.25,1.25,1.25,0.182603,0.182547,,,,
+wake_m1.84_pos0.6,wake,primary,1.84,pos,0.6,54,0.0025,1,0.5,95.5815,3.47034,81.1893,82.6579,5.655,59.0952,51.5628,2.10083,,,1.7,1.7,1.278;1.334,1.3344,1.7,1.7,0.670;1.285,1.2846,1.7,1.7,1.7,0.143667,0.143664,,,,
+wake_m1.84_pos0.7,wake,primary,1.84,pos,0.7,54,0.0025,1,0.5,100.171,3.55503,81.1893,89.0198,6.833,59.0952,51.0453,1.58372,,,1.8,1.8,1.390;1.446,1.4464,1.8,1.8,0.702;1.404;1.460,1.46,1.8,1.8,1.8,0.13306,0.13306,,,,
+wake_m1.84_pos0.8,wake,primary,1.84,pos,0.8,54,0.0025,1,0.5,105.591,4.94124,81.1893,95.7352,9.072,59.0952,50.4405,1.24968,,,2.25,2.25,1.582;1.638;1.694,1.6944,2.25,2.25,0.822;1.612,1.6116,2.25,2.25,2.25,0.116867,0.116857,,,,
+wake_m1.84_pos0.9,wake,primary,1.84,pos,0.9,54,0.0025,1,0.5,111.216,5.00462,81.1893,104.807,11.781,59.0952,49.8015,1.01949,,,2.7,2.75,1.734;1.822,1.8223,2.7,2.75,0.766;1.827,1.827,2.7,2.7,2.7,0.0901874,0.0901867,,,,
+wake_m1.84_pos1,wake,primary,1.84,pos,1,54,0.0025,1,0.5,117.097,4.40724,81.1893,111.876,13.195,59.0952,49.1796,0.852003,,,3.25,3.25,1.958;2.014,2.0143,3.25,3.25,0.830;1.947,1.9466,3.25,3.25,3.25,0.0654489,0.0654455,,,,
+wake_m1.84_pos1.1,wake,primary,1.84,pos,1.1,54,0.0025,1,0.5,124.076,3.9978,81.1893,123.893,16.258,59.0952,48.5429,0.727131,,,3.35,3.35,2.046,2.0463,3.35,3.35,1.994,1.9945,3.35,3.35,3.35,0.0775094,0.0775043,,,,
+wake_m1.84_pos1.2,wake,primary,1.84,pos,1.2,54,0.0025,1,0.5,130.962,2.65824,81.1893,133.082,18.379,59.0952,50.2617,0.560397,,,3.85,3.85,2.278,2.2783,3.85,3.85,2.050,2.0503,3.85,3.85,3.85,0.0603488,0.060347,,,,
+wake_m1.84_pos1.3,wake,primary,1.84,pos,1.3,54,0.0025,1,0.5,138.232,1.64084,81.1893,144.039,19.675,59.0952,49.751,0.48987,,,4.35,4.35,2.310;2.422;2.486,2.4863,4.35,4.35,2.234,2.2337,4.35,4.35,4.35,0.0469925,0.0469611,,,,
+wake_m1.84_pos1.4,wake,primary,1.84,pos,1.4,54,0.0025,1,0.5,146.368,1.67264,81.1893,154.877,23.68,59.0952,49.1593,0.435141,,,4.6,4.6,2.454;2.574,2.5743,4.6,4.6,2.345,2.3454,4.6,4.6,4.6,0.0555173,0.055509,,,,
+wake_m1.84_neg0.2,wake,primary,1.84,neg,0.2,54,0.0025,1,0.5,79.5154,0.030973,81.1893,58.8555,1.827,61.7794,53.4513,17.2188,66.2898,8.95099,,,,,,,,,0.45,0.45,0.45,0.139498,0.138974,0.45,0.45,0.376;0.445,0.445
+wake_m1.84_neg0.3,wake,primary,1.84,neg,0.3,54,0.0025,1,0.5,77.2669,0.240443,81.1893,55.6182,2.036,61.7794,53.732,7.54741,64.8362,4.30484,,,,,,,,,0.75,0.75,0.75,0.222992,0.222692,0.75,0.75,0.599;0.647;0.652,0.6523
+wake_m1.84_neg0.4,wake,primary,1.84,neg,0.4,54,0.0025,1,0.5,74.2509,1.44239,81.1893,51.2322,3.185,61.7794,54.0402,4.18129,58.2949,3.38736,,,,,,,,,1.15,1.15,1.15,0.208451,0.208451,1.15,1.15,0.860,0.8596
+wake_m1.84_neg0.5,wake,primary,1.84,neg,0.5,54,0.0025,1,0.5,70.2035,1.43578,81.1893,47.8383,,61.7794,54.4837,2.61807,59.0217,2.09067,,,,,,,,,1.2,1.2,1.2,0.196587,0.196575,1.2,1.2,0.860;1.067,1.067
+wake_m1.84_neg0.6,wake,primary,1.84,neg,0.6,54,0.0025,1,0.5,64.8811,3.65972,81.1893,41.6771,4.177,61.7794,54.8751,1.78331,54.1763,1.8459,,,,,,,,,1.6,1.6,1.6,0.191176,0.191176,1.6,1.6,1.056;1.078,1.0776
+wake_m1.84_neg0.7,wake,primary,1.84,neg,0.7,54,0.0025,1,0.5,58.317,4.84428,81.1893,40.685,3.812,61.7794,54.8843,1.30959,46.4236,2.00074,,,,,,,,,2,2,2,0.155515,0.155451,2,2,0.732;0.987,0.9872
+wake_m1.84_neg0.8,wake,primary,1.84,neg,0.8,54,0.0025,1,0.5,49.3009,4.47424,81.1893,40.9461,4.908,61.7794,54.7239,1.01063,38.671,2.33222,,,,,,,,,2.05,2.05,2.05,0.202368,0.20236,2.05,2.05,0.870,0.8703
+wake_m1.84_neg0.9,wake,primary,1.84,neg,0.9,54,0.0025,1,0.5,37.3182,4.25987,81.1893,42.6692,6.422,61.7794,52.5411,0.889474,35.2792,2.25518,,,,,,,,,2.05,2.05,2.05,0.193915,0.193915,2.05,2.05,0.838,0.8384
+wake_m1.84_neg1,wake,primary,1.84,neg,1,54,0.0025,1,0.5,37.4836,4.76732,81.1893,42.1992,6.161,61.7794,40.8471,1.31996,30.4338,2.50826,,,,,,,,,2.2,2.2,2.35,3.2332,0.211639,2.2,2.2,0.769;0.790,0.7905
+wake_m1.84_neg1.1,wake,primary,1.84,neg,1.1,54,0.0025,1,0.5,39.0213,5.38894,81.1893,44.1312,6.109,61.7794,37.0466,1.3565,28.0111,2.46921,,,,,,,,,2.1,2.1,2.1,0.368666,0.245915,2.1,2.1,1.099;1.120;1.157,1.1574
+wake_m1.84_neg1.2,wake,primary,1.84,neg,1.2,54,0.0025,1,0.5,39.1552,8.37672,81.1893,46.1153,6.109,61.7794,34.1276,1.3632,25.1038,2.60778,,,,,,,,,0.3,2.25,2.35,2.30002,0.381694,2.35,2.35,1.083,1.0829
+wake_m1.84_neg1.3,wake,primary,1.84,neg,1.3,54,0.0025,1,0.5,44.7781,4.40543,81.1893,47.0551,5.9,61.7794,32.5513,1.28597,23.1657,2.62387,,,,,,,,,2.35,2.35,2.35,0.79893,0.241826,2.35,2.35,1.046;1.067,1.067
+wake_m1.84_neg1.4,wake,primary,1.84,neg,1.4,54,0.0025,1,0.5,49.7178,4.63371,81.1893,49.457,6.944,61.7794,30.6402,1.2615,22.1966,2.4706,,,,,,,,,2.45,2.45,2.45,0.239212,0.237978,2.45,2.45,1.099;1.115;1.136,1.1361
+none_m1.12_pos0.2,none,primary,1.12,pos,0.2,54,0.0025,1,0.5,16.6043,3.23758e-06,15.0821,15.2686,,13.3836,51.8709,2.58369,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos0.3,none,primary,1.12,pos,0.3,54,0.0025,1,0.5,18.3818,3.17243e-06,15.0821,17.6249,1.414,13.3836,50.6819,1.21829,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos0.4,none,primary,1.12,pos,0.4,54,0.0025,1,0.5,20.6968,2.86669e-06,15.0821,21.3949,2.356,13.3836,51.5577,0.656047,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos0.5,none,primary,1.12,pos,0.5,54,0.0025,1,0.5,23.469,2.72735e-06,15.0821,25.8718,3.534,13.3836,50.2748,0.447596,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos0.6,none,primary,1.12,pos,0.6,54,0.0025,1,0.5,26.6401,2.51769e-06,15.0821,31.5269,4.477,13.3836,48.9658,0.331948,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos0.7,none,primary,1.12,pos,0.7,54,0.0025,1,0.5,30.1751,2.20194e-06,15.0821,36.9463,6.126,13.3836,47.6875,0.260204,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos0.8,none,primary,1.12,pos,0.8,54,0.0025,1,0.5,34.0521,2.77975e-06,15.0821,45.311,7.893,13.3836,46.4745,0.211992,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos0.9,none,primary,1.12,pos,0.9,54,0.0025,1,0.5,38.2471,2.29357e-06,15.0821,53.2045,10.132,13.3836,45.3418,0.177628,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos1,none,primary,1.12,pos,1,54,0.0025,1,0.5,42.6878,2.03627e-06,15.0821,60.7446,12.017,13.3836,41.2962,0.178663,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos1.1,none,primary,1.12,pos,1.1,54,0.0025,1,0.5,47.5589,1.85755e-06,15.0821,69.2271,14.373,13.3836,40.3255,0.155827,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos1.2,none,primary,1.12,pos,1.2,54,0.0025,1,0.5,52.8881,7.71361e-07,15.0821,80.1838,16.612,13.3836,39.4965,0.137199,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos1.3,none,primary,1.12,pos,1.3,54,0.0025,1,0.5,58.6774,7.68674e-07,15.0821,90.9048,18.615,13.3836,38.7926,0.121696,,,,,,,,,,,,,,,,,,,
+none_m1.12_pos1.4,none,primary,1.12,pos,1.4,54,0.0025,1,0.5,64.9281,1.52201e-06,15.0821,101.979,21.678,13.3836,38.1962,0.108611,,,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.2,none,primary,1.12,neg,0.2,54,0.0025,1,0.5,13.4376,7.40944e-07,15.0821,7.7903,0.992,11.4975,54.2478,2.29705,,,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.3,none,primary,1.12,neg,0.3,54,0.0025,1,0.5,11.1065,4.48659e-06,15.0821,6.3283,0.783,11.4975,56.1727,0.928331,44.7277,1.65088,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.4,none,primary,1.12,neg,0.4,54,0.0025,1,0.5,6.81533,0.00863582,15.0821,6.6938,,11.4975,61.5378,0.399159,33.0988,1.81846,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.5,none,primary,1.12,neg,0.5,54,0.0025,1,0.5,6.23557,0.573704,15.0821,7.216,0.835,11.4975,61.1706,0.260294,25.3461,2.04307,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.6,none,primary,1.12,neg,0.6,54,0.0025,1,0.5,7.28736,1.79831,15.0821,8.3124,0.783,11.4975,21.7193,1.9517,19.5316,2.42581,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.7,none,primary,1.12,neg,0.7,54,0.0025,1,0.5,11.4101,8.93115e-05,15.0821,13.2728,1.253,11.4975,17.1159,2.33225,,,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.8,none,primary,1.12,neg,0.8,54,0.0025,1,0.5,13.6453,4.28707e-05,15.0821,16.249,2.036,11.4975,6.55053,12.3538,13.4749,2.89837,,,,,,,,,,,,,,,,,
+none_m1.12_neg0.9,none,primary,1.12,neg,0.9,54,0.0025,1,0.5,16.4367,1.2183e-05,15.0821,22.9845,4.073,11.4975,13.9295,2.1416,,,,,,,,,,,,,,,,,,,
+none_m1.12_neg1,none,primary,1.12,neg,1,54,0.0025,1,0.5,19.8921,1.57349e-06,15.0821,28.0493,4.229,11.4975,20.3341,0.80427,12.0212,2.33529,,,,,,,,,,,,,,,,,
+none_m1.12_neg1.1,none,primary,1.12,neg,1.1,54,0.0025,1,0.5,23.9958,7.10543e-15,15.0821,34.4716,5.326,11.4975,23.2415,0.505089,12.2635,1.85391,,,,,,,,,,,,,,,,,
+none_m1.12_neg1.2,none,primary,1.12,neg,1.2,54,0.0025,1,0.5,28.6936,0,15.0821,41.5205,6.736,11.4975,28.5876,0.275833,12.2635,1.5578,,,,,,,,,,,,,,,,,
+none_m1.12_neg1.3,none,primary,1.12,neg,1.3,54,0.0025,1,0.5,33.9438,0,15.0821,49.8747,8.72,11.4975,30.177,0.20967,11.5367,1.50123,,,,,,,,,,,,,,,,,
+none_m1.12_neg1.4,none,primary,1.12,neg,1.4,54,0.0025,1,0.5,39.7142,7.10543e-15,15.0821,58.2811,,11.4975,31.401,0.166147,11.5367,1.29443,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.2,none,primary,1.84,pos,0.2,54,0.0025,1,0.5,82.7919,4.68702e-06,81.1893,67.1065,,59.0952,53.0657,17.5503,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.3,none,primary,1.84,pos,0.3,54,0.0025,1,0.5,84.7097,4.61432e-06,81.1893,68.2846,1.178,59.0952,52.83,7.89158,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.4,none,primary,1.84,pos,0.4,54,0.0025,1,0.5,87.3875,4.32533e-06,81.1893,71.1122,1.885,59.0952,52.5027,4.51154,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.5,none,primary,1.84,pos,0.5,54,0.0025,1,0.5,90.7894,4.47444e-06,81.1893,,,59.0952,52.0927,2.94665,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.6,none,primary,1.84,pos,0.6,54,0.0025,1,0.5,94.7686,4.32785e-06,81.1893,82.6579,5.655,59.0952,51.6158,2.09531,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.7,none,primary,1.84,pos,0.7,54,0.0025,1,0.5,99.4023,4.4944e-06,81.1893,89.0198,6.833,59.0952,51.08,1.58098,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.8,none,primary,1.84,pos,0.8,54,0.0025,1,0.5,104.564,4.99424e-06,81.1893,95.7352,9.072,59.0952,50.5018,1.24585,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos0.9,none,primary,1.84,pos,0.9,54,0.0025,1,0.5,110.246,4.97856e-06,81.1893,104.807,11.781,59.0952,49.8938,1.01478,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos1,none,primary,1.84,pos,1,54,0.0025,1,0.5,116.446,4.62493e-06,81.1893,111.876,13.195,59.0952,49.2686,0.848194,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos1.1,none,primary,1.84,pos,1.1,54,0.0025,1,0.5,123.102,4.82939e-06,81.1893,123.893,16.258,59.0952,48.6363,0.723703,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos1.2,none,primary,1.84,pos,1.2,54,0.0025,1,0.5,130.17,4.93996e-06,81.1893,133.082,18.379,59.0952,50.3481,0.557981,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos1.3,none,primary,1.84,pos,1.3,54,0.0025,1,0.5,137.673,4.58367e-06,81.1893,144.039,19.675,59.0952,49.7942,0.48881,,,,,,,,,,,,,,,,,,,
+none_m1.84_pos1.4,none,primary,1.84,pos,1.4,54,0.0025,1,0.5,145.589,4.9991e-06,81.1893,154.877,23.68,59.0952,49.2458,0.433248,,,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.2,none,primary,1.84,neg,0.2,54,0.0025,1,0.5,79.5571,4.94942e-06,81.1893,58.8555,1.827,61.7794,53.4565,17.2144,66.2898,8.95099,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.3,none,primary,1.84,neg,0.3,54,0.0025,1,0.5,77.5119,4.69369e-06,81.1893,55.6182,2.036,61.7794,53.7009,7.55902,64.8362,4.30484,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.4,none,primary,1.84,neg,0.4,54,0.0025,1,0.5,74.6379,4.15719e-06,81.1893,51.2322,3.185,61.7794,54.0336,4.18265,58.2949,3.38736,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.5,none,primary,1.84,neg,0.5,54,0.0025,1,0.5,70.6578,4.34354e-06,81.1893,47.8383,,61.7794,54.4668,2.62024,59.0217,2.09067,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.6,none,primary,1.84,neg,0.6,54,0.0025,1,0.5,65.6525,4.30444e-06,81.1893,41.6771,4.177,61.7794,54.9187,1.77947,54.1763,1.8459,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.7,none,primary,1.84,neg,0.7,54,0.0025,1,0.5,59.2085,4.2832e-06,81.1893,40.685,3.812,61.7794,54.9252,1.30695,46.4236,2.00074,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.8,none,primary,1.84,neg,0.8,54,0.0025,1,0.5,50.6914,4.0385e-06,81.1893,40.9461,4.908,61.7794,55.0849,0.992776,38.671,2.33222,,,,,,,,,,,,,,,,,
+none_m1.84_neg0.9,none,primary,1.84,neg,0.9,54,0.0025,1,0.5,38.7879,0.000180165,81.1893,42.6692,6.422,61.7794,51.9741,0.914828,35.2792,2.25518,,,,,,,,,,,,,,,,,
+none_m1.84_neg1,none,primary,1.84,neg,1,54,0.0025,1,0.5,24.3491,0.0250707,81.1893,42.1992,6.161,61.7794,26.3547,3.39395,30.4338,2.50826,,,,,,,,,,,,,,,,,
+none_m1.84_neg1.1,none,primary,1.84,neg,1.1,54,0.0025,1,0.5,29.1183,6.4681,81.1893,44.1312,6.109,61.7794,39.3439,1.18697,28.0111,2.46921,,,,,,,,,,,,,,,,,
+none_m1.84_neg1.2,none,primary,1.84,neg,1.2,54,0.0025,1,0.5,28.2123,5.17866,81.1893,46.1153,6.109,61.7794,34.8255,1.30473,25.1038,2.60778,,,,,,,,,,,,,,,,,
+none_m1.84_neg1.3,none,primary,1.84,neg,1.3,54,0.0025,1,0.5,29.2292,5.51833,81.1893,47.0551,5.9,61.7794,32.0851,1.32629,23.1657,2.62387,,,,,,,,,,,,,,,,,
+none_m1.84_neg1.4,none,primary,1.84,neg,1.4,54,0.0025,1,0.5,41.8815,3.14293e-05,81.1893,49.457,6.944,61.7794,30.1839,1.30228,22.1966,2.4706,,,,,,,,,,,,,,,,,
+uls19_m1.84_pos0.8_dt,uls19,half the time step,1.84,pos,0.8,54,0.00125,1,0.5,108.364,12.49,81.1893,95.7352,9.072,59.0952,49.9582,1.2802,,,1.65,1.675,1.582;1.638;1.694,1.6384,1.65,4.85,0.822;1.612,1.6116,1.65,1.65,1.65,0.29644,0.291208,,,,
+uls19_m1.84_pos0.8_n108,uls19,twice the elements,1.84,pos,0.8,108,0.0025,1,0.5,108.237,12.439,81.1893,95.7352,9.072,59.0952,50.9688,1.21717,,,1.65,1.65,1.582;1.638;1.694,1.6384,1.65,1.65,0.822;1.612,1.6116,1.65,1.65,1.65,0.304494,0.302059,,,,
+uls19_m1.12_neg1.2_dt,uls19,half the time step,1.12,neg,1.2,54,0.00125,1,0.5,35.7748,8.03099,15.0821,41.5205,6.736,11.4975,31.9474,0.217974,12.2635,1.5578,,,,,,,,,0.8,0.8,2.65,0.413355,0.407282,2.65,2.65,1.599,1.5986
+uls19_m1.12_neg1.2_n108,uls19,twice the elements,1.12,neg,1.2,108,0.0025,1,0.5,34.5143,6.895,15.0821,41.5205,6.736,11.4975,31.6511,0.222353,12.2635,1.5578,,,,,,,,,0.8,0.8,2.65,0.367172,0.363668,2.65,2.65,1.599,1.5986
+b1_m1.84_pos0.8_dt,b1,half the time step,1.84,pos,0.8,54,0.00125,1,0.5,117.209,5.58544,81.1893,95.7352,9.072,59.0952,49.7453,1.29394,,,2.15,2.15,1.582;1.638;1.694,1.6944,2.15,2.15,0.822;1.612,1.6116,2.15,2.15,2.15,0.201511,0.200155,,,,
+b1_m1.84_pos0.8_n108,b1,twice the elements,1.84,pos,0.8,108,0.0025,1,0.5,117.213,5.46316,81.1893,95.7352,9.072,59.0952,50.8827,1.2224,,,2.15,2.15,1.582;1.638;1.694,1.6944,2.15,2.15,0.822;1.612,1.6116,2.15,2.15,2.15,0.200439,0.199432,,,,
+b1_m1.12_neg1.2_dt,b1,half the time step,1.12,neg,1.2,54,0.00125,1,0.5,52.2549,8.25416,15.0821,41.5205,6.736,11.4975,31.6051,0.223043,12.2635,1.5578,,,,,,,,,0.95,2.8,2.8,0.304001,0.301326,2.8,2.8,1.599,1.5986
+b1_m1.12_neg1.2_n108,b1,twice the elements,1.12,neg,1.2,108,0.0025,1,0.5,50.1123,8.11487,15.0821,41.5205,6.736,11.4975,31.5557,0.223789,12.2635,1.5578,,,,,,,,,1.05,3.15,3.15,0.286081,0.283416,3.15,3.15,1.599,1.5986
+wake_m1.84_pos0.8_dt,wake,half the time step,1.84,pos,0.8,54,0.00125,1,0.5,105.59,4.93216,81.1893,95.7352,9.072,59.0952,50.4404,1.24968,,,2.25,2.25,1.582;1.638;1.694,1.6944,2.25,2.25,0.822;1.612,1.6116,2.25,2.25,2.25,0.116859,0.11685,,,,
+wake_m1.84_pos0.8_n108,wake,twice the elements,1.84,pos,0.8,108,0.0025,1,0.5,105.61,4.94639,81.1893,95.7352,9.072,59.0952,51.4551,1.18806,,,2.25,2.25,1.582;1.638;1.694,1.6944,2.25,2.25,0.822;1.612,1.6116,2.25,2.25,2.25,0.118043,0.118035,,,,
+wake_m1.12_neg1.2_dt,wake,half the time step,1.12,neg,1.2,54,0.00125,1,0.5,29.9379,2.69443,15.0821,41.5205,6.736,11.4975,29.4387,0.2593,12.2635,1.5578,,,,,,,,,0.95,0.95,0.95,0.272119,0.271972,0.95,3.8,1.599,1.5986
+wake_m1.12_neg1.2_n108,wake,twice the elements,1.12,neg,1.2,108,0.0025,1,0.5,29.9925,2.88835,15.0821,41.5205,6.736,11.4975,29.3614,0.260743,12.2635,1.5578,,,,,,,,,0.95,0.95,0.95,0.271317,0.27114,0.95,3.8,1.599,1.5986
+uls19_m1.12_pos0.4_undamped,uls19,no structural damping,1.12,pos,0.4,54,0.0025,0,0.5,21.3928,1.88607,15.0821,21.3949,2.356,13.3836,48.8433,0.751513,,,0.9,0.9,0.806,0.8064,0.9,2.45,,,0.9,0.9,0.9,0.247629,0.240026,,,,
+uls19_m1.12_pos0.4_frictionless,uls19,frictionless floor,1.12,pos,0.4,54,0.0025,1,0,21.8555,3.45141,15.0821,21.3949,2.356,13.3836,48.5353,0.763303,,,0.9,0.9,0.806,0.8064,0.9,2.6,,,0.9,0.9,0.9,0.313907,0.311185,,,,
+uls19_m1.12_pos0.8_undamped,uls19,no structural damping,1.12,pos,0.8,54,0.0025,0,0.5,37.3481,10.3058,15.0821,45.311,7.893,13.3836,43.0174,0.254224,,,1.75,1.75,,,1.75,1.75,1.277,1.2766,1.75,1.75,1.75,0.322832,0.311009,,,,
+uls19_m1.12_pos0.8_frictionless,uls19,frictionless floor,1.12,pos,0.8,54,0.0025,1,0,36.4663,6.64358,15.0821,45.311,7.893,13.3836,43.55,0.247081,,,1.75,3.45,,,1.75,1.75,1.277,1.2766,1.75,1.75,1.75,0.319515,0.316068,,,,
+uls19_m1.12_pos1.2_undamped,uls19,no structural damping,1.12,pos,1.2,54,0.0025,0,0.5,61.0498,18.9067,15.0821,80.1838,16.612,13.3836,39.1846,0.139654,,,2.6,2.6,2.118;2.350,2.3503,2.6,2.6,1.739,1.7392,2.6,2.6,2.6,0.331161,0.324869,,,,
+uls19_m1.12_pos1.2_frictionless,uls19,frictionless floor,1.12,pos,1.2,54,0.0025,1,0,60.5594,10.8583,15.0821,80.1838,16.612,13.3836,38.8029,0.14274,,,2.6,2.6,2.118;2.350,2.3503,2.6,2.6,1.739,1.7392,0.55,2.6,2.6,0.341742,0.33617,,,,
+uls19_m1.12_neg0.4_undamped,uls19,no structural damping,1.12,neg,0.4,54,0.0025,0,0.5,8.8567,1.656,15.0821,6.6938,,11.4975,46.3584,0.853058,33.0988,1.81846,,,,,,,,,0.6,0.75,0.75,4.64363,0.503556,0.6,2.15,0.344,0.344
+uls19_m1.12_neg0.4_frictionless,uls19,frictionless floor,1.12,neg,0.4,54,0.0025,1,0,9.26392,1.459,15.0821,6.6938,,11.4975,44.8655,0.921923,33.0988,1.81846,,,,,,,,,0.6,0.6,0.6,6.60654,0.467369,0.6,0.6,0.344,0.344
+uls19_m1.12_neg0.8_undamped,uls19,no structural damping,1.12,neg,0.8,54,0.0025,0,0.5,16.7678,6.73279,15.0821,16.249,2.036,11.4975,14.9658,2.34433,13.4749,2.89837,,,,,,,,,0.75,1.275,1.8,0.402196,0.338631,1.8,1.8,0.392;0.907,0.9075
+uls19_m1.12_neg0.8_frictionless,uls19,frictionless floor,1.12,neg,0.8,54,0.0025,1,0,15.8226,4.00728,15.0821,16.249,2.036,11.4975,11.4976,3.99136,13.4749,2.89837,,,,,,,,,0.75,0.75,1.8,0.362042,0.324763,0.75,1.8,0.392;0.907,0.9075
+uls19_m1.12_neg1.2_undamped,uls19,no structural damping,1.12,neg,1.2,54,0.0025,0,0.5,37.9354,22.0635,15.0821,41.5205,6.736,11.4975,32.2106,0.214185,12.2635,1.5578,,,,,,,,,0.75,0.85,2.75,0.327546,0.317727,2.7,2.75,1.599,1.5986
+uls19_m1.12_neg1.2_frictionless,uls19,frictionless floor,1.12,neg,1.2,54,0.0025,1,0,35.6849,8.18804,15.0821,41.5205,6.736,11.4975,31.8084,0.220013,12.2635,1.5578,,,,,,,,,0.8,0.8,2.7,0.392115,0.385611,2.7,2.7,1.599,1.5986
+uls19_m1.84_pos0.4_undamped,uls19,no structural damping,1.84,pos,0.4,54,0.0025,0,0.5,88.3884,2.78453,81.1893,71.1122,1.885,59.0952,52.3557,4.54451,,,0.8,0.8,0.950;1.006,0.9504,0.8,2.5,0.822,0.8219,0.8,0.8,0.8,0.3143,0.312724,,,,
+uls19_m1.84_pos0.4_frictionless,uls19,frictionless floor,1.84,pos,0.4,54,0.0025,1,0,88.3486,3.35209,81.1893,71.1122,1.885,59.0952,52.2918,4.55893,,,0.95,2.75,0.950;1.006,0.9504,0.95,0.95,0.822,0.8219,0.8,0.95,0.95,0.269728,0.267262,,,,
+uls19_m1.84_pos0.8_undamped,uls19,no structural damping,1.84,pos,0.8,54,0.0025,0,0.5,108.521,15.074,81.1893,95.7352,9.072,59.0952,50.065,1.27337,,,1.65,1.65,1.582;1.638;1.694,1.6384,1.65,4.85,0.822;1.612,1.6116,1.65,1.65,1.65,0.307563,0.303991,,,,
+uls19_m1.84_pos0.8_frictionless,uls19,frictionless floor,1.84,pos,0.8,54,0.0025,1,0,110.13,18.1144,81.1893,95.7352,9.072,59.0952,49.9047,1.28363,,,1.7,1.7,1.582;1.638;1.694,1.6944,1.7,1.7,0.822;1.612,1.6116,1.7,1.7,1.7,0.35277,0.351192,,,,
+uls19_m1.84_pos1.2_undamped,uls19,no structural damping,1.84,pos,1.2,54,0.0025,0,0.5,140.248,28.3793,81.1893,133.082,18.379,59.0952,47.2078,0.65393,,,2.5,2.5,2.278,2.2783,2.35,2.5,2.050,2.0503,2.35,2.5,2.5,0.312138,0.308185,,,,
+uls19_m1.84_pos1.2_frictionless,uls19,frictionless floor,1.84,pos,1.2,54,0.0025,1,0,138.66,21.53,81.1893,133.082,18.379,59.0952,47.5795,0.641633,,,2.4,2.4,2.278,2.2783,2.4,2.4,2.050,2.0503,2.4,2.4,2.4,0.390628,0.388757,,,,
+uls19_m1.84_neg0.4_undamped,uls19,no structural damping,1.84,neg,0.4,54,0.0025,0,0.5,73.5966,2.86567,81.1893,51.2322,3.185,61.7794,54.1093,4.16705,58.2949,3.38736,,,,,,,,,0.75,0.75,0.75,0.420917,0.41867,0.75,0.75,0.860,0.8596
+uls19_m1.84_neg0.4_frictionless,uls19,frictionless floor,1.84,neg,0.4,54,0.0025,1,0,73.6683,5.37917,81.1893,51.2322,3.185,61.7794,54.1395,4.16084,58.2949,3.38736,,,,,,,,,0.8,0.8,0.8,0.424085,0.423612,0.8,2.45,0.860,0.8596
+uls19_m1.84_neg0.8_undamped,uls19,no structural damping,1.84,neg,0.8,54,0.0025,0,0.5,46.0778,14.5493,81.1893,40.9461,4.908,61.7794,54.8792,1.00291,38.671,2.33222,,,,,,,,,1.35,1.35,1.35,0.529936,0.522378,1.35,1.35,0.870,0.8703
+uls19_m1.84_neg0.8_frictionless,uls19,frictionless floor,1.84,neg,0.8,54,0.0025,1,0,48.6101,13.6689,81.1893,40.9461,4.908,61.7794,53.0172,1.09952,38.671,2.33222,,,,,,,,,1.4,1.4,1.45,0.634717,0.633678,1.4,4.25,0.870,0.8703
+uls19_m1.84_neg1.2_undamped,uls19,no structural damping,1.84,neg,1.2,54,0.0025,0,0.5,44.1958,11.9873,81.1893,46.1153,6.109,61.7794,34.0096,1.37345,25.1038,2.60778,,,,,,,,,1.35,1.6,1.7,4.6224,0.603239,1.55,1.7,1.083,1.0829
+uls19_m1.84_neg1.2_frictionless,uls19,frictionless floor,1.84,neg,1.2,54,0.0025,1,0,46.4164,11.9361,81.1893,46.1153,6.109,61.7794,34.3262,1.34621,25.1038,2.60778,,,,,,,,,1.45,1.5,1.5,5.51625,1.01513,1.5,1.5,1.083,1.0829
+b1_m1.12_pos0.4_undamped,b1,no structural damping,1.12,pos,0.4,54,0.0025,0,0.5,23.9067,1.21375,15.0821,21.3949,2.356,13.3836,50.6311,0.687031,,,1,1,0.806,0.8064,1,1,,,1,1,1,0.217719,0.214648,,,,
+b1_m1.12_pos0.4_frictionless,b1,frictionless floor,1.12,pos,0.4,54,0.0025,1,0,25.0863,3.2076,15.0821,21.3949,2.356,13.3836,50.1993,0.702017,,,1,1,0.806,0.8064,1,1,,,1,1,1,0.330186,0.327051,,,,
+b1_m1.12_pos0.8_undamped,b1,no structural damping,1.12,pos,0.8,54,0.0025,0,0.5,48.4038,7.64849,15.0821,45.311,7.893,13.3836,40.4445,0.292659,,,2.05,2.05,,,2.05,2.05,1.277,1.2766,2.05,2.05,2.05,0.312905,0.311972,,,,
+b1_m1.12_pos0.8_frictionless,b1,frictionless floor,1.12,pos,0.8,54,0.0025,1,0,47.5073,6.78456,15.0821,45.311,7.893,13.3836,40.383,0.293666,,,2.05,2.05,,,2.05,2.05,1.277,1.2766,2.05,2.05,2.05,0.29501,0.292828,,,,
+b1_m1.12_pos1.2_undamped,b1,no structural damping,1.12,pos,1.2,54,0.0025,0,0.5,81.9444,11.0669,15.0821,80.1838,16.612,13.3836,36.6912,0.161548,,,3.05,3.05,2.118;2.350,2.3503,3.05,3.05,1.739,1.7392,3.05,3.05,3.05,0.268219,0.264878,,,,
+b1_m1.12_pos1.2_frictionless,b1,frictionless floor,1.12,pos,1.2,54,0.0025,1,0,80.3038,8.90782,15.0821,80.1838,16.612,13.3836,36.5813,0.162615,,,3.05,3.05,2.118;2.350,2.3503,3.05,3.05,1.739,1.7392,3.05,3.05,3.05,0.25997,0.2572,,,,
+b1_m1.12_neg0.4_undamped,b1,no structural damping,1.12,neg,0.4,54,0.0025,0,0.5,8.84126,1.15085,15.0821,6.6938,,11.4975,29.0706,2.39648,33.0988,1.81846,,,,,,,,,0.3,0.55,0.65,6.88438,0.348482,0.5,0.55,0.344,0.344
+b1_m1.12_neg0.4_frictionless,b1,frictionless floor,1.12,neg,0.4,54,0.0025,1,0,8.94046,1.40754,15.0821,6.6938,,11.4975,25.9909,3.02979,33.0988,1.81846,,,,,,,,,0.3,0.3,0.6,8.18006,0.515789,0.6,0.65,0.344,0.344
+b1_m1.12_neg0.8_undamped,b1,no structural damping,1.12,neg,0.8,54,0.0025,0,0.5,22.1587,5.44904,15.0821,16.249,2.036,11.4975,21.9267,1.0766,13.4749,2.89837,,,,,,,,,0.8,1.425,2.05,0.323273,0.313989,0.8,2.05,0.392;0.907,0.9075
+b1_m1.12_neg0.8_frictionless,b1,frictionless floor,1.12,neg,0.8,54,0.0025,1,0,20.7895,3.57533,15.0821,16.249,2.036,11.4975,20.3292,1.2573,13.4749,2.89837,,,,,,,,,0.8,2,2,0.293837,0.284045,2,2,0.392;0.907,0.9075
+b1_m1.12_neg1.2_undamped,b1,no structural damping,1.12,neg,1.2,54,0.0025,0,0.5,52.5927,14.3716,15.0821,41.5205,6.736,11.4975,32.2527,0.213587,12.2635,1.5578,,,,,,,,,1.05,3.2,3.2,0.314244,0.310337,3.2,3.2,1.599,1.5986
+b1_m1.12_neg1.2_frictionless,b1,frictionless floor,1.12,neg,1.2,54,0.0025,1,0,49.7568,8.06323,15.0821,41.5205,6.736,11.4975,31.6245,0.222752,12.2635,1.5578,,,,,,,,,0.95,3.15,3.15,0.284886,0.279459,3.15,3.15,1.599,1.5986
+b1_m1.84_pos0.4_undamped,b1,no structural damping,1.84,pos,0.4,54,0.0025,0,0.5,92.5261,1.81579,81.1893,71.1122,1.885,59.0952,51.789,4.67407,,,0.85,0.85,0.950;1.006,0.9504,0.85,2.6,0.822,0.8219,0.85,0.85,0.85,0.338679,0.33842,,,,
+b1_m1.84_pos0.4_frictionless,b1,frictionless floor,1.84,pos,0.4,54,0.0025,1,0,92.1989,4.21346,81.1893,71.1122,1.885,59.0952,51.9429,4.63848,,,1.05,1.05,0.950;1.006,1.0064,1.05,1.05,0.822,0.8219,1.05,1.05,1.05,0.294694,0.294391,,,,
+b1_m1.84_pos0.8_undamped,b1,no structural damping,1.84,pos,0.8,54,0.0025,0,0.5,117.263,7.23403,81.1893,95.7352,9.072,59.0952,49.7841,1.29142,,,2.15,2.15,1.582;1.638;1.694,1.6944,2.15,2.15,0.822;1.612,1.6116,2.15,2.15,2.15,0.20473,0.202495,,,,
+b1_m1.84_pos0.8_frictionless,b1,frictionless floor,1.84,pos,0.8,54,0.0025,1,0,120.568,16.5165,81.1893,95.7352,9.072,59.0952,49.1584,1.33268,,,2.25,2.25,1.582;1.638;1.694,1.6944,2.25,2.25,0.822;1.612,1.6116,2.25,2.25,2.25,0.264153,0.263435,,,,
+b1_m1.84_pos1.2_undamped,b1,no structural damping,1.84,pos,1.2,54,0.0025,0,0.5,161.575,19.2895,81.1893,133.082,18.379,59.0952,49.295,0.588242,,,2.9,2.9,2.278,2.2783,2.9,2.9,2.050,2.0503,2.9,2.9,2.9,0.236138,0.233984,,,,
+b1_m1.84_pos1.2_frictionless,b1,frictionless floor,1.84,pos,1.2,54,0.0025,1,0,163.109,21.6435,81.1893,133.082,18.379,59.0952,48.8547,0.601439,,,2.85,3.55,2.278,2.2783,2.85,2.85,2.050,2.0503,2.8,2.85,3.55,0.247303,0.245265,,,,
+b1_m1.84_neg0.4_undamped,b1,no structural damping,1.84,neg,0.4,54,0.0025,0,0.5,65.9575,1.87311,81.1893,51.2322,3.185,61.7794,55.2026,3.94809,58.2949,3.38736,,,,,,,,,0.75,0.75,0.75,0.538117,0.537645,0.75,0.75,0.860,0.8596
+b1_m1.84_neg0.4_frictionless,b1,frictionless floor,1.84,neg,0.4,54,0.0025,1,0,70.2627,5.46864,81.1893,51.2322,3.185,61.7794,54.2595,4.13625,58.2949,3.38736,,,,,,,,,1.05,1.05,1.05,0.314109,0.313703,1.05,1.05,0.860,0.8596
+b1_m1.84_neg0.8_undamped,b1,no structural damping,1.84,neg,0.8,54,0.0025,0,0.5,41.9767,7.40718,81.1893,40.9461,4.908,61.7794,37.762,2.45865,38.671,2.33222,,,,,,,,,1.5,1.5,1.5,0.500742,0.401845,1.5,1.5,0.870,0.8703
+b1_m1.84_neg0.8_frictionless,b1,frictionless floor,1.84,neg,0.8,54,0.0025,1,0,46.5736,6.10507,81.1893,40.9461,4.908,61.7794,39.6981,2.19949,38.671,2.33222,,,,,,,,,1.55,1.55,1.55,0.40078,0.397824,1.55,1.55,0.870,0.8703
+b1_m1.84_neg1.2_undamped,b1,no structural damping,1.84,neg,1.2,54,0.0025,0,0.5,53.789,12.298,81.1893,46.1153,6.109,61.7794,25.9709,2.43005,25.1038,2.60778,,,,,,,,,1.95,1.95,1.95,0.454551,0.434966,1.95,1.95,1.083,1.0829
+b1_m1.84_neg1.2_frictionless,b1,frictionless floor,1.84,neg,1.2,54,0.0025,1,0,54.0654,7.73406,81.1893,46.1153,6.109,61.7794,25.4029,2.54441,25.1038,2.60778,,,,,,,,,1.65,1.65,1.65,0.476203,0.468212,1.65,1.7,1.083,1.0829
+wake_m1.12_pos0.4_undamped,wake,no structural damping,1.12,pos,0.4,54,0.0025,0,0.5,20.8637,0.462776,15.0821,21.3949,2.356,13.3836,51.5039,0.657804,,,1.05,1.05,0.806,0.8064,1.05,1.05,,,1.05,1.05,1.05,0.107187,0.10718,,,,
+wake_m1.12_pos0.4_frictionless,wake,frictionless floor,1.12,pos,0.4,54,0.0025,1,0,21.0146,2.00897,15.0821,21.3949,2.356,13.3836,49.1265,0.740858,,,1.2,1.2,0.806,0.8064,1.2,1.2,,,1.2,1.2,1.2,0.143736,0.143724,,,,
+wake_m1.12_pos0.8_undamped,wake,no structural damping,1.12,pos,0.8,54,0.0025,0,0.5,34.5019,2.98042,15.0821,45.311,7.893,13.3836,46.3506,0.21335,,,2.7,2.7,,,2.7,2.7,1.277,1.2766,2.7,2.7,2.7,0.0820627,0.0820357,,,,
+wake_m1.12_pos0.8_frictionless,wake,frictionless floor,1.12,pos,0.8,54,0.0025,1,0,34.7256,3.83871,15.0821,45.311,7.893,13.3836,46.3244,0.213638,,,2.3,2.35,,,2.3,2.35,1.277,1.2766,2.3,2.3,2.3,0.109985,0.109959,,,,
+wake_m1.12_pos1.2_undamped,wake,no structural damping,1.12,pos,1.2,54,0.0025,0,0.5,54.8616,7.51264,15.0821,80.1838,16.612,13.3836,39.3467,0.138371,,,3.6,3.6,2.118;2.350,2.3503,3.6,3.6,1.739,1.7392,3.6,3.6,3.6,0.122887,0.122884,,,,
+wake_m1.12_pos1.2_frictionless,wake,frictionless floor,1.12,pos,1.2,54,0.0025,1,0,54.1415,4.4719,15.0821,80.1838,16.612,13.3836,39.3645,0.138231,,,3.7,3.7,2.118;2.350,2.3503,3.7,3.7,1.739,1.7392,1.3,3.7,3.7,0.0953627,0.0953615,,,,
+wake_m1.12_neg0.4_undamped,wake,no structural damping,1.12,neg,0.4,54,0.0025,0,0.5,6.81629,0.792442,15.0821,6.6938,,11.4975,60.3128,0.424791,33.0988,1.81846,,,,,,,,,1,1.05,1.05,2.76999,0.343145,1.05,1.05,0.344,0.344
+wake_m1.12_neg0.4_frictionless,wake,frictionless floor,1.12,neg,0.4,54,0.0025,1,0,9.24269,1.14357,15.0821,6.6938,,11.4975,49.1094,0.741494,33.0988,1.81846,,,,,,,,,0.95,0.95,0.95,5.96691,0.208535,0.95,0.95,0.344,0.344
+wake_m1.12_neg0.8_undamped,wake,no structural damping,1.12,neg,0.8,54,0.0025,0,0.5,14.1123,2.20211,15.0821,16.249,2.036,11.4975,6.79152,11.4907,13.4749,2.89837,,,,,,,,,1.05,1.05,2.35,0.141191,0.140656,1.05,2.35,0.392;0.907,0.9075
+wake_m1.12_neg0.8_frictionless,wake,frictionless floor,1.12,neg,0.8,54,0.0025,1,0,13.96,1.06779,15.0821,16.249,2.036,11.4975,6.55685,12.33,13.4749,2.89837,,,,,,,,,1.05,1.05,2.35,0.130275,0.130031,1.05,2.35,0.392;0.907,0.9075
+wake_m1.12_neg1.2_undamped,wake,no structural damping,1.12,neg,1.2,54,0.0025,0,0.5,30.6227,8.07547,15.0821,41.5205,6.736,11.4975,29.7946,0.252801,12.2635,1.5578,,,,,,,,,1,1,3.8,0.257774,0.257767,1,3.8,1.599,1.5986
+wake_m1.12_neg1.2_frictionless,wake,frictionless floor,1.12,neg,1.2,54,0.0025,1,0,29.9349,2.70363,15.0821,41.5205,6.736,11.4975,29.4392,0.259291,12.2635,1.5578,,,,,,,,,0.95,0.95,0.95,0.272183,0.272003,0.95,3.8,1.599,1.5986
+wake_m1.84_pos0.4_undamped,wake,no structural damping,1.84,pos,0.4,54,0.0025,0,0.5,87.8978,1.62124,81.1893,71.1122,1.885,59.0952,52.4475,4.52388,,,1.2,1.2,0.950;1.006,1.0064,1.2,1.2,0.822,0.8219,1.2,1.2,1.2,0.168256,0.168239,,,,
+wake_m1.84_pos0.4_frictionless,wake,frictionless floor,1.84,pos,0.4,54,0.0025,1,0,87.9091,1.86603,81.1893,71.1122,1.885,59.0952,52.4265,4.52859,,,1.05,1.05,0.950;1.006,1.0064,1.05,1.05,0.822,0.8219,1.05,1.05,1.05,0.18901,0.188996,,,,
+wake_m1.84_pos0.8_undamped,wake,no structural damping,1.84,pos,0.8,54,0.0025,0,0.5,105.654,5.16498,81.1893,95.7352,9.072,59.0952,50.4433,1.2495,,,2.25,2.25,1.582;1.638;1.694,1.6944,2.25,2.25,0.822;1.612,1.6116,2.25,2.25,2.25,0.120572,0.120567,,,,
+wake_m1.84_pos0.8_frictionless,wake,frictionless floor,1.84,pos,0.8,54,0.0025,1,0,106.025,10.8638,81.1893,95.7352,9.072,59.0952,50.4143,1.25132,,,2.2,2.2,1.582;1.638;1.694,1.6944,2.2,2.2,0.822;1.612,1.6116,2.2,2.2,2.2,0.145151,0.145134,,,,
+wake_m1.84_pos1.2_undamped,wake,no structural damping,1.84,pos,1.2,54,0.0025,0,0.5,130.912,1.7041,81.1893,133.082,18.379,59.0952,50.272,0.56011,,,3.85,3.85,2.278,2.2783,3.85,3.85,2.050,2.0503,3.85,3.85,3.85,0.0574786,0.0574738,,,,
+wake_m1.84_pos1.2_frictionless,wake,frictionless floor,1.84,pos,1.2,54,0.0025,1,0,132.078,13.6087,81.1893,133.082,18.379,59.0952,50.2041,0.562014,,,3.8,3.8,2.278,2.2783,3.8,3.8,2.050,2.0503,3.8,3.8,3.8,0.102251,0.102249,,,,
+wake_m1.84_neg0.4_undamped,wake,no structural damping,1.84,neg,0.4,54,0.0025,0,0.5,74.2177,1.60284,81.1893,51.2322,3.185,61.7794,54.0396,4.1814,58.2949,3.38736,,,,,,,,,1.15,1.15,1.15,0.219606,0.219573,1.15,3.4,0.860,0.8596
+wake_m1.84_neg0.4_frictionless,wake,frictionless floor,1.84,neg,0.4,54,0.0025,1,0,74.3323,2.27551,81.1893,51.2322,3.185,61.7794,54.0191,4.18563,58.2949,3.38736,,,,,,,,,1.15,1.15,1.15,0.189865,0.189849,1.15,1.15,0.860,0.8596
+wake_m1.84_neg0.8_undamped,wake,no structural damping,1.84,neg,0.8,54,0.0025,0,0.5,49.2291,4.34995,81.1893,40.9461,4.908,61.7794,54.6958,1.01203,38.671,2.33222,,,,,,,,,2.05,2.05,2.05,0.212875,0.212869,2.05,2.05,0.870,0.8703
+wake_m1.84_neg0.8_frictionless,wake,frictionless floor,1.84,neg,0.8,54,0.0025,1,0,48.9572,8.74131,81.1893,40.9461,4.908,61.7794,54.5013,1.02179,38.671,2.33222,,,,,,,,,1.95,1.95,1.95,0.211699,0.211698,1.95,1.95,0.870,0.8703
+wake_m1.84_neg1.2_undamped,wake,no structural damping,1.84,neg,1.2,54,0.0025,0,0.5,44.6578,7.46844,81.1893,46.1153,6.109,61.7794,34.9048,1.29831,25.1038,2.60778,,,,,,,,,2.35,2.35,2.4,4.40156,0.335287,2.35,2.35,1.083,1.0829
+wake_m1.84_neg1.2_frictionless,wake,frictionless floor,1.84,neg,1.2,54,0.0025,1,0,46.064,7.63729,81.1893,46.1153,6.109,61.7794,35.0392,1.28752,25.1038,2.60778,,,,,,,,,0.4,2.35,2.35,5.62834,0.953313,2.35,2.35,1.083,1.0829
diff --git a/validation/experiments/chaplin_catenary/summary.json b/validation/experiments/chaplin_catenary/summary.json
new file mode 100644
index 00000000..1e01644a
--- /dev/null
+++ b/validation/experiments/chaplin_catenary/summary.json
@@ -0,0 +1,1013 @@
+{
+ "sets": {
+ "uls19": "Ulveseter et al. (2019), Table 1, Chh 1.5",
+ "b1": "generic set (Delta Flume case)",
+ "wake": "Facchinetti et al. (2004) wake oscillator",
+ "none": "no VIV, C_d 1.2"
+ },
+ "model": {
+ "length_m": 5.36,
+ "diameter_m": 0.056,
+ "EI_Nm2": 1.3,
+ "EA_N": 790000.0,
+ "mass_kg_per_m": {
+ "1.12": 2.75873,
+ "1.84": 4.59422
+ },
+ "submerged_weight_N_per_m": {
+ "1.12": 2.9,
+ "1.84": 20.9
+ },
+ "rayleigh_damping": {
+ "zeta": 0.03,
+ "f1_hz": 0.3,
+ "f2_hz": 3.0
+ },
+ "floor_friction": 0.5,
+ "segments": 54,
+ "dt_s": 0.0025,
+ "tmax_s": 110.0,
+ "statistics_from_s": 30.0,
+ "current_ramp_s": 10.0,
+ "welch_segment_s": 20.0,
+ "probe_elevations_m": {
+ "upper_a": -0.57,
+ "upper_b": -1.186,
+ "lower": -1.582,
+ "mid_depth": -1.0
+ }
+ },
+ "still_water_top_tension_N": {
+ "1.12": {
+ "model": 15.0821,
+ "measured_fig10": 13.3836,
+ "measured_fig13": 11.4975
+ },
+ "1.84": {
+ "model": 81.1893,
+ "measured_fig10": 59.0952,
+ "measured_fig13": 61.7794
+ }
+ },
+ "scores": {
+ "uls19_m1.12_pos": {
+ "T_rms_rel_error": 0.178227,
+ "T_mean_rel_error": -0.129766,
+ "T_points": 13,
+ "dT_rms_error_N": 14.5405,
+ "dT_mean_error_N": -11.2207,
+ "sd_T_ratio_median": 0.80798,
+ "sd_T_points": 12,
+ "f_upper_acc_peak_at_harmonic": 5,
+ "f_upper_model_fd_over_U_median": 0.121333,
+ "f_upper_measured_fd_over_U_median": 0.111253,
+ "f_upper_measured_points": 6,
+ "f_upper_ratio_to_nearest_measured_median": 1.10624,
+ "f_upper_within_10pct": 1,
+ "f_upper_points": 5,
+ "f_lower_acc_peak_at_harmonic": 1,
+ "f_lower_model_fd_over_U_median": 0.121333,
+ "f_lower_measured_fd_over_U_median": 0.09,
+ "f_lower_measured_points": 11,
+ "f_lower_ratio_to_nearest_measured_median": 1.37083,
+ "f_lower_within_10pct": 0,
+ "f_lower_points": 11,
+ "f_span_spread_median": 0.0
+ },
+ "uls19_m1.12_neg": {
+ "T_rms_rel_error": 0.322249,
+ "T_mean_rel_error": 0.105473,
+ "T_points": 13,
+ "dT_rms_error_N": 6.87095,
+ "dT_mean_error_N": -5.07762,
+ "sd_T_ratio_median": 1.42526,
+ "sd_T_points": 11,
+ "psi_rms_error_deg": 14.9851,
+ "psi_mean_error_deg": 13.0682,
+ "cd_eq9_model_median": 0.901194,
+ "cd_eq9_measured_median": 1.83619,
+ "f_mid_acc_peak_at_harmonic": 5,
+ "f_mid_model_fd_over_U_median": 0.0896,
+ "f_mid_measured_fd_over_U_median": 0.06349,
+ "f_mid_measured_points": 13,
+ "f_mid_model_fd_over_Un_median": 0.183805,
+ "f_mid_measured_fd_over_Un_median": 0.210911,
+ "f_mid_ratio_to_nearest_measured_median": 1.4667,
+ "f_mid_within_10pct": 0,
+ "f_mid_points": 10,
+ "f_span_spread_median": 1.72414
+ },
+ "uls19_m1.84_pos": {
+ "T_rms_rel_error": 0.150491,
+ "T_mean_rel_error": 0.126341,
+ "T_points": 12,
+ "dT_rms_error_N": 12.2279,
+ "dT_mean_error_N": -11.2468,
+ "sd_T_ratio_median": 1.14421,
+ "sd_T_points": 11,
+ "f_upper_acc_peak_at_harmonic": 3,
+ "f_upper_model_fd_over_U_median": 0.121333,
+ "f_upper_measured_fd_over_U_median": 0.1112,
+ "f_upper_measured_points": 23,
+ "f_upper_ratio_to_nearest_measured_median": 1.06873,
+ "f_upper_within_10pct": 7,
+ "f_upper_points": 12,
+ "f_lower_acc_peak_at_harmonic": 3,
+ "f_lower_model_fd_over_U_median": 0.121333,
+ "f_lower_measured_fd_over_U_median": 0.105272,
+ "f_lower_measured_points": 18,
+ "f_lower_ratio_to_nearest_measured_median": 1.07817,
+ "f_lower_within_10pct": 6,
+ "f_lower_points": 12,
+ "f_span_spread_median": 0.0
+ },
+ "uls19_m1.84_neg": {
+ "T_rms_rel_error": 0.296105,
+ "T_mean_rel_error": 0.199745,
+ "T_points": 13,
+ "dT_rms_error_N": 14.3201,
+ "dT_mean_error_N": -9.74128,
+ "sd_T_ratio_median": 1.61341,
+ "sd_T_points": 12,
+ "psi_rms_error_deg": 10.1491,
+ "psi_mean_error_deg": 4.20246,
+ "cd_eq9_model_median": 1.35935,
+ "cd_eq9_measured_median": 2.4706,
+ "f_mid_acc_peak_at_harmonic": 2,
+ "f_mid_model_fd_over_U_median": 0.102667,
+ "f_mid_measured_fd_over_U_median": 0.0589018,
+ "f_mid_measured_points": 25,
+ "f_mid_model_fd_over_Un_median": 0.129569,
+ "f_mid_measured_fd_over_Un_median": 0.119125,
+ "f_mid_ratio_to_nearest_measured_median": 1.32031,
+ "f_mid_within_10pct": 4,
+ "f_mid_points": 13,
+ "f_span_spread_median": 0.0
+ },
+ "b1_m1.12_pos": {
+ "T_rms_rel_error": 0.0982925,
+ "T_mean_rel_error": 0.0759066,
+ "T_points": 13,
+ "dT_rms_error_N": 1.75874,
+ "dT_mean_error_N": 0.602227,
+ "sd_T_ratio_median": 0.589627,
+ "sd_T_points": 12,
+ "f_upper_acc_peak_at_harmonic": 0,
+ "f_upper_model_fd_over_U_median": 0.137846,
+ "f_upper_measured_fd_over_U_median": 0.111253,
+ "f_upper_measured_points": 6,
+ "f_upper_ratio_to_nearest_measured_median": 1.24008,
+ "f_upper_within_10pct": 0,
+ "f_upper_points": 5,
+ "f_lower_acc_peak_at_harmonic": 0,
+ "f_lower_model_fd_over_U_median": 0.137846,
+ "f_lower_measured_fd_over_U_median": 0.09,
+ "f_lower_measured_points": 11,
+ "f_lower_ratio_to_nearest_measured_median": 1.51607,
+ "f_lower_within_10pct": 0,
+ "f_lower_points": 11,
+ "f_span_spread_median": 0.0
+ },
+ "b1_m1.12_neg": {
+ "T_rms_rel_error": 0.301008,
+ "T_mean_rel_error": 0.277109,
+ "T_points": 13,
+ "dT_rms_error_N": 3.88365,
+ "dT_mean_error_N": 1.95593,
+ "sd_T_ratio_median": 1.22063,
+ "sd_T_points": 11,
+ "psi_rms_error_deg": 14.7002,
+ "psi_mean_error_deg": 10.6771,
+ "cd_eq9_model_median": 0.937718,
+ "cd_eq9_measured_median": 1.83619,
+ "f_mid_acc_peak_at_harmonic": 2,
+ "f_mid_model_fd_over_U_median": 0.128,
+ "f_mid_measured_fd_over_U_median": 0.06349,
+ "f_mid_measured_points": 13,
+ "f_mid_model_fd_over_Un_median": 0.261949,
+ "f_mid_measured_fd_over_Un_median": 0.210911,
+ "f_mid_ratio_to_nearest_measured_median": 1.83987,
+ "f_mid_within_10pct": 0,
+ "f_mid_points": 10,
+ "f_span_spread_median": 0.590909
+ },
+ "b1_m1.84_pos": {
+ "T_rms_rel_error": 0.23847,
+ "T_mean_rel_error": 0.236845,
+ "T_points": 12,
+ "dT_rms_error_N": 4.92599,
+ "dT_mean_error_N": 1.829,
+ "sd_T_ratio_median": 0.686568,
+ "sd_T_points": 11,
+ "f_upper_acc_peak_at_harmonic": 0,
+ "f_upper_model_fd_over_U_median": 0.137455,
+ "f_upper_measured_fd_over_U_median": 0.1112,
+ "f_upper_measured_points": 23,
+ "f_upper_ratio_to_nearest_measured_median": 1.2527,
+ "f_upper_within_10pct": 0,
+ "f_upper_points": 12,
+ "f_lower_acc_peak_at_harmonic": 1,
+ "f_lower_model_fd_over_U_median": 0.137455,
+ "f_lower_measured_fd_over_U_median": 0.105272,
+ "f_lower_measured_points": 18,
+ "f_lower_ratio_to_nearest_measured_median": 1.279,
+ "f_lower_within_10pct": 1,
+ "f_lower_points": 12,
+ "f_span_spread_median": 0.0
+ },
+ "b1_m1.84_neg": {
+ "T_rms_rel_error": 0.24774,
+ "T_mean_rel_error": 0.17449,
+ "T_points": 13,
+ "dT_rms_error_N": 13.745,
+ "dT_mean_error_N": -10.5128,
+ "sd_T_ratio_median": 1.20507,
+ "sd_T_points": 12,
+ "psi_rms_error_deg": 4.97044,
+ "psi_mean_error_deg": -2.68136,
+ "cd_eq9_model_median": 2.55351,
+ "cd_eq9_measured_median": 2.4706,
+ "f_mid_acc_peak_at_harmonic": 0,
+ "f_mid_model_fd_over_U_median": 0.098,
+ "f_mid_measured_fd_over_U_median": 0.0589018,
+ "f_mid_measured_points": 25,
+ "f_mid_model_fd_over_Un_median": 0.165005,
+ "f_mid_measured_fd_over_Un_median": 0.119125,
+ "f_mid_ratio_to_nearest_measured_median": 1.45267,
+ "f_mid_within_10pct": 3,
+ "f_mid_points": 13,
+ "f_span_spread_median": 0.0
+ },
+ "wake_m1.12_pos": {
+ "T_rms_rel_error": 0.23445,
+ "T_mean_rel_error": -0.184807,
+ "T_points": 13,
+ "dT_rms_error_N": 18.8472,
+ "dT_mean_error_N": -14.5683,
+ "sd_T_ratio_median": 0.188049,
+ "sd_T_points": 12,
+ "f_upper_acc_peak_at_harmonic": 0,
+ "f_upper_model_fd_over_U_median": 0.172667,
+ "f_upper_measured_fd_over_U_median": 0.111253,
+ "f_upper_measured_points": 6,
+ "f_upper_ratio_to_nearest_measured_median": 1.30584,
+ "f_upper_within_10pct": 1,
+ "f_upper_points": 5,
+ "f_lower_acc_peak_at_harmonic": 1,
+ "f_lower_model_fd_over_U_median": 0.168,
+ "f_lower_measured_fd_over_U_median": 0.09,
+ "f_lower_measured_points": 11,
+ "f_lower_ratio_to_nearest_measured_median": 1.82537,
+ "f_lower_within_10pct": 0,
+ "f_lower_points": 11,
+ "f_span_spread_median": 0.0
+ },
+ "wake_m1.12_neg": {
+ "T_rms_rel_error": 0.351188,
+ "T_mean_rel_error": -0.00712777,
+ "T_points": 13,
+ "dT_rms_error_N": 10.4983,
+ "dT_mean_error_N": -7.90692,
+ "sd_T_ratio_median": 0.421873,
+ "sd_T_points": 11,
+ "psi_rms_error_deg": 15.6904,
+ "psi_mean_error_deg": 13.0248,
+ "cd_eq9_model_median": 0.922007,
+ "cd_eq9_measured_median": 1.83619,
+ "f_mid_acc_peak_at_harmonic": 8,
+ "f_mid_model_fd_over_U_median": 0.0735,
+ "f_mid_measured_fd_over_U_median": 0.06349,
+ "f_mid_measured_points": 13,
+ "f_mid_model_fd_over_Un_median": 0.169652,
+ "f_mid_measured_fd_over_Un_median": 0.210911,
+ "f_mid_ratio_to_nearest_measured_median": 0.976461,
+ "f_mid_within_10pct": 0,
+ "f_mid_points": 10,
+ "f_span_spread_median": 0.0
+ },
+ "wake_m1.84_pos": {
+ "T_rms_rel_error": 0.13919,
+ "T_mean_rel_error": 0.0915524,
+ "T_points": 12,
+ "dT_rms_error_N": 17.7077,
+ "dT_mean_error_N": -15.5452,
+ "sd_T_ratio_median": 0.424804,
+ "sd_T_points": 11,
+ "f_upper_acc_peak_at_harmonic": 0,
+ "f_upper_model_fd_over_U_median": 0.168,
+ "f_upper_measured_fd_over_U_median": 0.1112,
+ "f_upper_measured_points": 23,
+ "f_upper_ratio_to_nearest_measured_median": 1.40477,
+ "f_upper_within_10pct": 0,
+ "f_upper_points": 12,
+ "f_lower_acc_peak_at_harmonic": 0,
+ "f_lower_model_fd_over_U_median": 0.168,
+ "f_lower_measured_fd_over_U_median": 0.105272,
+ "f_lower_measured_points": 18,
+ "f_lower_ratio_to_nearest_measured_median": 1.46893,
+ "f_lower_within_10pct": 0,
+ "f_lower_points": 12,
+ "f_span_spread_median": 0.0
+ },
+ "wake_m1.84_neg": {
+ "T_rms_rel_error": 0.316394,
+ "T_mean_rel_error": 0.177252,
+ "T_points": 13,
+ "dT_rms_error_N": 16.4008,
+ "dT_mean_error_N": -10.7383,
+ "sd_T_ratio_median": 0.760237,
+ "sd_T_points": 12,
+ "psi_rms_error_deg": 10.3235,
+ "psi_mean_error_deg": 4.31082,
+ "cd_eq9_model_median": 1.3565,
+ "cd_eq9_measured_median": 2.4706,
+ "f_mid_acc_peak_at_harmonic": 0,
+ "f_mid_model_fd_over_U_median": 0.127556,
+ "f_mid_measured_fd_over_U_median": 0.0589018,
+ "f_mid_measured_points": 25,
+ "f_mid_model_fd_over_Un_median": 0.182582,
+ "f_mid_measured_fd_over_Un_median": 0.119125,
+ "f_mid_ratio_to_nearest_measured_median": 2.02593,
+ "f_mid_within_10pct": 1,
+ "f_mid_points": 13,
+ "f_span_spread_median": 0.0
+ },
+ "none_m1.12_pos": {
+ "T_rms_rel_error": 0.244553,
+ "T_mean_rel_error": -0.194729,
+ "T_points": 13,
+ "dT_rms_error_N": 19.638,
+ "dT_mean_error_N": -15.1741,
+ "sd_T_ratio_median": 2.89274e-07,
+ "sd_T_points": 12
+ },
+ "none_m1.12_neg": {
+ "T_rms_rel_error": 0.365008,
+ "T_mean_rel_error": -0.0683198,
+ "T_points": 13,
+ "dT_rms_error_N": 11.4584,
+ "dT_mean_error_N": -8.8485,
+ "sd_T_ratio_median": 2.99115e-06,
+ "sd_T_points": 11,
+ "psi_rms_error_deg": 18.6388,
+ "psi_mean_error_deg": 14.5091,
+ "cd_eq9_model_median": 0.80427,
+ "cd_eq9_measured_median": 1.83619
+ },
+ "none_m1.84_pos": {
+ "T_rms_rel_error": 0.135055,
+ "T_mean_rel_error": 0.0849025,
+ "T_points": 12,
+ "dT_rms_error_N": 18.367,
+ "dT_mean_error_N": -16.2307,
+ "sd_T_ratio_median": 4.22593e-07,
+ "sd_T_points": 11
+ },
+ "none_m1.84_neg": {
+ "T_rms_rel_error": 0.385349,
+ "T_mean_rel_error": 0.0902642,
+ "T_points": 13,
+ "dT_rms_error_N": 22.8256,
+ "dT_mean_error_N": -14.7163,
+ "sd_T_ratio_median": 3.61758e-06,
+ "sd_T_points": 12,
+ "psi_rms_error_deg": 10.1204,
+ "psi_mean_error_deg": 3.34231,
+ "cd_eq9_model_median": 1.32629,
+ "cd_eq9_measured_median": 2.4706
+ }
+ },
+ "sensitivity_and_convergence": {
+ "uls19_m1.84_pos0.8_dt": {
+ "role": "half the time step",
+ "mean_T": -0.000213727,
+ "sd_T": 0.0547442,
+ "AD_rms_max": 0.0785622,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.84_pos0.8_n108": {
+ "role": "twice the elements",
+ "mean_T": -0.00138539,
+ "sd_T": 0.0504323,
+ "AD_rms_max": 0.107866,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.12_neg1.2_dt": {
+ "role": "half the time step",
+ "mean_T": 0.00615787,
+ "sd_T": -0.0375066,
+ "AD_rms_max": 0.0259441,
+ "f_mid": -0.0185185
+ },
+ "uls19_m1.12_neg1.2_n108": {
+ "role": "twice the elements",
+ "mean_T": -0.0292937,
+ "sd_T": -0.173652,
+ "AD_rms_max": -0.0886828,
+ "f_mid": -0.0185185
+ },
+ "b1_m1.84_pos0.8_dt": {
+ "role": "half the time step",
+ "mean_T": -0.000333733,
+ "sd_T": 0.0248872,
+ "AD_rms_max": -0.00513647,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.84_pos0.8_n108": {
+ "role": "twice the elements",
+ "mean_T": -0.000293523,
+ "sd_T": 0.00244924,
+ "AD_rms_max": -0.0104285,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.12_neg1.2_dt": {
+ "role": "half the time step",
+ "mean_T": 0.0528912,
+ "sd_T": 0.0230265,
+ "AD_rms_max": 0.0543951,
+ "f_mid": -0.111111
+ },
+ "b1_m1.12_neg1.2_n108": {
+ "role": "twice the elements",
+ "mean_T": 0.00971889,
+ "sd_T": 0.00576302,
+ "AD_rms_max": -0.00775592,
+ "f_mid": 0.0
+ },
+ "wake_m1.84_pos0.8_dt": {
+ "role": "half the time step",
+ "mean_T": -1.14851e-05,
+ "sd_T": -0.00183678,
+ "AD_rms_max": -7.15033e-05,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.84_pos0.8_n108": {
+ "role": "twice the elements",
+ "mean_T": 0.000176472,
+ "sd_T": 0.00104338,
+ "AD_rms_max": 0.0100616,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.12_neg1.2_dt": {
+ "role": "half the time step",
+ "mean_T": 9.78408e-05,
+ "sd_T": -0.00338539,
+ "AD_rms_max": -5.35361e-05,
+ "f_mid": 0.0
+ },
+ "wake_m1.12_neg1.2_n108": {
+ "role": "twice the elements",
+ "mean_T": 0.00192069,
+ "sd_T": 0.0683398,
+ "AD_rms_max": -0.00300082,
+ "f_mid": 0.0
+ },
+ "uls19_m1.12_pos0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00478151,
+ "sd_T": 0.0946651,
+ "AD_rms_max": 0.0108269,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.12_pos0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0265117,
+ "sd_T": 1.00318,
+ "AD_rms_max": 0.281374,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.12_pos0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0273574,
+ "sd_T": 0.541039,
+ "AD_rms_max": 0.100682,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.12_pos0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00310262,
+ "sd_T": -0.0065773,
+ "AD_rms_max": 0.0893733,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.12_pos1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.011719,
+ "sd_T": 0.685669,
+ "AD_rms_max": -0.0146251,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.12_pos1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00359373,
+ "sd_T": -0.0319049,
+ "AD_rms_max": 0.0168571,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.12_neg0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.00695026,
+ "sd_T": 0.115984,
+ "AD_rms_max": -0.040814,
+ "f_mid": 0.0
+ },
+ "uls19_m1.12_neg0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0387092,
+ "sd_T": -0.0167714,
+ "AD_rms_max": 0.364643,
+ "f_mid": 0.0
+ },
+ "uls19_m1.12_neg0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0499191,
+ "sd_T": 0.723415,
+ "AD_rms_max": 0.141373,
+ "f_mid": 1.76923
+ },
+ "uls19_m1.12_neg0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -0.00926855,
+ "sd_T": 0.0257577,
+ "AD_rms_max": 0.0274219,
+ "f_mid": 0.153846
+ },
+ "uls19_m1.12_neg1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0669251,
+ "sd_T": 1.64425,
+ "AD_rms_max": -0.187033,
+ "f_mid": 0.0
+ },
+ "uls19_m1.12_neg1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00363012,
+ "sd_T": -0.0186852,
+ "AD_rms_max": -0.0267742,
+ "f_mid": 0.0
+ },
+ "uls19_m1.84_pos0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00331159,
+ "sd_T": 0.337498,
+ "AD_rms_max": 0.209312,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.84_pos0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00286032,
+ "sd_T": 0.610118,
+ "AD_rms_max": 0.0378133,
+ "f_upper": 0.1875,
+ "f_lower": 0.1875
+ },
+ "uls19_m1.84_pos0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00124073,
+ "sd_T": 0.272957,
+ "AD_rms_max": 0.119029,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "uls19_m1.84_pos0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0160846,
+ "sd_T": 0.529706,
+ "AD_rms_max": 0.283511,
+ "f_upper": 0.030303,
+ "f_lower": 0.030303
+ },
+ "uls19_m1.84_pos1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00905076,
+ "sd_T": 0.380209,
+ "AD_rms_max": 0.0491352,
+ "f_upper": -0.0384615,
+ "f_lower": -0.0961538
+ },
+ "uls19_m1.84_pos1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -0.00237351,
+ "sd_T": 0.0470997,
+ "AD_rms_max": 0.312951,
+ "f_upper": -0.0769231,
+ "f_lower": -0.0769231
+ },
+ "uls19_m1.84_neg0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.000291763,
+ "sd_T": 0.0591125,
+ "AD_rms_max": -0.0200486,
+ "f_mid": 0.0
+ },
+ "uls19_m1.84_neg0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.000682553,
+ "sd_T": 0.988066,
+ "AD_rms_max": -0.0126726,
+ "f_mid": 0.0666667
+ },
+ "uls19_m1.84_neg0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.0129811,
+ "sd_T": 0.24324,
+ "AD_rms_max": 0.0250626,
+ "f_mid": 0.0
+ },
+ "uls19_m1.84_neg0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0412617,
+ "sd_T": 0.168008,
+ "AD_rms_max": 0.22774,
+ "f_mid": 0.037037
+ },
+ "uls19_m1.84_neg1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.00641234,
+ "sd_T": 0.190758,
+ "AD_rms_max": -0.0611028,
+ "f_mid": 0.0333333
+ },
+ "uls19_m1.84_neg1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0435104,
+ "sd_T": 0.18567,
+ "AD_rms_max": 0.120453,
+ "f_mid": 0.0
+ },
+ "b1_m1.12_pos0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00337188,
+ "sd_T": 0.11451,
+ "AD_rms_max": 0.0598356,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.12_pos0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0528784,
+ "sd_T": 1.94534,
+ "AD_rms_max": 0.607314,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.12_pos0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.0125056,
+ "sd_T": 0.0903299,
+ "AD_rms_max": -0.0847705,
+ "f_upper": 0.171429,
+ "f_lower": 0.171429
+ },
+ "b1_m1.12_pos0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -0.0307946,
+ "sd_T": -0.0328283,
+ "AD_rms_max": -0.137113,
+ "f_upper": 0.171429,
+ "f_lower": 0.171429
+ },
+ "b1_m1.12_pos1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0220779,
+ "sd_T": 0.259716,
+ "AD_rms_max": 0.0402986,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.12_pos1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00161545,
+ "sd_T": 0.0139552,
+ "AD_rms_max": 0.00830583,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.12_neg0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0227695,
+ "sd_T": -0.0195736,
+ "AD_rms_max": 0.0863363,
+ "f_mid": 0.0
+ },
+ "b1_m1.12_neg0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0342446,
+ "sd_T": 0.19911,
+ "AD_rms_max": 0.29079,
+ "f_mid": 0.2
+ },
+ "b1_m1.12_neg0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0554924,
+ "sd_T": 0.463296,
+ "AD_rms_max": 0.0195141,
+ "f_mid": 0.0
+ },
+ "b1_m1.12_neg0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -0.00972576,
+ "sd_T": -0.0398738,
+ "AD_rms_max": -0.0733204,
+ "f_mid": 1.5
+ },
+ "b1_m1.12_neg1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0596978,
+ "sd_T": 0.781224,
+ "AD_rms_max": 0.0899233,
+ "f_mid": 0.015873
+ },
+ "b1_m1.12_neg1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00255669,
+ "sd_T": -0.000636848,
+ "AD_rms_max": -0.0119029,
+ "f_mid": 0.0
+ },
+ "b1_m1.84_pos0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00782454,
+ "sd_T": 0.0983797,
+ "AD_rms_max": 0.151877,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.84_pos0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0042603,
+ "sd_T": 1.54874,
+ "AD_rms_max": 0.00227848,
+ "f_upper": 0.235294,
+ "f_lower": 0.235294
+ },
+ "b1_m1.84_pos0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.000127782,
+ "sd_T": 0.32739,
+ "AD_rms_max": 0.0107553,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.84_pos0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0283157,
+ "sd_T": 2.03065,
+ "AD_rms_max": 0.304132,
+ "f_upper": 0.0465116,
+ "f_lower": 0.0465116
+ },
+ "b1_m1.84_pos1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.000824041,
+ "sd_T": 0.569817,
+ "AD_rms_max": -0.00031999,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "b1_m1.84_pos1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0103245,
+ "sd_T": 0.761389,
+ "AD_rms_max": 0.0469476,
+ "f_upper": -0.0172414,
+ "f_lower": -0.0172414
+ },
+ "b1_m1.84_neg0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.00625667,
+ "sd_T": 0.0274971,
+ "AD_rms_max": 0.0441987,
+ "f_mid": 0.0
+ },
+ "b1_m1.84_neg0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.058606,
+ "sd_T": 1.99983,
+ "AD_rms_max": -0.390481,
+ "f_mid": 0.4
+ },
+ "b1_m1.84_neg0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.154942,
+ "sd_T": 0.235442,
+ "AD_rms_max": -0.199025,
+ "f_mid": 0.0714286
+ },
+ "b1_m1.84_neg0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.281418,
+ "sd_T": 0.018263,
+ "AD_rms_max": -0.358921,
+ "f_mid": 0.107143
+ },
+ "b1_m1.84_neg1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.0075888,
+ "sd_T": 0.693758,
+ "AD_rms_max": -0.0498695,
+ "f_mid": 0.147059
+ },
+ "b1_m1.84_neg1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -0.00248897,
+ "sd_T": 0.0651826,
+ "AD_rms_max": -0.00460963,
+ "f_mid": -0.0294118
+ },
+ "wake_m1.12_pos0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00070455,
+ "sd_T": 0.129646,
+ "AD_rms_max": 0.062596,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.12_pos0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00794549,
+ "sd_T": 3.90394,
+ "AD_rms_max": 0.424917,
+ "f_upper": 0.142857,
+ "f_lower": 0.142857
+ },
+ "wake_m1.12_pos0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.00597687,
+ "sd_T": 2.95918,
+ "AD_rms_max": 0.487728,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.12_pos0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.0124979,
+ "sd_T": 4.09934,
+ "AD_rms_max": 0.993938,
+ "f_upper": -0.148148,
+ "f_lower": -0.148148
+ },
+ "wake_m1.12_pos1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0132288,
+ "sd_T": 0.679432,
+ "AD_rms_max": 0.286669,
+ "f_upper": -0.027027,
+ "f_lower": -0.027027
+ },
+ "wake_m1.12_pos1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -6.98416e-05,
+ "sd_T": -0.000317822,
+ "AD_rms_max": -0.00151722,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.12_neg0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.032525,
+ "sd_T": 0.280969,
+ "AD_rms_max": 0.273797,
+ "f_mid": 0.0
+ },
+ "wake_m1.12_neg0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.400073,
+ "sd_T": 0.848568,
+ "AD_rms_max": 1.74392,
+ "f_mid": -0.0952381
+ },
+ "wake_m1.12_neg0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0109013,
+ "sd_T": 1.06185,
+ "AD_rms_max": 0.0638437,
+ "f_mid": 0.0
+ },
+ "wake_m1.12_neg0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -7.78067e-06,
+ "sd_T": -0.00021671,
+ "AD_rms_max": -0.0184043,
+ "f_mid": 0.0
+ },
+ "wake_m1.12_neg1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.0229739,
+ "sd_T": 1.98694,
+ "AD_rms_max": -0.0527667,
+ "f_mid": 0.0526316
+ },
+ "wake_m1.12_neg1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -4.41773e-06,
+ "sd_T": 1.74642e-05,
+ "AD_rms_max": 0.000181606,
+ "f_mid": 0.0
+ },
+ "wake_m1.84_pos0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.000612241,
+ "sd_T": 0.12109,
+ "AD_rms_max": 0.0707901,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.84_pos0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.000741443,
+ "sd_T": 0.290359,
+ "AD_rms_max": 0.202874,
+ "f_upper": -0.125,
+ "f_lower": -0.125
+ },
+ "wake_m1.84_pos0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.000594474,
+ "sd_T": 0.0452808,
+ "AD_rms_max": 0.0317005,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.84_pos0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00410578,
+ "sd_T": 1.1986,
+ "AD_rms_max": 0.242015,
+ "f_upper": -0.0222222,
+ "f_lower": -0.0222222
+ },
+ "wake_m1.84_pos1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.000385042,
+ "sd_T": -0.358935,
+ "AD_rms_max": -0.047561,
+ "f_upper": 0.0,
+ "f_lower": 0.0
+ },
+ "wake_m1.84_pos1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00851441,
+ "sd_T": 4.11944,
+ "AD_rms_max": 0.69433,
+ "f_upper": -0.012987,
+ "f_lower": -0.012987
+ },
+ "wake_m1.84_neg0.4_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.000446763,
+ "sd_T": 0.111242,
+ "AD_rms_max": 0.0535107,
+ "f_mid": 0.0
+ },
+ "wake_m1.84_neg0.4_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.00109584,
+ "sd_T": 0.5776,
+ "AD_rms_max": -0.0891654,
+ "f_mid": 0.0
+ },
+ "wake_m1.84_neg0.8_undamped": {
+ "role": "no structural damping",
+ "mean_T": -0.00145667,
+ "sd_T": -0.0277809,
+ "AD_rms_max": 0.051921,
+ "f_mid": 0.0
+ },
+ "wake_m1.84_neg0.8_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": -0.00697171,
+ "sd_T": 0.953695,
+ "AD_rms_max": 0.0461086,
+ "f_mid": -0.0487805
+ },
+ "wake_m1.84_neg1.2_undamped": {
+ "role": "no structural damping",
+ "mean_T": 0.140531,
+ "sd_T": -0.108429,
+ "AD_rms_max": 0.913708,
+ "f_mid": 0.0
+ },
+ "wake_m1.84_neg1.2_frictionless": {
+ "role": "frictionless floor",
+ "mean_T": 0.176446,
+ "sd_T": -0.0882717,
+ "AD_rms_max": 1.44709,
+ "f_mid": 0.0
+ }
+ },
+ "executable_sha256": "2cb307b11eab738867274a994d1364f75b9d79fd4562c00de82df59d946b7426"
+}
diff --git a/validation/experiments/delta_flume/README.md b/validation/experiments/delta_flume/README.md
new file mode 100644
index 00000000..97dea3e1
--- /dev/null
+++ b/validation/experiments/delta_flume/README.md
@@ -0,0 +1,135 @@
+
+
+# Delta Flume vertical riser in a stepped current: cross-flow and in-line VIV
+
+This directory compares CableDyn's VIV with the nine blind-trial cases of the Delta Flume riser
+tests. Chaplin et al. (2005a), , describe the
+riser and the tests, and Chaplin et al. (2005b),
+, the blind predictions made for them. The
+lower 5.94 m of the 13.12 m riser is in a uniform current of 0.16–0.95 m/s, the rest in still
+water. The VIV coefficients are a generic set; nothing is fitted to these measurements. The
+still-water natural frequencies of the same riser are case L3-C
+([`../chaplin`](../chaplin/README.md)).
+
+## Model and data
+
+- **Riser:** as L3-C: 13.12 m between pinned joints, D 28 mm, EI 29.9 N m², mass ratio 3.0 with
+ the internal water (1.847 kg/m), fresh water, C_a 1. From the project's mechanical-properties
+ page (University of Southampton, archived; `provenance.json`): EA 5.88 MN, structural damping
+ 0.33 % of critical, top spring 11.4 kN/m.
+- **Top spring:** in series with the riser, one effective axial stiffness
+ EA_eff = L/(1/k + L/EA) = 1.459e5 N. The unstretched length of each case is iterated until the
+ static top tension in the current is the case's mean top tension. A rigid top would turn the
+ current's bow into tension (1799 N instead of 1002 N in case 9) and stiffen the riser.
+- **Current:** the towing speed U over the lower 5.94 m (the bottom of the carriage's vacuum
+ tank), still water above, with a 2 cm linear step between them.
+- **Cases (slide 3 of the presentation below):**
+
+ | Case | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
+ | U (m/s) | 0.16 | 0.21 | 0.31 | 0.40 | 0.54 | 0.60 | 0.70 | 0.85 | 0.95 |
+ | Mean top tension (N) | 405 | 407 | 457 | 506 | 598 | 670 | 743 | 923 | 1002 |
+ | Std of top tension (N) | 2 | 3 | 3 | 8 | 15 | 14 | 8 | 14 | 65 |
+
+- **VIV (all cases):**
+ - synchronisation lift C_l 0.8 in the band f̂0 0.18 ± 0.08;
+ - in-line force C_x 0.85, α 0.15 (Ulveseter et al. 2018);
+ - C_D 1.2;
+ - a `VIV AMPLITUDE` table with C_v 0.8 constant and the drag amplification of Chaplin et al.
+ (2005a, Eq. 4), CdAmp = 1 + 2.3 s + 1.7 s², s = (A/D)/√2, at A/D 0–1.5;
+ - `VIV DAMPING` `0 0 1`: the amplification acts on the in-line drag only, and the cross-flow drag
+ stays Morison's.
+- **Measurements:** the experimenters' processed results, from their presentation of the blind
+ trial (Chaplin et al., Trondheim, October 2004). The slides are vector graphics, so the values are
+ the plotted coordinates mapped through the tick labels, not a pixel digitisation:
+ - `measured_summary.csv`, from slides 17–19: maximum cross-flow displacement, maximum mean and
+ maximum dynamic in-line displacement (in D), and the overall standard deviation of the in-line
+ and cross-flow curvature (κD). Its `U` column is the speed read from each point; it matches
+ the tabulated speed within 0.006 m/s, which checks the axis mapping.
+ - `envelopes/`: the measured envelopes along the riser of each case (slides 7–15), with their
+ columns, checks and the assumed curvature scale in [`envelopes/README.md`](envelopes/README.md).
+ - The dominant cross-flow mode numbers 2, 3, 4, 5, 6, 6, 7, 7, 7 (slide 23).
+- **Assumed:** the 11.4 kN/m top spring (the page also lists 38.1 kN/m, without saying which tests
+ used which); the 0.33 % structural damping as bending damping of a pure bending mode at 2 Hz (the
+ page gives no frequency).
+- **CableDyn:** 64 elements; dt the largest of 5, 2.5, 2, 1 and 0.5 ms at or below 1/200 of the
+ shedding period D/(0.18 U) (2.5 ms in cases 1–3, 1 ms in 4–7, 0.5 ms in 8–9); `VIVrmsWindow`
+ 0.25 s; 40 s, statistics over t > 15 s.
+- **Metrics:** x is in-line and y cross-flow, both from the line between the joints.
+ - dominant cross-flow mode: the pinned-pinned sine with the largest r.m.s. projection of y;
+ - maximum cross-flow amplitude: the largest half peak-to-peak of y along the riser, against the
+ slide-18 maximum;
+ - maximum mean in-line displacement: the largest time mean of x;
+ - dominant cross-flow frequency (`response_comparison.csv` only): the spectral peak of y a
+ quarter of the length above the lower joint, at a resolution of 0.04 Hz;
+ - overall standard deviation of curvature: the r.m.s. over the nodes of the standard deviation
+ of the curvature (second differences of the node positions), times D.
+
+## Reproduce
+
+From the repository root, with `path/to/cabledyn.exe` the release executable or a local build:
+
+```powershell
+python validation/experiments/delta_flume/delta_flume_viv.py `
+ path/to/cabledyn.exe validation/experiments/delta_flume/work `
+ --summary validation/experiments/delta_flume
+```
+
+The nine cases run in parallel (`--jobs`), in about two minutes on a 24-core workstation. `--cases`
+(for example `5,9`) selects cases; `--segments`, `--dt-scale` and `--spring` change the mesh, the
+time step and the top spring.
+
+## Results
+
+CableDyn / measured; the measured cross-flow amplitude is the slide-18 maximum, with the half
+peak-to-peak of the measured envelope in brackets.
+
+| Case | U (m/s) | Mode | A_CF/D | Mean IL/D | Std κD, CF | Std κD, IL | Mean top tension (N) |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| 1 | 0.16 | 2 / 2 | 0.653 / 0.757 (0.763) | 1.19 / 1.06 | 5.7e-5 / 9.3e-5 | 3.5e-5 / 5.0e-5 | 409 / 405 |
+| 2 | 0.21 | 3 / 3 | 0.602 / 0.579 (0.561) | 1.60 / 1.19 | 1.11e-4 / 0.89e-4 | 7.2e-5 / 3.4e-5 | 413 / 407 |
+| 3 | 0.31 | 4 / 4 | 0.628 / 0.779 (0.809) | 3.27 / 3.45 | 2.05e-4 / 2.70e-4 | 0.92e-4 / 1.95e-4 | 476 / 457 |
+| 4 | 0.40 | **4** / 5 | 0.700 / 0.674 (0.595) | 4.78 / 4.97 | 2.30e-4 / 3.18e-4 | 1.36e-4 / 2.69e-4 | 541 / 506 |
+| 5 | 0.54 | 6 / 6 | 0.658 / 0.843 (0.889) | 6.53 / 6.69 | 4.45e-4 / 4.81e-4 | 2.00e-4 / 2.31e-4 | 660 / 598 |
+| 6 | 0.60 | 6 / 6 | 0.679 / 0.709 (0.779) | 6.94 / 8.13 | 4.55e-4 / 4.77e-4 | 2.32e-4 / 4.57e-4 | 738 / 670 |
+| 7 | 0.70 | **6** / 7 | 0.738 / 0.777 (0.717) | 8.28 / 8.90 | 4.63e-4 / 6.47e-4 | 2.69e-4 / 3.03e-4 | 835 / 743 |
+| 8 | 0.85 | **6** / 7 | 0.769 / 0.907 (0.890) | 9.66 / 11.18 | 4.94e-4 / 6.89e-4 | 2.68e-4 / 4.48e-4 | 1046 / 923 |
+| 9 | 0.95 | **8** / 7 | 0.595 / 1.074 (0.996) | 10.15 / 13.51 | 6.87e-4 / 7.36e-4 | 3.67e-4 / 6.24e-4 | 1128 / 1002 |
+
+- **Dominant cross-flow mode:** right in 5 of 9 cases and within one in the other four (one low in
+ cases 4, 7 and 8, one high in case 9). Four of the eleven blind predictions found 7 or 8 of the 9
+ (slide 24).
+- **Mean in-line displacement:** within ±17 % in 7 of 9 cases; +34 % in case 2, where the
+ measured maximum is 1.2 D, and −25 % in case 9. The blind predictions under-predicted the drag
+ amplification, and with it the mean in-line displacement, by 20–40 % (slide 26).
+- **Cross-flow amplitude:** −45 % to +4 % against the slide-18 maxima (−40 % to +18 % against
+ the envelopes), within ±12 %, the scatter between the two measured values, in cases 2, 4, 6
+ and 7. The −45 % of case 9 goes with the response in mode 8.
+- **Curvature:** the cross-flow standard deviation is −39 % to +26 %, low in every case but 2
+ (−5 % to −28 % in cases 3–9); the in-line one −53 % to +111 %. The blind predictions' r.m.s.
+ curvatures were 20 % to 180 % of the measured (slide 26).
+- **Top tension:** the static top tension in the current is the measured mean, but the drag
+ amplification bows the riser further: the mean top tension of the run is 1–13 % above the
+ measured mean (7–13 % in cases 4–9), so the run is stiffer than the test at the higher
+ speeds.
+- **Convergence (`provenance.json`):**
+ - cases 1–4, 7 and 8: half the time step leaves the mode and changes the mean in-line
+ displacement and the cross-flow curvature standard deviation by at most 0.6 %, the peak
+ amplitude by at most 2.7 % and the in-line curvature by at most 1.2 %; 128 elements leave the
+ mode and change them by at most 2.7 %, 5.9 % and 3.1 %, except the in-line curvature of case
+ 8 (+19 %);
+ - case 5: half the time step and 128 elements change its in-line curvature by +22 % and +25 %
+ and the other metrics by at most 6.4 %; an 80 s run raises its peak amplitude by 2.6 %;
+ - case 6: its peak amplitude depends on the step and the mesh, −11 % at half the time step
+ (kept over an 80 s run: 0.604 against 0.679) and −13 % with 128 elements, while the mean
+ in-line displacement and the cross-flow curvature move by at most 2 % and the in-line
+ curvature by at most 12 %;
+ - case 9 has two responses: at half the time step it settles in mode 7 (5.80 Hz, A/D 0.751,
+ mean in-line displacement 10.68 D), with the base step and with 128 elements in mode 8
+ (6.60 and 6.64 Hz), which an 80 s run keeps.
+- **Top spring 38.1 kN/m (`--spring 38.1e3`):** the mean top tension of the run is up to 14 %
+ higher and the mean in-line displacement 2–17 % lower, within ±17 % in 4 of 9 cases; the mode
+ is right in 5 of 9 (case 9 in mode 7, case 5 in mode 5, case 8 in mode 5).
+
+`response_comparison.csv` holds the per-case values with their errors, and `summary.json` the
+statistics and the SHA-256 of the executable.
diff --git a/validation/experiments/delta_flume/delta_flume_viv.py b/validation/experiments/delta_flume/delta_flume_viv.py
new file mode 100644
index 00000000..c80fe90c
--- /dev/null
+++ b/validation/experiments/delta_flume/delta_flume_viv.py
@@ -0,0 +1,451 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+"""Cross-flow and in-line VIV of the Delta Flume vertical tension riser, blind-trial cases 1-9.
+
+The nine stepped-current cases of the blind-prediction trial of Chaplin et al. (2005b): the lower
+5.94 m of the 13.12 m riser in a uniform current of 0.16-0.95 m/s, the rest in still water.
+Writes a deck per case, sets its unstretched length so that the static top tension in the current
+is the case's measured mean, runs it, and compares with the measured response: the dominant
+cross-flow mode, the largest cross-flow amplitude, the largest mean in-line deflection and the
+overall standard deviations of the in-line and cross-flow curvature.
+
+ python delta_flume_viv.py path/to/cabledyn.exe WORKDIR [--cases 1-9] [--segments 64]
+ [--dt-scale 1] [--tmax 40] [--t0 15] [--spring 11.4e3] [--jobs N] [--summary DIR]
+
+Sources:
+ J.R. Chaplin, P.W. Bearman, F.J. Huera Huarte, R.J. Pattenden (2005a), Laboratory measurements
+ of vortex-induced vibrations of a vertical tension riser in a stepped current, Journal of Fluids
+ and Structures 21(1), 3-24, https://doi.org/10.1016/j.jfluidstructs.2005.04.010 (the riser;
+ Eq. 4, the drag amplification)
+ J.R. Chaplin, P.W. Bearman, Y. Cheng, E. Fontaine, J.M.R. Graham, K. Herfjord, F.J. Huera
+ Huarte, M. Isherwood, K. Lambrakos, C.M. Larsen, J.R. Meneghini, G. Moe, R.J. Pattenden,
+ M.S. Triantafyllou, R.H.J. Willden (2005b), Blind predictions of laboratory measurements of
+ vortex-induced vibrations of a tension riser, Journal of Fluids and Structures 21(1), 25-40,
+ https://doi.org/10.1016/j.jfluidstructs.2005.05.016 (the blind-trial cases; the measured
+ results are those of the authors' presentation of the trial, Trondheim, October 2004)
+ The project's pages at the University of Southampton (archived): the mechanical properties
+ (mass, structural damping, axial and top-spring stiffness) and the current zone
+"""
+
+from __future__ import annotations
+
+import argparse
+import csv
+import hashlib
+import json
+import math
+import os
+import shutil
+import subprocess
+from concurrent.futures import ThreadPoolExecutor
+from pathlib import Path
+
+import numpy as np
+
+HERE = Path(__file__).resolve().parent
+
+# The riser (Chaplin et al. 2005a, Sec. 2; the Southampton mechanical-properties page): 13.12 m
+# between pinned joints, D 28 mm, EI 29.9 N m^2, mass ratio 3.0 with the internal water
+# (1.847 kg/m; the page gives 1.85 kg/m and the 12.1 N/m submerged weight), EA 5.88 MN,
+# structural damping 0.33 % of critical, top spring 11.4 kN/m (the page gives 11.4 or 38.1).
+LENGTH = 13.12 # m
+DIAMETER = 0.028 # m
+EI = 29.9 # N m^2
+EA_RISER = 5.88e6 # N
+MASS_RATIO = 3.0
+RHO_W = 1000.0 # kg/m^3, fresh water
+GRAVITY = 9.80665 # m/s^2
+AREA = math.pi * DIAMETER**2 / 4.0
+MASS = MASS_RATIO * RHO_W * AREA # kg/m
+SUBMERGED_WEIGHT = (MASS - RHO_W * AREA) * GRAVITY # N/m
+ZETA = 0.0033 # structural damping ratio, as bending damping of a pure bending mode at F_REF
+F_REF = 2.0 # Hz (the frequency of the measured damping is not given)
+CURRENT_HEIGHT = 5.94 # m: the current zone above the lower joint, still water above
+Z_BOTTOM = -14.0 # m, lower joint; the top joint at Z_BOTTOM + LENGTH
+WATER_DEPTH = 20.0 # m
+
+# Blind-trial cases (presentation slide 3): towing speed [m/s] and mean top tension [N]
+CASES: dict[int, tuple[float, float]] = {
+ 1: (0.16, 405.0),
+ 2: (0.21, 407.0),
+ 3: (0.31, 457.0),
+ 4: (0.40, 506.0),
+ 5: (0.54, 598.0),
+ 6: (0.60, 670.0),
+ 7: (0.70, 743.0),
+ 8: (0.85, 923.0),
+ 9: (0.95, 1002.0),
+}
+# Measured dominant cross-flow mode numbers (slide 23)
+MEASURED_MODES = {1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 6, 7: 7, 8: 7, 9: 7}
+
+# VIV set, not fitted to these measurements: synchronisation lift Cl 0.8 in the band
+# cF 0.18 +- dF 0.08; in-line force ClX 0.85, alpha 0.15 (Ulveseter et al. 2018); Cd 1.2, Ca 1.
+CD, CA, CL, DF, CF = 1.2, 1.0, 0.8, 0.08, 0.18
+CLX, ALPHA = 0.85, 0.15
+CV = 0.8 # the VIV AMPLITUDE table holds Cv = Cl constant
+VIV_RMS_WINDOW = 0.25 # s, the same averaging time at every dtM
+
+
+def trapezoid_rows(f: np.ndarray, x: np.ndarray) -> np.ndarray:
+ """Trapezoidal integral of each row of f over x (NumPy 1.x has no np.trapezoid)."""
+ return 0.5 * ((f[:, 1:] + f[:, :-1]) * np.diff(x)).sum(axis=1)
+
+
+def drag_amplification(ad: float) -> float:
+ """Chaplin et al. (2005a, Eq. 4): Cd/Cd0 = 1 + 2.3 s + 1.7 s^2, s = (A/D)/sqrt(2)."""
+ s = ad / math.sqrt(2.0)
+ return 1.0 + 2.3 * s + 1.7 * s * s
+
+
+def effective_ea(spring: float) -> float:
+ """The top spring in series with the riser, as one axial stiffness of the line."""
+ return LENGTH / (1.0 / spring + LENGTH / EA_RISER)
+
+
+def time_step(u: float, scale: float) -> float:
+ """The largest round step at or below 1/200 of the shedding period D/(cF U), times scale."""
+ target = DIAMETER / (CF * u) / 200.0
+ base = max(s for s in (0.005, 0.0025, 0.002, 0.001, 0.0005) if s <= target)
+ return base * scale
+
+
+def deck_text(
+ case: int, l0: float, segments: int, dt: float, tmax: float, ea: float
+) -> str:
+ u, t_top = CASES[case]
+ amp = "".join(
+ f"riser {ad:.2f} {CV} {drag_amplification(ad):.5f}\n"
+ for ad in (0.1 * k for k in range(16))
+ )
+ return f"""--------------------- CableDyn Input File ---------------------------------
+Delta Flume riser, blind-trial case {case}: U {u} m/s, top tension {t_top:g} N
+----------------------- LINE TYPES ------------------------------------------
+TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t Cl dF cF
+(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-) (-) (-) (-)
+riser {DIAMETER} {MASS:.6f} {ea:.6e} 0.0 {EI}|-{ZETA}|{F_REF} {CD} 0.0 {CA} 0.0 {CL} {DF} {CF}
+----------------------- POINTS ----------------------------------------------
+ID Attachment X Y Z M V CdA CA
+(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
+1 Coupled 0.0 0.0 {Z_BOTTOM + LENGTH:.6f} 0 0 0 0
+2 Fixed 0.0 0.0 {Z_BOTTOM:.6f} 0 0 0 0
+----------------------- LINES -----------------------------------------------
+ID LineType AttachA AttachB UnstrLen NumSegs Outputs
+(-) (-) (-) (-) (m) (-) (-)
+1 riser 1 2 {l0:.9f} {segments} p
+--------------------- VIV ----------------------------------------------
+TypeName ClX alpha
+(-) (-) (-)
+riser {CLX} {ALPHA}
+--------------------- VIV AMPLITUDE ------------------------------------
+TypeName AD Cv CdAmp
+(-) (-) (-) (-)
+{amp}--------------------- VIV DAMPING ------------------------------------
+TypeName a b c
+(-) (-) (-) (-)
+riser 0 0 1
+---------------------- OPTIONS ----------------------------------------------
+{RHO_W} rhoW
+{GRAVITY} g
+{WATER_DEPTH} WtrDpth
+{dt:.6f} dtM
+{round(tmax / dt) * dt:.6f} TMax
+1 Currents
+{VIV_RMS_WINDOW} VIVrmsWindow
+---------------------- OUTPUTS -----------------------------------------------
+FairTen1
+END
+------------------------- need this line --------------------------------------
+"""
+
+
+def write_current(folder: Path, u: float) -> None:
+ """Uniform U over the lower CURRENT_HEIGHT, still water above (a 2 cm linear step)."""
+ zc = Z_BOTTOM + CURRENT_HEIGHT
+ (folder / "current_profile.txt").write_text(
+ "z ux uy uz\n(m) (m/s) (m/s) (m/s)\n"
+ f"{-WATER_DEPTH:.3f} {u} 0 0\n{zc - 0.01:.3f} {u} 0 0\n"
+ f"{zc + 0.01:.3f} 0 0 0\n0.0 0 0 0\n",
+ encoding="utf-8",
+ )
+
+
+def run(exe: Path, folder: Path, stem: str) -> None:
+ env = dict(os.environ, OMP_NUM_THREADS="1")
+ proc = subprocess.run(
+ [str(exe), f"{stem}.dat", stem],
+ cwd=folder,
+ capture_output=True,
+ text=True,
+ encoding="utf-8",
+ errors="replace",
+ env=env,
+ check=False,
+ )
+ (folder / f"{stem}.console.txt").write_text(
+ proc.stdout + proc.stderr, encoding="utf-8"
+ )
+ if proc.returncode != 0:
+ raise SystemExit(f"{folder / stem}: CableDyn exited with {proc.returncode}")
+
+
+def static_top_tension(folder: Path, stem: str) -> float:
+ rows = (folder / f"{stem}.static.out").read_text(encoding="utf-8").splitlines()
+ head = rows[1].split()
+ first = rows[3].split() # node 1, End A, the top joint
+ return float(first[head.index("Tension")])
+
+
+def tuned_length(exe: Path, folder: Path, case: int, segments: int, ea: float):
+ """Unstretched length whose static top tension in the current is the case's mean tension.
+
+ The start is the still-water length, the exact integral of ds / (1 + T(s)/EA) with T falling
+ by the submerged weight down the riser; the current's bow then raises the tension, and each
+ iteration corrects the length by the tension error over EA.
+ """
+ t_target = CASES[case][1]
+ t_bottom = t_target - SUBMERGED_WEIGHT * LENGTH
+ l0 = ea / SUBMERGED_WEIGHT * math.log((ea + t_target) / (ea + t_bottom))
+ for _ in range(12):
+ stem = "static"
+ (folder / f"{stem}.dat").write_text(
+ deck_text(case, l0, segments, 0.005, 0.0, ea), encoding="utf-8"
+ )
+ run(exe, folder, stem)
+ t = static_top_tension(folder, stem)
+ if abs(t - t_target) < 0.05:
+ return l0, t
+ l0 *= 1.0 + (t - t_target) / ea
+ raise SystemExit(f"case {case}: the static top tension did not converge ({t} N)")
+
+
+def response(folder: Path, stem: str, t0: float) -> dict:
+ """Response metrics of a run, statistics over t > t0.
+
+ x is in-line (along the current), y cross-flow, both from the line between the joints.
+ """
+ path = folder / f"{stem}.Line1.p.out"
+ a = np.loadtxt(path, skiprows=2)
+ keep = a[:, 0] > t0
+ t = a[keep, 0]
+ xyz = a[keep, 1:].reshape(len(t), -1, 3)
+ x, y, z = xyz[:, :, 0], xyz[:, :, 1], xyz[:, :, 2]
+ # height over the chord, 0 at the lower joint
+ s = (z.mean(axis=0) - Z_BOTTOM) / LENGTH
+ half_pp = (y.max(axis=0) - y.min(axis=0)) / 2.0 / DIAMETER
+ x_mean = x.mean(axis=0) / DIAMETER
+ # dominant cross-flow mode: the largest r.m.s. projection on the pinned-pinned sines
+ yd = y - y.mean(axis=0)
+ o = np.argsort(s)
+ so = s[o]
+ proj = [
+ float(
+ np.sqrt(np.mean(trapezoid_rows(yd[:, o] * np.sin(n * np.pi * so), so) ** 2))
+ )
+ for n in range(1, 16)
+ ]
+ mode = int(np.argmax(proj)) + 1
+ # dominant cross-flow frequency a quarter of the length above the lower joint
+ j = int(np.argmin(np.abs(s - 0.25)))
+ sig = yd[:, j] * np.hanning(len(t))
+ freq = np.fft.rfftfreq(len(t), t[1] - t[0])
+ f_cf = float(freq[1 + int(np.argmax(np.abs(np.fft.rfft(sig))[1:]))])
+ # curvature from second differences of the node positions (equal elements along the arc);
+ # overall standard deviation = r.m.s. over the interior nodes of the standard deviation
+ ds = LENGTH / (xyz.shape[1] - 1)
+ kx = (x[:, 2:] - 2.0 * x[:, 1:-1] + x[:, :-2]) / ds**2
+ ky = (y[:, 2:] - 2.0 * y[:, 1:-1] + y[:, :-2]) / ds**2
+ tension = np.loadtxt(folder / f"{stem}.out", skiprows=2)
+ tension = tension[tension[:, 0] > t0, 1]
+ return {
+ "mode": mode,
+ "f_cf_hz": f_cf,
+ "frequency_resolution_hz": float(freq[1]),
+ "max_cf_half_pp_D": float(half_pp.max()),
+ "max_il_mean_D": float(x_mean.max()),
+ "std_curv_il_kD": float(np.sqrt(np.mean(np.var(kx, axis=0))) * DIAMETER),
+ "std_curv_cf_kD": float(np.sqrt(np.mean(np.var(ky, axis=0))) * DIAMETER),
+ "mean_top_tension_N": float(tension.mean()),
+ "std_top_tension_N": float(tension.std()),
+ }
+
+
+def measured() -> tuple[dict, dict]:
+ with open(HERE / "measured_summary.csv", encoding="utf-8") as fh:
+ summ = {
+ (r["quantity"], int(r["case"])): float(r["value"])
+ for r in csv.DictReader(fh)
+ }
+ env = {}
+ for case in CASES:
+ with open(
+ HERE / "envelopes" / f"case{case}_envelopes.csv", encoding="utf-8"
+ ) as fh:
+ rows = list(csv.DictReader(fh))
+ env[case] = max((float(r["y_max_D"]) - float(r["y_min_D"])) / 2.0 for r in rows)
+ return summ, env
+
+
+def parse_cases(text: str) -> list[int]:
+ out: list[int] = []
+ for part in text.split(","):
+ lo, _, hi = part.partition("-")
+ out += range(int(lo), int(hi or lo) + 1)
+ if not out or any(c not in CASES for c in out):
+ raise SystemExit(f"--cases: cases are 1-9, got {text!r}")
+ return sorted(set(out))
+
+
+def main() -> None:
+ ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
+ ap.add_argument("exe")
+ ap.add_argument("workdir")
+ ap.add_argument("--cases", default="1-9", help="for example 1-9, 5 or 5,9")
+ ap.add_argument("--segments", type=int, default=64)
+ ap.add_argument(
+ "--dt-scale",
+ type=float,
+ default=1.0,
+ help="factor of each case's time step (1: 1/200 of the shedding period, rounded down)",
+ )
+ ap.add_argument("--tmax", type=float, default=40.0)
+ ap.add_argument(
+ "--t0", type=float, default=15.0, help="start of the statistics [s]"
+ )
+ ap.add_argument(
+ "--spring", type=float, default=11.4e3, help="top spring stiffness [N/m]"
+ )
+ ap.add_argument("--jobs", type=int, default=min(9, os.cpu_count() or 1))
+ ap.add_argument(
+ "--summary",
+ default=None,
+ help="directory for the comparison CSV and summary JSON",
+ )
+ a = ap.parse_args()
+ found = a.exe if Path(a.exe).is_file() else shutil.which(a.exe)
+ if found is None:
+ raise SystemExit(f"CableDyn executable not found: {a.exe}")
+ exe = Path(found).resolve()
+ cases = parse_cases(a.cases)
+ ea = effective_ea(a.spring)
+ tag = f"n{a.segments}_dt{a.dt_scale:g}_k{a.spring:g}"
+
+ def one(case: int) -> dict:
+ u, _ = CASES[case]
+ folder = Path(a.workdir).resolve() / f"case{case}_{tag}"
+ folder.mkdir(parents=True, exist_ok=True)
+ write_current(folder, u)
+ l0, t_static = tuned_length(exe, folder, case, a.segments, ea)
+ dt = time_step(u, a.dt_scale)
+ stem = f"case{case}"
+ (folder / f"{stem}.dat").write_text(
+ deck_text(case, l0, a.segments, dt, a.tmax, ea), encoding="utf-8"
+ )
+ run(exe, folder, stem)
+ out = {
+ "case": case,
+ "dt_s": dt,
+ "unstretched_length_m": l0,
+ "static_top_tension_N": t_static,
+ }
+ out.update(response(folder, stem, a.t0))
+ return out
+
+ with ThreadPoolExecutor(max_workers=max(1, a.jobs)) as pool:
+ results = list(pool.map(one, cases))
+
+ summ, env = measured()
+
+ def pct(model: float, meas: float) -> float:
+ return round(100.0 * (model / meas - 1.0), 1)
+
+ rows = []
+ for r in results:
+ c = r["case"]
+ u, t_top = CASES[c]
+ rows.append(
+ {
+ "case": c,
+ "U_m_per_s": u,
+ "top_tension_N": t_top,
+ "dt_s": r["dt_s"],
+ "mode_measured": MEASURED_MODES[c],
+ "mode_cabledyn": r["mode"],
+ "f_cf_cabledyn_hz": round(r["f_cf_hz"], 3),
+ "max_cf_D_measured": round(summ[("max_cf_disp_D", c)], 4),
+ "max_cf_half_pp_D_measured_envelope": round(env[c], 4),
+ "max_cf_half_pp_D_cabledyn": round(r["max_cf_half_pp_D"], 4),
+ "max_cf_error_percent": pct(
+ r["max_cf_half_pp_D"], summ[("max_cf_disp_D", c)]
+ ),
+ "max_cf_envelope_error_percent": pct(r["max_cf_half_pp_D"], env[c]),
+ "max_il_mean_D_measured": round(summ[("max_il_mean_D", c)], 3),
+ "max_il_mean_D_cabledyn": round(r["max_il_mean_D"], 3),
+ "max_il_mean_error_percent": pct(
+ r["max_il_mean_D"], summ[("max_il_mean_D", c)]
+ ),
+ "std_curv_cf_kD_measured": f"{summ[('std_curv_cf_kD', c)]:.4e}",
+ "std_curv_cf_kD_cabledyn": f"{r['std_curv_cf_kD']:.4e}",
+ "std_curv_cf_error_percent": pct(
+ r["std_curv_cf_kD"], summ[("std_curv_cf_kD", c)]
+ ),
+ "std_curv_il_kD_measured": f"{summ[('std_curv_il_kD', c)]:.4e}",
+ "std_curv_il_kD_cabledyn": f"{r['std_curv_il_kD']:.4e}",
+ "std_curv_il_error_percent": pct(
+ r["std_curv_il_kD"], summ[("std_curv_il_kD", c)]
+ ),
+ "mean_top_tension_N_cabledyn": round(r["mean_top_tension_N"], 1),
+ }
+ )
+ print(
+ f"case {c}: mode {r['mode']}/{MEASURED_MODES[c]}, f_CF {r['f_cf_hz']:.2f} Hz, "
+ f"A_CF/D {r['max_cf_half_pp_D']:.3f}/{summ[('max_cf_disp_D', c)]:.3f}, "
+ f"IL mean/D {r['max_il_mean_D']:.2f}/{summ[('max_il_mean_D', c)]:.2f}, "
+ f"sd kD CF {r['std_curv_cf_kD']:.2e}/{summ[('std_curv_cf_kD', c)]:.2e}, "
+ f"IL {r['std_curv_il_kD']:.2e}/{summ[('std_curv_il_kD', c)]:.2e}"
+ )
+
+ def span(key: str) -> list[float]:
+ values = [r[key] for r in rows]
+ return [min(values), max(values)]
+
+ il_err = [r["max_il_mean_error_percent"] for r in rows]
+ summary = {
+ "cases": cases,
+ "segments": a.segments,
+ "dt_scale": a.dt_scale,
+ "tmax_s": a.tmax,
+ "statistics_after_s": a.t0,
+ "top_spring_N_per_m": a.spring,
+ "effective_axial_stiffness_N": round(ea, 1),
+ "modes_right": sum(r["mode_cabledyn"] == r["mode_measured"] for r in rows),
+ "modes_within_one": sum(
+ abs(r["mode_cabledyn"] - r["mode_measured"]) <= 1 for r in rows
+ ),
+ "il_mean_within_17_percent": sum(abs(e) <= 17.0 for e in il_err),
+ "il_mean_error_percent_range": span("max_il_mean_error_percent"),
+ "max_cf_error_percent_range": span("max_cf_error_percent"),
+ "max_cf_envelope_error_percent_range": span("max_cf_envelope_error_percent"),
+ "std_curv_cf_error_percent_range": span("std_curv_cf_error_percent"),
+ "std_curv_il_error_percent_range": span("std_curv_il_error_percent"),
+ "per_case": rows,
+ "executable_sha256": hashlib.sha256(exe.read_bytes()).hexdigest(),
+ }
+ print(json.dumps({k: v for k, v in summary.items() if k != "per_case"}, indent=2))
+ if a.summary:
+ out = Path(a.summary)
+ out.mkdir(parents=True, exist_ok=True)
+ with open(
+ out / "response_comparison.csv", "w", newline="", encoding="utf-8"
+ ) as fh:
+ w = csv.DictWriter(fh, fieldnames=list(rows[0]), lineterminator="\n")
+ w.writeheader()
+ w.writerows(rows)
+ (out / "summary.json").write_text(
+ json.dumps(summary, indent=2) + "\n", encoding="utf-8", newline="\n"
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/validation/experiments/delta_flume/envelopes/README.md b/validation/experiments/delta_flume/envelopes/README.md
new file mode 100644
index 00000000..c49a1057
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/README.md
@@ -0,0 +1,29 @@
+
+
+# Measured response envelopes, blind-trial cases 1–9
+
+`case_envelopes.csv` holds the measured envelopes along the riser of case N, read from the
+measurement curves (the top row of slides 7–15) of the experimenters' presentation of the blind
+trial of Chaplin et al. (2005b), . The slides
+are vector graphics: each measured curve is a polyline of 102 nearly equally spaced vertices from
+one end of the riser to the other, so the values are the plotted vertices, linearly resampled to
+101 equally spaced stations, not a pixel digitisation.
+
+| Column | Meaning |
+| --- | --- |
+| `z_over_L` | height above the lower joint over the 13.12 m length: 0 at the lower joint (in the current), 1 at the top joint |
+| `x_min_D`, `x_mean_D`, `x_max_D` | in-line displacement (along the current) over the diameter: minimum, mean and maximum; zero is the panel edge that the end stations touch |
+| `y_min_D`, `y_max_D` | cross-flow displacement over the diameter: minimum and maximum, about the panel centre |
+| `kx_rms_D`, `ky_rms_D` | in-line and cross-flow r.m.s. curvature times the diameter (see below) |
+
+- **Displacement scales:** the in-line panel's `10` tick and the cross-flow panel's `-1` and `1`
+ ticks. As a check, the largest `x_mean_D` of each case is within 0.05 D (4 %) of the measured
+ maximum mean in-line displacement of slide 17 (`../measured_summary.csv`).
+- **Cross-flow scatter:** half the largest peak-to-peak of the cross-flow envelope differs from
+ the measured maximum cross-flow displacement of slide 18 by −12 % to +10 %. The experimenters
+ processed quasi-steady windows of each record, and slide 18 summarises them; this difference is
+ the scale of the measurement scatter in a peak amplitude.
+- **Curvature scale (assumed):** the curvature panels carry no scale. Each shape is scaled so that
+ its r.m.s. over the 101 stations equals the overall standard deviation of curvature of slide 19
+ for the case, assuming that number is the r.m.s. over the span of the r.m.s. curvature. The
+ shapes and the positions of their peaks do not depend on the assumption; the magnitudes do.
diff --git a/validation/experiments/delta_flume/envelopes/case1_envelopes.csv b/validation/experiments/delta_flume/envelopes/case1_envelopes.csv
new file mode 100644
index 00000000..fba4d051
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case1_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019215,0.0019215,0,0
+0.9900,-0.008835,0.017901,0.026852,-0.040876,0.047177,6.3492e-06,1.6376e-05
+0.9800,-0.0091084,0.027331,0.063069,-0.085126,0.091014,1.2212e-05,3.2267e-05
+0.9700,-0.014717,0.044402,0.09522,-0.12707,0.13294,1.8406e-05,4.6756e-05
+0.9600,-0.015259,0.066097,0.12792,-0.17507,0.185,2.4988e-05,6.2761e-05
+0.9500,-0.015259,0.083437,0.154,-0.21563,0.22514,3.1303e-05,7.3985e-05
+0.9400,-0.015259,0.090621,0.18952,-0.25454,0.26,3.7547e-05,8.2517e-05
+0.9300,-0.015002,0.10806,0.21575,-0.29005,0.29136,4.3439e-05,8.9259e-05
+0.9200,-0.0086153,0.12674,0.2436,-0.32334,0.32437,4.9129e-05,9.3376e-05
+0.9100,2.3856e-05,0.14413,0.26683,-0.35316,0.34939,5.3576e-05,9.4635e-05
+0.9000,0.0087751,0.16164,0.29297,-0.38202,0.37681,5.7197e-05,9.3897e-05
+0.8900,0.021503,0.18087,0.32598,-0.41604,0.40712,6.0057e-05,9.0807e-05
+0.8800,0.039055,0.19851,0.34875,-0.43734,0.42756,6.1421e-05,8.5957e-05
+0.8700,0.057226,0.21698,0.3684,-0.46347,0.44965,6.1351e-05,8.0365e-05
+0.8600,0.072822,0.23432,0.39394,-0.49197,0.47193,6.072e-05,7.5187e-05
+0.8500,0.10076,0.25002,0.41227,-0.52161,0.50126,5.8818e-05,7.1183e-05
+0.8400,0.12706,0.26774,0.42677,-0.54938,0.53018,5.6704e-05,6.8927e-05
+0.8300,0.15636,0.28851,0.44183,-0.58327,0.56023,5.3676e-05,7.1039e-05
+0.8200,0.18389,0.30518,0.45579,-0.61273,0.58891,5.0665e-05,7.6146e-05
+0.8100,0.21156,0.32595,0.46493,-0.64087,0.61418,4.7198e-05,8.3043e-05
+0.8000,0.23574,0.34304,0.47212,-0.66164,0.63463,4.3311e-05,9.1522e-05
+0.7900,0.25278,0.35859,0.47312,-0.68164,0.65603,3.9321e-05,0.00010006
+0.7800,0.27706,0.37622,0.47827,-0.69619,0.67568,3.3869e-05,0.0001076
+0.7700,0.28757,0.39536,0.48123,-0.71083,0.6909,2.8293e-05,0.00011408
+0.7600,0.30438,0.41568,0.50344,-0.71802,0.70235,2.1349e-05,0.0001198
+0.7500,0.31561,0.43185,0.52289,-0.71896,0.70843,1.7948e-05,0.00012207
+0.7400,0.32356,0.44954,0.53841,-0.71515,0.71055,1.8235e-05,0.00012162
+0.7300,0.33114,0.46678,0.55804,-0.70577,0.7043,2.2216e-05,0.00011957
+0.7200,0.34034,0.48222,0.58227,-0.69057,0.69377,2.8448e-05,0.00011588
+0.7100,0.34034,0.50126,0.60988,-0.67095,0.67809,3.546e-05,0.00010996
+0.7000,0.34172,0.52156,0.63984,-0.64379,0.65417,4.2243e-05,0.00010251
+0.6900,0.34649,0.54041,0.67884,-0.60885,0.62235,4.8628e-05,9.3562e-05
+0.6800,0.34969,0.5583,0.70779,-0.57681,0.59283,5.3797e-05,8.6545e-05
+0.6700,0.35877,0.57652,0.73806,-0.54291,0.5577,5.785e-05,7.9881e-05
+0.6600,0.37046,0.5933,0.76255,-0.50654,0.51931,6.0783e-05,7.5172e-05
+0.6500,0.38593,0.60927,0.78707,-0.46551,0.48017,6.3756e-05,7.3314e-05
+0.6400,0.40147,0.62837,0.80617,-0.42225,0.43712,6.5923e-05,7.4958e-05
+0.6300,0.42824,0.64755,0.83083,-0.3819,0.38928,6.7605e-05,8.0018e-05
+0.6200,0.44939,0.6643,0.84888,-0.35198,0.36024,6.8512e-05,8.6767e-05
+0.6100,0.46957,0.68642,0.86022,-0.33169,0.34569,6.8512e-05,9.4217e-05
+0.6000,0.4893,0.70943,0.878,-0.31413,0.33319,6.7858e-05,0.00010132
+0.5900,0.51617,0.72735,0.89592,-0.29755,0.32079,6.6058e-05,0.00010673
+0.5800,0.54615,0.74417,0.91066,-0.28217,0.30653,6.356e-05,0.0001098
+0.5700,0.5809,0.76218,0.92065,-0.26395,0.29251,5.9426e-05,0.00011011
+0.5600,0.61441,0.78401,0.92907,-0.24595,0.27862,5.335e-05,0.00010663
+0.5500,0.65007,0.80173,0.93194,-0.22752,0.26637,4.7116e-05,9.9894e-05
+0.5400,0.68768,0.81765,0.93194,-0.20835,0.2528,4.0574e-05,8.9769e-05
+0.5300,0.72693,0.83562,0.93194,-0.18835,0.23682,3.3406e-05,7.6577e-05
+0.5200,0.76841,0.85705,0.93194,-0.17761,0.22293,2.62e-05,6.1214e-05
+0.5100,0.81112,0.87854,0.93194,-0.19067,0.21644,2.0148e-05,4.5642e-05
+0.5000,0.84807,0.89851,0.93194,-0.23024,0.24126,1.6503e-05,3.2247e-05
+0.4900,0.86691,0.91833,0.95923,-0.27941,0.29529,1.765e-05,3.0427e-05
+0.4800,0.87067,0.93578,0.99621,-0.32407,0.3438,2.1935e-05,3.9135e-05
+0.4700,0.87067,0.95225,1.031,-0.37076,0.39208,2.73e-05,5.3548e-05
+0.4600,0.87067,0.96882,1.067,-0.41798,0.43906,3.3197e-05,6.8436e-05
+0.4500,0.87067,0.98666,1.1027,-0.46276,0.48336,3.8612e-05,8.1959e-05
+0.4400,0.87067,1.0036,1.1382,-0.50341,0.52542,4.3211e-05,9.4764e-05
+0.4300,0.87614,1.0225,1.1721,-0.54412,0.57036,4.8061e-05,0.00010723
+0.4200,0.88565,1.0417,1.1988,-0.57757,0.60749,5.1609e-05,0.00011657
+0.4100,0.889,1.0541,1.2246,-0.6038,0.63964,5.4217e-05,0.00012343
+0.4000,0.889,1.0684,1.2517,-0.62684,0.66745,5.6162e-05,0.00012883
+0.3900,0.89425,1.0813,1.2735,-0.64617,0.69296,5.715e-05,0.00013262
+0.3800,0.89823,1.0906,1.2902,-0.6649,0.71453,5.8326e-05,0.0001344
+0.3700,0.89823,1.0945,1.3069,-0.67925,0.73047,5.9443e-05,0.00013382
+0.3600,0.90417,1.1003,1.321,-0.69338,0.74381,6.0838e-05,0.00013042
+0.3500,0.90746,1.1036,1.3243,-0.70628,0.75277,6.2571e-05,0.00012529
+0.3400,0.90746,1.1036,1.3243,-0.71634,0.75739,6.4144e-05,0.00011931
+0.3300,0.91351,1.1036,1.3183,-0.72707,0.75858,6.5553e-05,0.00011343
+0.3200,0.92266,1.0976,1.3091,-0.73857,0.76125,6.5645e-05,0.00010846
+0.3100,0.92579,1.0888,1.2946,-0.74729,0.76484,6.4443e-05,0.00010527
+0.3000,0.93029,1.0853,1.2764,-0.75463,0.76879,6.1667e-05,0.00010552
+0.2900,0.93194,1.0706,1.2504,-0.75948,0.76693,5.6986e-05,0.00010861
+0.2800,0.94123,1.0599,1.2238,-0.75726,0.76619,5.0616e-05,0.00011349
+0.2700,0.94425,1.0438,1.1916,-0.75359,0.76352,4.3369e-05,0.00011904
+0.2600,0.94425,1.0283,1.1569,-0.74543,0.75718,3.6081e-05,0.0001232
+0.2500,0.93137,1.0111,1.1209,-0.73196,0.74442,2.9058e-05,0.00012546
+0.2400,0.91284,0.99257,1.0794,-0.71195,0.72978,2.4017e-05,0.00012478
+0.2300,0.89145,0.96318,1.0429,-0.68708,0.70363,2.2801e-05,0.00012015
+0.2200,0.8735,0.94661,1.0263,-0.65853,0.67797,2.6305e-05,0.00011276
+0.2100,0.85033,0.92136,1.0138,-0.62686,0.64988,3.1387e-05,0.00010229
+0.2000,0.81724,0.89491,1.0068,-0.59224,0.61905,3.727e-05,8.9577e-05
+0.1900,0.78042,0.8673,0.99109,-0.55279,0.58007,4.4119e-05,7.3518e-05
+0.1800,0.73889,0.83497,0.9727,-0.51243,0.54398,5.0741e-05,5.6113e-05
+0.1700,0.69547,0.80725,0.96188,-0.47469,0.50631,5.6849e-05,3.8534e-05
+0.1600,0.64434,0.7693,0.93428,-0.42752,0.46107,6.4167e-05,2.0551e-05
+0.1500,0.6001,0.73391,0.91029,-0.3882,0.42645,7.0194e-05,2.2765e-05
+0.1400,0.55737,0.70027,0.88343,-0.35699,0.4029,7.5667e-05,3.822e-05
+0.1300,0.51114,0.65522,0.85006,-0.33424,0.38433,7.9746e-05,5.6549e-05
+0.1200,0.46805,0.62026,0.81381,-0.31304,0.36532,8.3066e-05,7.282e-05
+0.1100,0.42719,0.57784,0.76333,-0.29441,0.34821,8.4096e-05,8.67e-05
+0.1000,0.37386,0.5241,0.71094,-0.26982,0.32283,8.2569e-05,9.967e-05
+0.0900,0.33021,0.48045,0.65282,-0.24962,0.29878,7.8948e-05,0.00010725
+0.0800,0.28657,0.43978,0.5967,-0.22657,0.2731,7.2763e-05,0.00011064
+0.0700,0.24981,0.38554,0.52718,-0.20147,0.24451,6.5016e-05,0.00010989
+0.0600,0.20937,0.33305,0.46847,-0.17415,0.21335,5.6759e-05,0.00010632
+0.0500,0.17167,0.28857,0.3981,-0.14682,0.18006,4.7244e-05,9.78e-05
+0.0400,0.13716,0.22491,0.31794,-0.11761,0.14562,3.8619e-05,8.5238e-05
+0.0300,0.096617,0.16626,0.23856,-0.08546,0.1088,2.7824e-05,6.6607e-05
+0.0200,0.062774,0.11276,0.15764,-0.055641,0.072613,1.84e-05,4.6219e-05
+0.0100,0.034895,0.052403,0.078546,-0.026942,0.035112,9.0028e-06,2.3073e-05
+0.0000,0,0,0,0.0019215,0.0019215,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case2_envelopes.csv b/validation/experiments/delta_flume/envelopes/case2_envelopes.csv
new file mode 100644
index 00000000..778e4eaf
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case2_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.0089508,0.017902,0.026853,-0.044813,0.04324,9.5506e-06,9.3453e-06
+0.9800,0.018104,0.036089,0.054193,-0.092599,0.087445,1.8397e-05,1.8156e-05
+0.9700,0.026872,0.05362,0.085993,-0.13791,0.128,2.5221e-05,2.6574e-05
+0.9600,0.037605,0.072138,0.11896,-0.19272,0.1813,3.2055e-05,3.6789e-05
+0.9500,0.04696,0.090835,0.1466,-0.23791,0.2255,3.563e-05,4.4704e-05
+0.9400,0.056627,0.10897,0.17035,-0.28119,0.26424,3.741e-05,5.2814e-05
+0.9300,0.071277,0.12652,0.18818,-0.31972,0.30283,3.6702e-05,5.9694e-05
+0.9200,0.089955,0.14509,0.21559,-0.35912,0.34369,3.4611e-05,6.7724e-05
+0.9100,0.10734,0.16258,0.23312,-0.39374,0.37831,3.2405e-05,7.4551e-05
+0.9000,0.12484,0.17705,0.25926,-0.425,0.40957,2.9811e-05,8.1273e-05
+0.8900,0.14715,0.1993,0.27904,-0.46185,0.44498,2.7898e-05,8.9278e-05
+0.8800,0.16442,0.21799,0.29659,-0.48857,0.47225,2.7982e-05,9.4969e-05
+0.8700,0.18019,0.24465,0.31476,-0.50976,0.49413,2.899e-05,9.9943e-05
+0.8600,0.19779,0.2619,0.32958,-0.52767,0.51119,3.19e-05,0.00010427
+0.8500,0.21631,0.2777,0.3482,-0.54131,0.53012,3.3932e-05,0.00010747
+0.8400,0.23387,0.29531,0.36631,-0.55227,0.54314,3.542e-05,0.000109
+0.8300,0.2524,0.31617,0.39649,-0.55989,0.55516,3.5268e-05,0.00010953
+0.8200,0.27079,0.3341,0.4142,-0.56215,0.56029,3.4225e-05,0.00010916
+0.8100,0.28848,0.35967,0.43017,-0.5582,0.55973,3.1568e-05,0.00010757
+0.8000,0.30426,0.3773,0.4478,-0.55409,0.55641,2.7736e-05,0.00010595
+0.7900,0.32587,0.39538,0.46538,-0.54537,0.54834,2.3309e-05,0.00010271
+0.7800,0.34866,0.41265,0.48153,-0.531,0.53731,2.0658e-05,9.9723e-05
+0.7700,0.3678,0.43056,0.50881,-0.51581,0.52136,2.0354e-05,9.6186e-05
+0.7600,0.38812,0.4596,0.53303,-0.49289,0.49625,2.5313e-05,9.1518e-05
+0.7500,0.40524,0.47786,0.55756,-0.47046,0.47168,3.0496e-05,8.6715e-05
+0.7400,0.42505,0.49472,0.5752,-0.44514,0.44377,3.5739e-05,8.1718e-05
+0.7300,0.44229,0.51279,0.5925,-0.4164,0.4148,3.9223e-05,7.6209e-05
+0.7200,0.45773,0.53737,0.60788,-0.38689,0.38533,4.178e-05,7.0888e-05
+0.7100,0.47741,0.55582,0.62831,-0.354,0.35311,4.2325e-05,6.431e-05
+0.7000,0.50143,0.57433,0.6513,-0.31849,0.32277,4.0655e-05,5.7747e-05
+0.6900,0.52744,0.59911,0.66303,-0.28785,0.28642,3.5292e-05,4.943e-05
+0.6800,0.55231,0.62161,0.68198,-0.261,0.25677,2.9661e-05,4.2745e-05
+0.6700,0.57863,0.63788,0.69805,-0.23324,0.22528,2.3736e-05,3.6371e-05
+0.6600,0.60321,0.65739,0.70769,-0.20277,0.19863,1.8858e-05,3.1093e-05
+0.6500,0.63038,0.68067,0.7258,-0.17604,0.17846,1.7753e-05,2.8693e-05
+0.6400,0.65598,0.70095,0.74792,-0.16119,0.16823,2.1935e-05,2.8707e-05
+0.6300,0.68066,0.71942,0.77324,-0.1655,0.18249,2.915e-05,3.2564e-05
+0.6200,0.70692,0.74064,0.78998,-0.18384,0.20697,3.511e-05,3.8556e-05
+0.6100,0.72843,0.76215,0.80811,-0.21828,0.23207,3.9793e-05,4.5601e-05
+0.6000,0.74991,0.78116,0.82957,-0.25013,0.25478,4.1957e-05,5.2493e-05
+0.5900,0.77217,0.80319,0.8519,-0.28075,0.27768,4.1762e-05,5.9804e-05
+0.5800,0.7881,0.82383,0.87099,-0.30936,0.30144,3.9437e-05,6.7397e-05
+0.5700,0.80418,0.84588,0.89704,-0.33963,0.32739,3.5864e-05,7.5452e-05
+0.5600,0.81916,0.87127,0.91723,-0.36525,0.35522,3.2103e-05,8.3176e-05
+0.5500,0.83699,0.8891,0.93815,-0.38685,0.3798,2.9603e-05,8.9719e-05
+0.5400,0.85306,0.91065,0.95866,-0.40434,0.40248,2.9075e-05,9.5473e-05
+0.5300,0.86933,0.93368,0.98052,-0.41849,0.42233,3.0846e-05,0.00010049
+0.5200,0.89213,0.95511,1.0086,-0.43337,0.43879,3.4354e-05,0.00010503
+0.5100,0.91797,0.97666,1.0345,-0.4451,0.45148,3.7962e-05,0.00010864
+0.5000,0.94145,0.99663,1.0627,-0.45728,0.46385,4.0579e-05,0.00011167
+0.4900,0.96127,1.02,1.087,-0.46826,0.46951,4.1574e-05,0.00011384
+0.4800,0.97873,1.04,1.1094,-0.47486,0.46951,3.9872e-05,0.00011451
+0.4700,1,1.0629,1.1301,-0.47835,0.46738,3.6492e-05,0.00011364
+0.4600,1.0209,1.0853,1.1466,-0.47707,0.46417,3.2182e-05,0.00011201
+0.4500,1.0431,1.1076,1.1645,-0.47341,0.45931,2.7406e-05,0.00010935
+0.4400,1.0665,1.1293,1.1785,-0.46419,0.44997,2.3909e-05,0.00010535
+0.4300,1.0924,1.1483,1.1943,-0.44802,0.44415,2.4055e-05,9.9932e-05
+0.4200,1.1153,1.1673,1.2114,-0.43062,0.44159,2.7915e-05,9.404e-05
+0.4100,1.1258,1.1797,1.2282,-0.41946,0.43547,3.3165e-05,8.8557e-05
+0.4000,1.1389,1.1941,1.2462,-0.40964,0.42654,3.8387e-05,8.3136e-05
+0.3900,1.157,1.2052,1.2591,-0.39702,0.41368,4.2816e-05,7.8008e-05
+0.3800,1.1702,1.2131,1.2684,-0.38033,0.39721,4.5212e-05,7.3823e-05
+0.3700,1.1792,1.2221,1.2773,-0.36172,0.37729,4.4319e-05,6.9995e-05
+0.3600,1.1833,1.2322,1.2814,-0.33775,0.35075,4.084e-05,6.5971e-05
+0.3500,1.1833,1.2355,1.2814,-0.30787,0.32034,3.4528e-05,6.2531e-05
+0.3400,1.1772,1.2355,1.2814,-0.27962,0.29276,2.8053e-05,5.9002e-05
+0.3300,1.1741,1.2355,1.2754,-0.24828,0.26209,2.2527e-05,5.5155e-05
+0.3200,1.1681,1.2355,1.2662,-0.21297,0.22595,2.1416e-05,5.055e-05
+0.3100,1.165,1.2298,1.2631,-0.19791,0.19339,2.5562e-05,4.5404e-05
+0.3000,1.1582,1.2195,1.2631,-0.19934,0.16736,3.2899e-05,3.9252e-05
+0.2900,1.1485,1.2097,1.2557,-0.20646,0.18307,4.0154e-05,3.3816e-05
+0.2800,1.1327,1.2033,1.2469,-0.21569,0.21342,4.5186e-05,3.1778e-05
+0.2700,1.1143,1.1925,1.2377,-0.22964,0.24826,4.7906e-05,3.2453e-05
+0.2600,1.0988,1.1784,1.2222,-0.25416,0.28069,4.8412e-05,3.6996e-05
+0.2500,1.0816,1.1613,1.2106,-0.28247,0.31015,4.5741e-05,4.4831e-05
+0.2400,1.0631,1.1427,1.1949,-0.31271,0.34218,4.1007e-05,5.471e-05
+0.2300,1.0417,1.1134,1.1682,-0.34671,0.38484,3.3355e-05,6.8169e-05
+0.2200,1.0263,1.089,1.1416,-0.36898,0.42375,2.7441e-05,7.9786e-05
+0.2100,1.0087,1.0699,1.1144,-0.39341,0.45733,2.5168e-05,9.1554e-05
+0.2000,0.97658,1.0379,1.0905,-0.42045,0.48885,2.6181e-05,0.00010308
+0.1900,0.94945,1.0107,1.0563,-0.44739,0.51465,3.1162e-05,0.00011498
+0.1800,0.90812,0.97664,1.0292,-0.4729,0.53763,3.7136e-05,0.00012707
+0.1700,0.87089,0.9414,1.0034,-0.49229,0.55573,4.1477e-05,0.00013808
+0.1600,0.82214,0.90109,0.96262,-0.51011,0.57514,4.4409e-05,0.00015031
+0.1500,0.78596,0.86569,0.92969,-0.52118,0.58235,4.4583e-05,0.00015832
+0.1400,0.74439,0.82401,0.88579,-0.52601,0.5862,4.1961e-05,0.00016476
+0.1300,0.70089,0.77789,0.83918,-0.52294,0.57993,3.734e-05,0.00016772
+0.1200,0.65545,0.73482,0.7988,-0.51265,0.57013,3.2937e-05,0.00016732
+0.1100,0.61156,0.6836,0.74805,-0.49947,0.55622,3.0929e-05,0.00016372
+0.1000,0.55166,0.62216,0.67418,-0.47568,0.5287,3.175e-05,0.00015444
+0.0900,0.50801,0.57852,0.62482,-0.44682,0.49744,3.6549e-05,0.00014299
+0.0800,0.45558,0.52015,0.56319,-0.41355,0.45915,4.141e-05,0.00012852
+0.0700,0.40081,0.46516,0.5081,-0.374,0.41651,4.6165e-05,0.00011262
+0.0600,0.35122,0.40438,0.45012,-0.32855,0.37139,4.8226e-05,9.676e-05
+0.0500,0.29007,0.34506,0.37977,-0.2813,0.3158,4.7784e-05,7.9773e-05
+0.0400,0.23642,0.28016,0.30524,-0.22914,0.26053,4.3508e-05,6.2666e-05
+0.0300,0.16626,0.20262,0.22976,-0.16892,0.19218,3.6277e-05,4.5125e-05
+0.0200,0.11276,0.13957,0.15765,-0.11216,0.1278,2.5117e-05,2.9434e-05
+0.0100,0.0524,0.066875,0.078546,-0.054362,0.063974,1.3231e-05,1.4706e-05
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case3_envelopes.csv b/validation/experiments/delta_flume/envelopes/case3_envelopes.csv
new file mode 100644
index 00000000..483c93a2
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case3_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.017902,0.044634,0.080322,-0.08023,0.075215,5.2344e-05,5.0451e-05
+0.9800,0.036089,0.096198,0.16542,-0.16424,0.15163,0.00010156,9.8631e-05
+0.9700,0.062035,0.14565,0.2413,-0.24147,0.22163,0.00014393,0.00013773
+0.9600,0.092216,0.20927,0.32867,-0.33068,0.30337,0.0001848,0.00017466
+0.9500,0.13014,0.25364,0.40512,-0.40455,0.36907,0.00020979,0.00019616
+0.9400,0.17341,0.30547,0.46846,-0.46989,0.42726,0.00022405,0.00021032
+0.9300,0.22343,0.35829,0.52698,-0.52474,0.47862,0.00022969,0.00022031
+0.9200,0.28842,0.42289,0.59097,-0.57915,0.52671,0.00022736,0.00023111
+0.9100,0.34668,0.47226,0.63172,-0.62146,0.56037,0.00021671,0.00024382
+0.9000,0.41647,0.52174,0.68109,-0.65609,0.58923,0.00019941,0.00025902
+0.8900,0.50884,0.58553,0.7368,-0.68695,0.61455,0.00016599,0.00027959
+0.8800,0.57885,0.6395,0.77824,-0.7016,0.62723,0.00013479,0.00029446
+0.8700,0.64507,0.7027,0.82407,-0.70961,0.62624,9.848e-05,0.00030427
+0.8600,0.67827,0.75236,0.86529,-0.70833,0.61835,7.2139e-05,0.00030805
+0.8500,0.72357,0.80587,0.91403,-0.69241,0.60242,7.4339e-05,0.00030454
+0.8400,0.75661,0.8644,0.98224,-0.67124,0.58153,0.00010468,0.00029291
+0.8300,0.81039,0.92825,1.0754,-0.62914,0.54558,0.00015339,0.00027206
+0.8200,0.85763,0.98221,1.1528,-0.58541,0.50748,0.00019047,0.00024995
+0.8100,0.90973,1.0422,1.224,-0.53553,0.46244,0.00022075,0.00022632
+0.8000,0.96014,1.0945,1.2939,-0.48111,0.41663,0.00023925,0.00020521
+0.7900,1.014,1.1477,1.3618,-0.41959,0.37166,0.00024689,0.00018643
+0.7800,1.0653,1.2079,1.4205,-0.35787,0.33424,0.0002436,0.0001723
+0.7700,1.1304,1.2622,1.4835,-0.29932,0.30752,0.00022975,0.00015962
+0.7600,1.1964,1.3254,1.5462,-0.25796,0.30805,0.00020375,0.00014725
+0.7500,1.2665,1.3835,1.5952,-0.25287,0.33351,0.00017468,0.00013531
+0.7400,1.3342,1.4344,1.6373,-0.27332,0.36449,0.00014291,0.00012243
+0.7300,1.4057,1.4908,1.68,-0.31657,0.39237,0.00011033,0.00011008
+0.7200,1.4825,1.5502,1.7148,-0.3699,0.41943,8.633e-05,0.00010562
+0.7100,1.551,1.6023,1.7485,-0.42819,0.4406,8.182e-05,0.00011353
+0.7000,1.5782,1.6576,1.7914,-0.48324,0.46611,0.00010403,0.00013717
+0.6900,1.6123,1.7273,1.8785,-0.54712,0.52408,0.00014655,0.000176
+0.6800,1.6488,1.7812,1.9528,-0.59754,0.57593,0.00018429,0.00021029
+0.6700,1.6865,1.8388,2.0257,-0.64377,0.62427,0.00021829,0.00024245
+0.6600,1.7326,1.8896,2.1,-0.68423,0.66373,0.00024346,0.00026847
+0.6500,1.7841,1.946,2.1707,-0.71802,0.69648,0.00025879,0.0002881
+0.6400,1.8421,2.0078,2.2424,-0.74434,0.72061,0.00026143,0.00030157
+0.6300,1.9125,2.068,2.3067,-0.76146,0.73842,0.00024959,0.00030927
+0.6200,1.978,2.1243,2.3564,-0.76793,0.74489,0.00022647,0.00031317
+0.6100,2.0487,2.1822,2.4046,-0.76287,0.75259,0.00019459,0.00031655
+0.6000,2.1176,2.2382,2.4525,-0.75931,0.76548,0.00015777,0.00032057
+0.5900,2.1891,2.2977,2.4931,-0.76254,0.76841,0.00012108,0.00032472
+0.5800,2.2641,2.3546,2.5296,-0.75681,0.76232,9.6529e-05,0.00032823
+0.5700,2.3201,2.4176,2.5701,-0.73847,0.7473,9.9129e-05,0.00032889
+0.5600,2.3505,2.4805,2.6233,-0.706,0.72106,0.00013081,0.00032165
+0.5500,2.3822,2.5355,2.693,-0.66716,0.68903,0.00016728,0.00030777
+0.5400,2.4156,2.5949,2.7601,-0.62037,0.64964,0.00020165,0.00028727
+0.5300,2.4538,2.6528,2.8256,-0.56549,0.59845,0.00023104,0.00025938
+0.5200,2.5073,2.7097,2.8837,-0.49879,0.5379,0.00025305,0.00022533
+0.5100,2.5673,2.7677,2.9399,-0.42802,0.47301,0.00026412,0.00019161
+0.5000,2.6436,2.831,3.005,-0.35105,0.39357,0.00026322,0.00015912
+0.4900,2.7262,2.8965,3.0625,-0.3247,0.30882,0.00024914,0.0001383
+0.4800,2.7995,2.9564,3.1068,-0.34434,0.24037,0.00022699,0.00013229
+0.4700,2.8762,3.0134,3.1492,-0.37497,0.22153,0.00019655,0.00013635
+0.4600,2.9498,3.069,3.1901,-0.4052,0.2611,0.00016126,0.00014651
+0.4500,3.0196,3.1258,3.226,-0.42984,0.31933,0.00012673,0.0001576
+0.4400,3.0947,3.1814,3.2552,-0.44911,0.38022,9.9834e-05,0.00016716
+0.4300,3.1474,3.2409,3.3155,-0.46306,0.44337,9.4125e-05,0.00017554
+0.4200,3.1642,3.2946,3.3939,-0.47905,0.4959,0.0001137,0.00018434
+0.4100,3.1809,3.342,3.458,-0.52353,0.54505,0.00014275,0.00019756
+0.4000,3.1939,3.3798,3.5146,-0.58202,0.59717,0.00017363,0.00021994
+0.3900,3.205,3.4125,3.5621,-0.63559,0.64618,0.00020332,0.00025239
+0.3800,3.2103,3.4431,3.5948,-0.68121,0.68816,0.00022882,0.00029395
+0.3700,3.2136,3.4653,3.6202,-0.7144,0.72027,0.00024793,0.00033795
+0.3600,3.2219,3.4854,3.6442,-0.74857,0.75933,0.00026202,0.0003846
+0.3500,3.225,3.492,3.6706,-0.78312,0.79161,0.00026549,0.00042177
+0.3400,3.2307,3.492,3.6831,-0.80557,0.80421,0.00025904,0.0004439
+0.3300,3.2336,3.492,3.6812,-0.81604,0.80177,0.00024233,0.00045414
+0.3200,3.2336,3.4799,3.6669,-0.81414,0.78484,0.00021478,0.00045056
+0.3100,3.2229,3.4621,3.6377,-0.80009,0.75406,0.00017984,0.00043524
+0.3000,3.2119,3.4299,3.5859,-0.77164,0.71089,0.00013508,0.00040682
+0.2900,3.1927,3.3992,3.5301,-0.73173,0.6653,9.9201e-05,0.00037356
+0.2800,3.1742,3.3592,3.4708,-0.68541,0.62093,9.1891e-05,0.00034039
+0.2700,3.1446,3.3156,3.4338,-0.62839,0.56478,0.00011607,0.00030546
+0.2600,3.079,3.2652,3.4162,-0.56641,0.50571,0.0001551,0.00027166
+0.2500,2.9946,3.2136,3.3863,-0.49936,0.44228,0.00019689,0.00023667
+0.2400,2.8983,3.1545,3.3447,-0.42495,0.37074,0.00023466,0.00020035
+0.2300,2.7926,3.0745,3.2766,-0.3346,0.28553,0.00026731,0.00016166
+0.2200,2.7132,3.0037,3.2244,-0.25688,0.21406,0.00028335,0.00014303
+0.2100,2.6273,2.926,3.1571,-0.18895,0.16905,0.0002884,0.00014914
+0.2000,2.5561,2.8525,3.0753,-0.23027,0.19609,0.00028131,0.00017768
+0.1900,2.4789,2.7635,2.9789,-0.29648,0.2608,0.0002617,0.00022145
+0.1800,2.4061,2.6695,2.8672,-0.36781,0.33032,0.0002315,0.00026708
+0.1700,2.3295,2.576,2.7482,-0.4325,0.39425,0.00019332,0.00030655
+0.1600,2.2351,2.4606,2.5951,-0.50607,0.46086,0.00013983,0.00034458
+0.1500,2.1587,2.3489,2.4512,-0.55347,0.50806,9.6751e-05,0.00036399
+0.1400,2.0499,2.2367,2.348,-0.59125,0.54855,7.4046e-05,0.00037272
+0.1300,1.9274,2.1199,2.257,-0.61485,0.57613,8.9309e-05,0.00037368
+0.1200,1.8024,1.995,2.1613,-0.624,0.59601,0.00012859,0.00036941
+0.1100,1.6748,1.87,2.0542,-0.61857,0.60044,0.00017066,0.00036499
+0.1000,1.5169,1.7161,1.9127,-0.60349,0.59318,0.00021945,0.00036319
+0.0900,1.3861,1.5795,1.7757,-0.578,0.57731,0.00025205,0.00036668
+0.0800,1.2226,1.4247,1.6209,-0.55959,0.55448,0.00027764,0.00037345
+0.0700,1.0642,1.2695,1.4656,-0.53126,0.52597,0.00029283,0.00037847
+0.0600,0.9127,1.1181,1.2975,-0.48996,0.4879,0.00029548,0.00037414
+0.0500,0.76017,0.94585,1.1096,-0.43842,0.43668,0.00028373,0.00035715
+0.0400,0.60473,0.76566,0.91095,-0.36925,0.3713,0.00025556,0.00032117
+0.0300,0.43755,0.56147,0.67334,-0.27953,0.28185,0.00020542,0.00025737
+0.0200,0.28548,0.37181,0.44879,-0.19034,0.1929,0.00014347,0.00018076
+0.0100,0.1425,0.18615,0.22105,-0.092844,0.099088,7.2738e-05,9.1819e-05
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case4_envelopes.csv b/validation/experiments/delta_flume/envelopes/case4_envelopes.csv
new file mode 100644
index 00000000..2112668b
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case4_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.026853,0.068388,0.10407,-0.055635,0.075215,9.6454e-05,7.0734e-05
+0.9800,0.063068,0.14128,0.21049,-0.10961,0.14822,0.00018629,0.00013634
+0.9700,0.095221,0.214,0.31244,-0.16256,0.21762,0.00025688,0.00018946
+0.9600,0.15593,0.30138,0.42766,-0.2309,0.29914,0.0003171,0.00024022
+0.9500,0.2218,0.38126,0.5143,-0.28931,0.36205,0.00033982,0.00027328
+0.9400,0.29315,0.45178,0.59475,-0.34407,0.41117,0.00033586,0.00029911
+0.9300,0.37816,0.52762,0.65877,-0.39292,0.45297,0.00030969,0.00032207
+0.9200,0.47777,0.60823,0.72325,-0.43601,0.48163,0.00025881,0.00034509
+0.9100,0.57665,0.68385,0.77274,-0.46725,0.49843,0.00019534,0.00036215
+0.9000,0.69008,0.76239,0.82502,-0.48841,0.50324,0.00012562,0.00037003
+0.8900,0.81035,0.85941,0.92683,-0.49035,0.48406,7.9491e-05,0.00036335
+0.8800,0.86709,0.93559,1.0379,-0.47916,0.45793,0.00012299,0.0003428
+0.8700,0.91421,1.0159,1.15,-0.45432,0.41616,0.00019967,0.0003089
+0.8600,0.96491,1.0919,1.2429,-0.4151,0.37034,0.00026697,0.00027152
+0.8500,1.0297,1.1724,1.3326,-0.36682,0.31751,0.00031949,0.00023363
+0.8400,1.0895,1.2489,1.4171,-0.3097,0.26171,0.00034778,0.0002064
+0.8300,1.1847,1.3441,1.5002,-0.23728,0.20134,0.00034721,0.00018659
+0.8200,1.2774,1.4308,1.5702,-0.17683,0.16399,0.0003187,0.00017531
+0.8100,1.3861,1.5105,1.6318,-0.13115,0.13861,0.00026681,0.00016126
+0.8000,1.4952,1.5884,1.6984,-0.1278,0.12636,0.00019992,0.00014338
+0.7900,1.6099,1.6745,1.7497,-0.1746,0.15767,0.0001233,0.00012867
+0.7800,1.7126,1.7506,1.8027,-0.21709,0.21229,6.7314e-05,0.0001332
+0.7700,1.7574,1.834,1.8916,-0.26666,0.27295,0.00010027,0.00017028
+0.7600,1.808,1.926,2.0267,-0.32399,0.33002,0.00019027,0.00023204
+0.7500,1.8556,2.0058,2.1398,-0.3657,0.37318,0.00026155,0.00028575
+0.7400,1.9112,2.0869,2.2393,-0.40192,0.41349,0.00031551,0.00032911
+0.7300,1.9827,2.1695,2.3291,-0.43048,0.44752,0.00035043,0.00036016
+0.7200,2.0545,2.2456,2.408,-0.45271,0.47355,0.00036247,0.00037503
+0.7100,2.1441,2.3261,2.4859,-0.4652,0.48992,0.0003486,0.0003757
+0.7000,2.2348,2.4087,2.5547,-0.46662,0.49497,0.0003075,0.00036556
+0.6900,2.3527,2.5011,2.6234,-0.46273,0.4847,0.00023091,0.00034779
+0.6800,2.4693,2.5788,2.6729,-0.45727,0.46379,0.00015195,0.00033372
+0.6700,2.5896,2.6577,2.7249,-0.44655,0.43573,8.4606e-05,0.0003209
+0.6600,2.6835,2.7339,2.8036,-0.42525,0.40252,8.6113e-05,0.00030779
+0.6500,2.7404,2.8127,2.9095,-0.39242,0.35963,0.0001646,0.00029047
+0.6400,2.7891,2.8956,3.0202,-0.34275,0.30382,0.00024904,0.00026389
+0.6300,2.8538,2.9861,3.1308,-0.27193,0.23706,0.00032002,0.00022243
+0.6200,2.9193,3.066,3.2244,-0.19882,0.18296,0.00035934,0.00017744
+0.6100,2.9927,3.1471,3.3076,-0.15631,0.15863,0.00037127,0.00013668
+0.6000,3.0734,3.2294,3.3796,-0.18552,0.16613,0.00035681,0.00011903
+0.5900,3.1603,3.3081,3.4513,-0.2554,0.19775,0.00031759,0.00013763
+0.5800,3.2535,3.3898,3.5134,-0.32167,0.25838,0.0002572,0.00018268
+0.5700,3.3738,3.4801,3.5814,-0.38837,0.34076,0.00017182,0.00023879
+0.5600,3.5001,3.5679,3.6405,-0.44064,0.41526,9.7351e-05,0.00028742
+0.5500,3.5764,3.6516,3.7082,-0.47588,0.47013,0.00010135,0.00031944
+0.5400,3.6185,3.733,3.8091,-0.50072,0.51188,0.00016688,0.00034108
+0.5300,3.6684,3.8094,3.9231,-0.51782,0.54591,0.0002452,0.00035616
+0.5200,3.7321,3.8887,4.0316,-0.53148,0.57481,0.00031233,0.00036729
+0.5100,3.802,3.9721,4.1244,-0.53877,0.59167,0.00035488,0.00037623
+0.5000,3.8914,4.066,4.2212,-0.53891,0.59832,0.00037072,0.00038446
+0.4900,3.9872,4.1522,4.3114,-0.53107,0.59141,0.00035392,0.00038988
+0.4800,4.0814,4.2327,4.3768,-0.5161,0.57513,0.00031377,0.00039001
+0.4700,4.1856,4.3153,4.4341,-0.49395,0.54753,0.00025157,0.00038551
+0.4600,4.2955,4.3981,4.4865,-0.46551,0.51141,0.00017562,0.0003784
+0.4500,4.407,4.4799,4.5413,-0.43501,0.47282,0.00010564,0.00036985
+0.4400,4.4971,4.5554,4.6207,-0.40034,0.42703,9.144e-05,0.00035862
+0.4300,4.551,4.6336,4.7304,-0.34687,0.36303,0.00015908,0.00033958
+0.4200,4.5883,4.7088,4.8319,-0.28251,0.29375,0.00024128,0.00031065
+0.4100,4.6243,4.7681,4.9222,-0.21851,0.22844,0.00030687,0.00027443
+0.4000,4.6633,4.8192,4.9986,-0.16309,0.17896,0.00035327,0.0002376
+0.3900,4.7052,4.8721,5.0535,-0.16232,0.16651,0.00037688,0.00022019
+0.3800,4.7506,4.9151,5.093,-0.22282,0.19312,0.00037459,0.00024244
+0.3700,4.799,4.9496,5.1178,-0.30212,0.25066,0.00034597,0.00029725
+0.3600,4.8554,4.9843,5.1261,-0.38638,0.33723,0.00028627,0.00036854
+0.3500,4.9067,5.0048,5.1192,-0.45873,0.42121,0.00020677,0.00042215
+0.3400,4.9508,5.0149,5.0999,-0.51034,0.48759,0.00012806,0.0004436
+0.3300,4.9419,5.0178,5.0795,-0.54782,0.54119,8.7681e-05,0.00043541
+0.3200,4.9009,5.0121,5.0893,-0.57064,0.5794,0.00013044,0.00039845
+0.3100,4.8518,5.0031,5.1153,-0.57925,0.60236,0.00021014,0.00034501
+0.3000,4.8002,4.9795,5.1261,-0.57523,0.6143,0.00029686,0.00027817
+0.2900,4.747,4.9381,5.1114,-0.56515,0.61286,0.00035825,0.00023133
+0.2800,4.7017,4.8967,5.0816,-0.55156,0.60628,0.00038943,0.00021845
+0.2700,4.6553,4.8379,5.025,-0.53445,0.59104,0.00039489,0.00022885
+0.2600,4.6066,4.7718,4.9517,-0.5166,0.57136,0.00037274,0.00024826
+0.2500,4.5491,4.6962,4.8605,-0.49362,0.54696,0.00032462,0.0002694
+0.2400,4.494,4.6094,4.7447,-0.46266,0.5139,0.000252,0.00029076
+0.2300,4.4148,4.4927,4.5841,-0.41472,0.4683,0.00014715,0.00031481
+0.2200,4.3457,4.3853,4.4381,-0.37158,0.4222,6.0272e-05,0.00033278
+0.2100,4.2102,4.2669,4.3249,-0.326,0.36883,8.9822e-05,0.00033981
+0.2000,4.0589,4.1495,4.2369,-0.277,0.3048,0.00017622,0.00033013
+0.1900,3.8901,4.0167,4.1434,-0.21433,0.22727,0.00026628,0.00029683
+0.1800,3.7214,3.8778,4.0315,-0.1427,0.14666,0.00033742,0.00024151
+0.1700,3.5664,3.7361,3.8994,-0.097125,0.15371,0.00038225,0.00017972
+0.1600,3.3743,3.5511,3.725,-0.16064,0.23645,0.00040285,0.00014794
+0.1500,3.2167,3.3863,3.5632,-0.25134,0.31015,0.00038586,0.0002077
+0.1400,3.066,3.2196,3.3839,-0.33479,0.38961,0.00033984,0.00030529
+0.1300,2.9062,3.0401,3.1699,-0.41054,0.46778,0.00026703,0.00040652
+0.1200,2.7525,2.8496,2.9588,-0.47122,0.53462,0.00017445,0.0004884
+0.1100,2.6089,2.6684,2.7395,-0.51217,0.58905,7.9989e-05,0.00054389
+0.1000,2.3897,2.4329,2.486,-0.54024,0.6273,8.4964e-05,0.00057961
+0.0900,2.1551,2.2381,2.3285,-0.54408,0.64173,0.00018399,0.00058051
+0.0800,1.9094,2.024,2.1495,-0.53301,0.63363,0.00028081,0.00056315
+0.0700,1.6626,1.8025,1.9546,-0.50829,0.61046,0.00035547,0.00053216
+0.0600,1.4182,1.5843,1.7432,-0.47405,0.56936,0.00039862,0.0004927
+0.0500,1.1751,1.3437,1.5032,-0.4232,0.51409,0.00041188,0.00044171
+0.0400,0.93218,1.0835,1.2343,-0.36826,0.43748,0.00038866,0.00037977
+0.0300,0.67291,0.79694,0.91793,-0.28456,0.33676,0.00032166,0.0002965
+0.0200,0.43949,0.52626,0.61258,-0.19439,0.22871,0.00022871,0.00020435
+0.0100,0.20938,0.26178,0.30531,-0.096692,0.11545,0.00011738,0.00010336
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case5_envelopes.csv b/validation/experiments/delta_flume/envelopes/case5_envelopes.csv
new file mode 100644
index 00000000..0a291208
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case5_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.044634,0.09524,0.14572,-0.069408,0.096368,0.00010265,0.00010314
+0.9800,0.087322,0.20139,0.28883,-0.14186,0.18758,0.00019604,0.00019599
+0.9700,0.14484,0.29211,0.4145,-0.2094,0.27526,0.00026381,0.00026406
+0.9600,0.24145,0.41925,0.55212,-0.28562,0.36951,0.00030953,0.000321
+0.9500,0.33932,0.51712,0.65902,-0.34786,0.44219,0.00031102,0.00035408
+0.9400,0.44868,0.62565,0.74693,-0.39534,0.49541,0.00028016,0.00038351
+0.9300,0.55788,0.72491,0.83106,-0.43901,0.53259,0.00022388,0.00041394
+0.9200,0.70342,0.83337,0.91311,-0.46766,0.56056,0.00014606,0.00044388
+0.9100,0.83422,0.93222,1.012,-0.47578,0.56532,7.7114e-05,0.00045702
+0.9000,0.96213,1.034,1.1487,-0.4652,0.55089,8.8133e-05,0.00044544
+0.8900,1.0617,1.1736,1.3284,-0.4176,0.49996,0.00017508,0.0003913
+0.8800,1.1391,1.2759,1.4559,-0.36426,0.44322,0.00023938,0.0003287
+0.8700,1.2298,1.3824,1.5773,-0.29695,0.37228,0.00028656,0.0002665
+0.8600,1.3238,1.4928,1.6789,-0.22724,0.2984,0.0003068,0.00023786
+0.8500,1.4323,1.6019,1.7772,-0.1575,0.2197,0.00030013,0.0002457
+0.8400,1.5645,1.7133,1.8617,-0.13532,0.17976,0.00026941,0.00026298
+0.8300,1.7204,1.84,1.9478,-0.16346,0.2294,0.00020324,0.00025672
+0.8200,1.8608,1.9517,2.0365,-0.22441,0.26504,0.00013612,0.00022649
+0.8100,1.9929,2.0604,2.132,-0.28299,0.30884,8.7809e-05,0.00019734
+0.8000,2.0827,2.1685,2.2472,-0.33821,0.37869,0.00010271,0.00020996
+0.7900,2.1548,2.2754,2.3866,-0.38751,0.46423,0.00016691,0.00027799
+0.7800,2.223,2.3851,2.5207,-0.43272,0.53567,0.00022899,0.00036038
+0.7700,2.3092,2.4988,2.6571,-0.48423,0.5932,0.00027957,0.0004327
+0.7600,2.4251,2.6277,2.799,-0.5229,0.63286,0.00030534,0.00047122
+0.7500,2.5343,2.736,2.9086,-0.54385,0.64498,0.000301,0.00047139
+0.7400,2.648,2.8431,3.0005,-0.55381,0.64113,0.0002736,0.00045295
+0.7300,2.7802,2.949,3.0877,-0.55617,0.62413,0.00022473,0.0004314
+0.7200,2.9188,3.0543,3.1739,-0.54237,0.59896,0.00016326,0.0004208
+0.7100,3.0616,3.1609,3.2687,-0.51458,0.56985,0.00010688,0.00041979
+0.7000,3.1917,3.2744,3.3918,-0.47345,0.52225,0.00010285,0.00041444
+0.6900,3.2984,3.3996,3.5506,-0.40669,0.44804,0.00017207,0.00038143
+0.6800,3.3801,3.5018,3.6755,-0.34655,0.37755,0.00023717,0.00032477
+0.6700,3.4687,3.6087,3.7921,-0.28746,0.2965,0.00028854,0.00024493
+0.6600,3.5579,3.7106,3.8924,-0.23908,0.22837,0.0003153,0.00017112
+0.6500,3.6638,3.8139,3.9841,-0.20613,0.17763,0.00031512,0.00014582
+0.6400,3.7805,3.9258,4.0678,-0.2048,0.17248,0.00028373,0.00019634
+0.6300,3.9227,4.0454,4.1616,-0.26661,0.25756,0.00021902,0.00027308
+0.6200,4.0607,4.1517,4.2447,-0.34577,0.34513,0.00014759,0.00032495
+0.6100,4.1887,4.2558,4.3282,-0.41178,0.41936,0.00010086,0.00035746
+0.6000,4.2795,4.3592,4.4405,-0.46303,0.48016,0.0001176,0.0003807
+0.5900,4.3427,4.4673,4.5836,-0.50187,0.53113,0.00018408,0.00040625
+0.5800,4.4122,4.5762,4.7155,-0.52862,0.57347,0.00025088,0.000439
+0.5700,4.5033,4.6909,4.8484,-0.54353,0.6076,0.00030281,0.0004785
+0.5600,4.6139,4.8137,4.9748,-0.55377,0.62152,0.00032239,0.00050619
+0.5500,4.7258,4.9202,5.0802,-0.56229,0.6163,0.00031027,0.00050888
+0.5400,4.8521,5.0205,5.1733,-0.56101,0.59234,0.00027281,0.00048769
+0.5300,4.9908,5.1251,5.2575,-0.54568,0.54824,0.0002132,0.00044393
+0.5200,5.136,5.2344,5.3387,-0.51461,0.49085,0.00014194,0.00038488
+0.5100,5.2675,5.3432,5.4334,-0.47049,0.42868,0.00010034,0.0003298
+0.5000,5.3738,5.463,5.5679,-0.40605,0.35201,0.00012884,0.00028709
+0.4900,5.4553,5.5784,5.7098,-0.32425,0.2923,0.00020176,0.00026807
+0.4800,5.5371,5.6852,5.836,-0.2536,0.28127,0.00026054,0.00026176
+0.4700,5.6338,5.7937,5.9589,-0.22785,0.30189,0.00030224,0.00025567
+0.4600,5.7375,5.9018,6.0673,-0.24978,0.32915,0.00031827,0.00025168
+0.4500,5.846,6.0058,6.1698,-0.28149,0.35181,0.00030782,0.00026341
+0.4400,5.9586,6.1087,6.2643,-0.33397,0.37877,0.0002722,0.00030635
+0.4300,6.0874,6.2157,6.3477,-0.41567,0.43117,0.00020964,0.00038926
+0.4200,6.209,6.309,6.4089,-0.47967,0.48735,0.00014454,0.00048139
+0.4100,6.2896,6.3908,6.4563,-0.51813,0.5245,0.00011093,0.00056086
+0.4000,6.3421,6.4636,6.5324,-0.53156,0.5424,0.00013131,0.00061901
+0.3900,6.3769,6.5281,6.6284,-0.52482,0.53793,0.00018609,0.00064565
+0.3800,6.4076,6.5808,6.7113,-0.50783,0.50863,0.00024391,0.00063413
+0.3700,6.4408,6.6239,6.7749,-0.47613,0.45768,0.00028584,0.00058602
+0.3600,6.4799,6.667,6.832,-0.41626,0.38949,0.00030861,0.00049742
+0.3500,6.5164,6.6974,6.872,-0.34058,0.31542,0.00030468,0.00039395
+0.3400,6.5451,6.717,6.8819,-0.27364,0.31037,0.00027968,0.00031278
+0.3300,6.5724,6.7288,6.8779,-0.29174,0.34784,0.0002378,0.00027372
+0.3200,6.5979,6.7262,6.858,-0.36097,0.39465,0.00018706,0.00029001
+0.3100,6.6139,6.7194,6.8258,-0.4301,0.44013,0.00014502,0.00033545
+0.3000,6.6096,6.6963,6.7911,-0.50229,0.49123,0.00013263,0.00039014
+0.2900,6.5576,6.6527,6.7835,-0.5599,0.53764,0.00016499,0.00043022
+0.2800,6.4779,6.6107,6.7723,-0.60318,0.57415,0.000211,0.00045654
+0.2700,6.3959,6.5445,6.7344,-0.64394,0.59648,0.00025605,0.00047599
+0.2600,6.3055,6.4689,6.6719,-0.68296,0.6198,0.00028792,0.00048606
+0.2500,6.2117,6.3871,6.584,-0.71031,0.64492,0.00030355,0.00048433
+0.2400,6.1074,6.2832,6.4651,-0.71721,0.65259,0.000299,0.00046817
+0.2300,5.9906,6.144,6.3084,-0.69742,0.65259,0.00026791,0.00043774
+0.2200,5.8798,6.0247,6.1611,-0.66353,0.64402,0.00022029,0.00042108
+0.2100,5.7597,5.8812,5.9893,-0.61281,0.62054,0.00016058,0.00043359
+0.2000,5.6401,5.7347,5.8149,-0.54776,0.58097,0.00010959,0.00047486
+0.1900,5.4728,5.5624,5.6255,-0.46991,0.52272,0.00010777,0.00052728
+0.1800,5.262,5.3847,5.4672,-0.3865,0.44308,0.00016017,0.00056075
+0.1700,5.051,5.2009,5.317,-0.29519,0.34914,0.00022381,0.00055138
+0.1600,4.7894,4.9649,5.1129,-0.19007,0.21525,0.00028821,0.00047294
+0.1500,4.567,4.7496,4.9193,-0.24323,0.14474,0.00031686,0.00034328
+0.1400,4.3452,4.5232,4.7008,-0.33336,0.25793,0.00031915,0.0001718
+0.1300,4.1216,4.2824,4.4445,-0.4406,0.40545,0.00029081,0.00014344
+0.1200,3.9013,4.0362,4.1713,-0.54625,0.54818,0.00023491,0.00034099
+0.1100,3.688,3.7848,3.8856,-0.66554,0.67191,0.00016047,0.00056601
+0.1000,3.4107,3.4625,3.5241,-0.79054,0.79539,6.3268e-05,0.00082167
+0.0900,3.1225,3.1953,3.2802,-0.85547,0.85791,8.2891e-05,0.00099122
+0.0800,2.7743,2.8885,3.0281,-0.88662,0.89041,0.00017263,0.001127
+0.0700,2.4296,2.5724,2.7552,-0.87789,0.88659,0.00025557,0.0012019
+0.0600,2.0954,2.2584,2.462,-0.84427,0.84719,0.00031281,0.0012168
+0.0500,1.7363,1.9185,2.124,-0.77711,0.78875,0.00034304,0.0011673
+0.0400,1.3836,1.5531,1.7586,-0.68516,0.69525,0.0003373,0.0010491
+0.0300,0.99594,1.1471,1.3137,-0.54415,0.55004,0.0002877,0.00084005
+0.0200,0.65391,0.75781,0.87961,-0.37465,0.38078,0.00020801,0.00058672
+0.0100,0.32282,0.37219,0.43043,-0.19001,0.19241,0.00010738,0.0002976
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case6_envelopes.csv b/validation/experiments/delta_flume/envelopes/case6_envelopes.csv
new file mode 100644
index 00000000..c6561dc9
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case6_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.068388,0.12197,0.17246,-0.076786,0.10473,0.00021061,0.00011033
+0.9800,0.15903,0.25546,0.34881,-0.15678,0.20889,0.00039692,0.00021621
+0.9700,0.24075,0.38079,0.50384,-0.22692,0.30031,0.00052324,0.00030648
+0.9600,0.37649,0.53541,0.66828,-0.3119,0.40248,0.00058814,0.00040676
+0.9500,0.51134,0.66339,0.8056,-0.37322,0.47557,0.00055455,0.00048691
+0.9400,0.65597,0.79475,0.91856,-0.41909,0.53169,0.00044877,0.0005585
+0.9300,0.81503,0.9313,1.0364,-0.4457,0.56076,0.00029585,0.00061147
+0.9200,0.94889,1.0648,1.1925,-0.45217,0.5707,0.00013204,0.00063556
+0.9100,1.0302,1.1898,1.3524,-0.43769,0.55766,0.00017289,0.00061984
+0.9000,1.1175,1.3265,1.521,-0.40643,0.52158,0.00034623,0.0005622
+0.8900,1.2471,1.4893,1.7224,-0.34153,0.45078,0.00052568,0.00044798
+0.8800,1.367,1.6256,1.8752,-0.27526,0.37948,0.00060796,0.00035589
+0.8700,1.4941,1.7599,2.0147,-0.20709,0.29434,0.00062374,0.00029462
+0.8600,1.6397,1.8969,2.1337,-0.14844,0.21442,0.00057346,0.00028046
+0.8500,1.8191,2.0396,2.2375,-0.13923,0.1406,0.0004584,0.00028339
+0.8400,1.9904,2.1741,2.3325,-0.18813,0.18147,0.00031021,0.00027074
+0.8300,2.2182,2.3336,2.4617,-0.25357,0.268,0.00016727,0.00024358
+0.8200,2.3813,2.4745,2.5937,-0.31592,0.33283,0.00020827,0.00025826
+0.8100,2.4651,2.6157,2.7549,-0.37641,0.39335,0.00035718,0.00033331
+0.8000,2.5615,2.7529,2.9242,-0.43531,0.44028,0.00048371,0.00043102
+0.7900,2.6777,2.8923,3.0909,-0.4809,0.48137,0.00056831,0.00051788
+0.7800,2.7964,3.0267,3.2417,-0.50863,0.50991,0.00059633,0.00057169
+0.7700,2.938,3.1678,3.3867,-0.51769,0.54242,0.00056075,0.00059338
+0.7600,3.1258,3.331,3.526,-0.51003,0.56752,0.00045062,0.00059546
+0.7500,3.2986,3.4689,3.6373,-0.50615,0.58548,0.0003183,0.00059957
+0.7400,3.4691,3.6006,3.7602,-0.49778,0.58686,0.00020306,0.00060731
+0.7300,3.6208,3.7369,3.8987,-0.47077,0.56641,0.00018909,0.00060429
+0.7200,3.7088,3.8663,4.0408,-0.4237,0.52282,0.00030514,0.00056762
+0.7100,3.8173,4.0077,4.2014,-0.35954,0.4551,0.00044438,0.00047796
+0.7000,3.9274,4.1413,4.3596,-0.29767,0.3675,0.00054788,0.00033875
+0.6900,4.0785,4.2972,4.5109,-0.22203,0.26072,0.00059669,0.00017728
+0.6800,4.2191,4.4301,4.6241,-0.19947,0.20933,0.00057429,0.00016052
+0.6700,4.3743,4.5637,4.7329,-0.25224,0.22398,0.00049179,0.00028011
+0.6600,4.5391,4.685,4.8276,-0.32748,0.29123,0.00036578,0.00038857
+0.6500,4.7069,4.8185,4.9368,-0.40269,0.37236,0.0002259,0.00044877
+0.6400,4.839,4.9576,5.0915,-0.46341,0.44264,0.00017844,0.00046213
+0.6300,4.9245,5.1047,5.2843,-0.5074,0.50523,0.00031645,0.00045972
+0.6200,5.0136,5.2368,5.4544,-0.53949,0.54662,0.00046909,0.00048604
+0.6100,5.111,5.3692,5.6113,-0.56467,0.5746,0.00057958,0.00054948
+0.6000,5.2243,5.5023,5.7561,-0.58444,0.58828,0.00063113,0.00062446
+0.5900,5.3572,5.6358,5.8807,-0.59448,0.58786,0.00061781,0.0006799
+0.5800,5.5014,5.7673,5.9892,-0.58544,0.5752,0.00054089,0.00069539
+0.5700,5.6812,5.9131,6.0961,-0.55883,0.54262,0.00039452,0.00066249
+0.5600,5.8816,6.0576,6.1887,-0.51454,0.49485,0.00023419,0.00059288
+0.5500,6.0628,6.1852,6.2848,-0.46683,0.44377,0.00019887,0.00052141
+0.5400,6.207,6.3128,6.4189,-0.41669,0.38343,0.00029578,0.00045655
+0.5300,6.3086,6.4448,6.5794,-0.35482,0.30752,0.00043914,0.00039927
+0.5200,6.3991,6.5786,6.7369,-0.27431,0.25094,0.00055334,0.00034979
+0.5100,6.4981,6.7083,6.8811,-0.21164,0.25399,0.00060691,0.00032018
+0.5000,6.6297,6.8583,7.0265,-0.24558,0.27731,0.00059216,0.00032973
+0.4900,6.7726,7.0067,7.1567,-0.356,0.29735,0.00050622,0.00038565
+0.4800,6.9115,7.1329,7.2622,-0.4474,0.3428,0.00038758,0.00044604
+0.4700,7.0604,7.2687,7.3804,-0.52596,0.41698,0.00025911,0.00048842
+0.4600,7.1951,7.4024,7.5188,-0.58535,0.48654,0.00021128,0.00049078
+0.4500,7.3068,7.5272,7.669,-0.62421,0.53763,0.00028465,0.00044961
+0.4400,7.4101,7.649,7.8219,-0.64418,0.5729,0.00041735,0.00037272
+0.4300,7.5199,7.7735,7.9802,-0.64636,0.59358,0.00054031,0.00028746
+0.4200,7.6143,7.8793,8.0995,-0.63182,0.59512,0.00060051,0.00027021
+0.4100,7.7051,7.9641,8.1843,-0.6166,0.58709,0.00059923,0.0003232
+0.4000,7.801,8.0308,8.2374,-0.60676,0.57478,0.00054134,0.00040677
+0.3900,7.8921,8.0859,8.2562,-0.6013,0.55621,0.00043242,0.00048779
+0.3800,7.9713,8.1299,8.2553,-0.59518,0.52968,0.00028307,0.00055503
+0.3700,8.0084,8.1558,8.2404,-0.58159,0.49703,0.00015446,0.00059873
+0.3600,8.0021,8.1696,8.278,-0.55034,0.45717,0.00018635,0.00061661
+0.3500,7.9566,8.1727,8.3372,-0.49601,0.40248,0.00034838,0.00059381
+0.3400,7.905,8.1604,8.3731,-0.42818,0.33936,0.00049056,0.0005322
+0.3300,7.8533,8.1365,8.39,-0.33456,0.25845,0.00059533,0.00043248
+0.3200,7.8056,8.1045,8.3776,-0.23421,0.2331,0.0006432,0.00032033
+0.3100,7.761,8.0644,8.3405,-0.22088,0.26529,0.0006277,0.00026796
+0.3000,7.7189,8.0022,8.2643,-0.28977,0.31751,0.0005368,0.00033295
+0.2900,7.6739,7.9301,8.1658,-0.39446,0.42045,0.00038382,0.00046283
+0.2800,7.6246,7.8459,8.0509,-0.48804,0.53179,0.00020665,0.00056702
+0.2700,7.5634,7.7491,7.932,-0.57779,0.63249,0.00011813,0.00063384
+0.2600,7.4663,7.6506,7.859,-0.64945,0.70895,0.00024585,0.00065138
+0.2500,7.3228,7.527,7.7799,-0.70441,0.76293,0.00042939,0.0006312
+0.2400,7.1597,7.3861,7.6774,-0.73767,0.79813,0.00058146,0.00058793
+0.2300,6.969,7.2069,7.5254,-0.7517,0.80676,0.00068239,0.00053814
+0.2200,6.8088,7.0434,7.3572,-0.74414,0.7939,0.00068667,0.00051572
+0.2100,6.6588,6.8619,7.1438,-0.72362,0.76754,0.00061593,0.00051032
+0.2000,6.5037,6.6686,6.9181,-0.68584,0.72274,0.00048139,0.00051203
+0.1900,6.3328,6.4581,6.6501,-0.63311,0.6592,0.00028779,0.0005041
+0.1800,6.1156,6.2325,6.3887,-0.56363,0.60238,9.5094e-05,0.0004755
+0.1700,5.8686,5.9983,6.1805,-0.48603,0.54173,0.00019506,0.00042002
+0.1600,5.5143,5.6991,5.9339,-0.37646,0.4533,0.0004363,0.00031603
+0.1500,5.2212,5.439,5.7104,-0.2777,0.3673,0.00059587,0.00021746
+0.1400,4.9247,5.1623,5.454,-0.21193,0.28841,0.00069214,0.00019128
+0.1300,4.6183,4.8648,5.16,-0.23539,0.33754,0.0007099,0.00029639
+0.1200,4.3344,4.5666,4.8457,-0.28857,0.39345,0.00064345,0.00045091
+0.1100,4.0604,4.27,4.5181,-0.34685,0.44316,0.00050826,0.00058987
+0.1000,3.7393,3.8979,4.0846,-0.41671,0.49604,0.00027637,0.00071811
+0.0900,3.4686,3.5875,3.7159,-0.46818,0.5297,7.4395e-05,0.00076743
+0.0800,3.1379,3.2369,3.3446,-0.49865,0.55685,0.0002136,0.0007685
+0.0700,2.7502,2.884,3.0323,-0.50354,0.55775,0.00042144,0.00072249
+0.0600,2.3637,2.5327,2.713,-0.48388,0.53839,0.00057584,0.00064899
+0.0500,1.9604,2.1463,2.35,-0.43809,0.48845,0.0006718,0.00055499
+0.0400,1.5555,1.7339,1.9397,-0.37257,0.41924,0.00068287,0.00045297
+0.0300,1.1194,1.2769,1.4527,-0.28437,0.32171,0.00059591,0.00033848
+0.0200,0.73081,0.84413,0.97485,-0.19058,0.21739,0.00043591,0.0002287
+0.0100,0.3548,0.41584,0.4798,-0.096692,0.10967,0.00022704,0.00011438
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case7_envelopes.csv b/validation/experiments/delta_flume/envelopes/case7_envelopes.csv
new file mode 100644
index 00000000..851026d0
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case7_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.10407,0.13093,0.18141,-0.1063,0.10129,0.00013514,0.00024052
+0.9800,0.21049,0.27061,0.35804,-0.2077,0.19509,0.00025397,0.00045632
+0.9700,0.32927,0.40739,0.52698,-0.2842,0.26899,0.00032962,0.00060945
+0.9600,0.48542,0.57356,0.71484,-0.35414,0.32919,0.00036139,0.00071731
+0.9500,0.63865,0.71682,0.86059,-0.39293,0.3591,0.00032884,0.00073979
+0.9400,0.79309,0.85895,0.99829,-0.40919,0.38052,0.00025248,0.00071896
+0.9300,0.91258,0.99347,1.1158,-0.41202,0.40405,0.00015769,0.00067935
+0.9200,1.0373,1.1454,1.262,-0.40133,0.41433,0.0001107,0.00063411
+0.9100,1.1653,1.2879,1.4045,-0.37579,0.40706,0.00018894,0.00059051
+0.9000,1.2903,1.4246,1.5556,-0.33394,0.37964,0.00028746,0.00053481
+0.8900,1.4669,1.6074,1.7402,-0.26554,0.31199,0.00036664,0.00042688
+0.8800,1.6183,1.7536,1.8752,-0.2208,0.24798,0.00038107,0.00031244
+0.8700,1.792,1.9045,2.0155,-0.19377,0.18598,0.0003425,0.00018282
+0.8600,1.962,2.0477,2.1408,-0.25883,0.21133,0.00026265,0.00011035
+0.8500,2.1471,2.1985,2.2625,-0.35107,0.31437,0.00014938,0.00019488
+0.8400,2.3088,2.3354,2.4254,-0.4343,0.40853,7.7967e-05,0.00031666
+0.8300,2.4531,2.5201,2.6421,-0.52134,0.51211,0.00019086,0.00045294
+0.8200,2.5797,2.6704,2.8179,-0.58091,0.58084,0.00029906,0.00055761
+0.8100,2.7141,2.8225,2.9844,-0.62457,0.63133,0.00037256,0.0006523
+0.8000,2.8529,2.9661,3.1353,-0.65224,0.66333,0.00039751,0.00072812
+0.7900,3.0037,3.1145,3.2832,-0.6602,0.67795,0.00037483,0.00078028
+0.7800,3.1649,3.2612,3.4091,-0.65173,0.67585,0.00031097,0.00079259
+0.7700,3.3364,3.4178,3.5455,-0.62896,0.65423,0.00021425,0.00075502
+0.7600,3.4976,3.5886,3.6905,-0.57233,0.60324,0.00014977,0.00065175
+0.7500,3.6306,3.7319,3.8176,-0.505,0.53789,0.00018937,0.00052945
+0.7400,3.7602,3.8767,3.9573,-0.42438,0.46321,0.00027345,0.00040204
+0.7300,3.9003,4.0258,4.1267,-0.33219,0.37012,0.0003432,0.00028952
+0.7200,4.0474,4.1692,4.2786,-0.24494,0.26942,0.00037423,0.00022446
+0.7100,4.2081,4.3156,4.4275,-0.19473,0.18441,0.00036063,0.00021816
+0.7000,4.3624,4.4648,4.5699,-0.20275,0.20651,0.00030242,0.00025399
+0.6900,4.5358,4.6282,4.7197,-0.2831,0.2807,0.00020333,0.00032399
+0.6800,4.6752,4.7673,4.8537,-0.36474,0.3683,0.00014352,0.0004026
+0.6700,4.7995,4.9072,5.0119,-0.4432,0.45185,0.00016305,0.00049577
+0.6600,4.9151,5.0436,5.1676,-0.5073,0.52004,0.00024323,0.00058763
+0.6500,5.0485,5.1853,5.3285,-0.55845,0.56734,0.00031976,0.00066951
+0.6400,5.1938,5.3312,5.4841,-0.58817,0.59321,0.00036439,0.00073183
+0.6300,5.3626,5.4904,5.6492,-0.58923,0.59155,0.00036046,0.00076329
+0.6200,5.5173,5.6332,5.7858,-0.56441,0.56992,0.00031265,0.00075732
+0.6100,5.6702,5.7735,5.9048,-0.51898,0.53302,0.0002367,0.0007165
+0.6000,5.8099,5.9108,6.0152,-0.45817,0.47966,0.00016477,0.00064189
+0.5900,5.9383,6.0475,6.1275,-0.38756,0.40985,0.00014737,0.00053394
+0.5800,6.0675,6.1861,6.2604,-0.32005,0.33309,0.00020349,0.00040218
+0.5700,6.2213,6.3431,6.4469,-0.26837,0.25424,0.00028892,0.00026535
+0.5600,6.3861,6.5053,6.6239,-0.2405,0.19563,0.00034587,0.0002378
+0.5500,6.5316,6.6454,6.7647,-0.24486,0.197,0.00035707,0.00032659
+0.5400,6.6712,6.7803,6.8896,-0.2841,0.24775,0.000331,0.00044633
+0.5300,6.8118,6.9178,7.0198,-0.3504,0.31303,0.00027148,0.00055073
+0.5200,6.957,7.0611,7.1486,-0.42179,0.3734,0.00019577,0.00062125
+0.5100,7.0959,7.2014,7.2853,-0.4786,0.41925,0.00015718,0.0006554
+0.5000,7.2413,7.3565,7.4734,-0.52423,0.45524,0.00019891,0.00066763
+0.4900,7.3859,7.5084,7.6577,-0.55134,0.48514,0.00028467,0.00067079
+0.4800,7.5209,7.6486,7.8127,-0.55514,0.50137,0.00034727,0.00067493
+0.4700,7.6657,7.7929,7.9615,-0.54044,0.49857,0.00037939,0.00067825
+0.4600,7.8209,7.9316,8.1014,-0.50575,0.47467,0.00036954,0.00067085
+0.4500,7.9756,8.0653,8.2264,-0.45086,0.43379,0.00031931,0.00064272
+0.4400,8.1205,8.2005,8.337,-0.38253,0.37391,0.00023508,0.00058344
+0.4300,8.2641,8.3434,8.4462,-0.29374,0.29644,0.00014362,0.00047668
+0.4200,8.3818,8.4652,8.5558,-0.20088,0.23164,0.0001517,0.00033982
+0.4100,8.4698,8.5724,8.6791,-0.22968,0.24085,0.00023657,0.00020289
+0.4000,8.551,8.6685,8.7941,-0.33443,0.32746,0.00032879,0.00018908
+0.3900,8.6316,8.7466,8.8832,-0.4403,0.4327,0.00039129,0.00034293
+0.3800,8.6894,8.8122,8.9475,-0.53817,0.53116,0.00041003,0.00057539
+0.3700,8.7298,8.8621,8.9904,-0.61508,0.61623,0.00037984,0.00079942
+0.3600,8.7707,8.9044,9.0125,-0.67232,0.69077,0.00029538,0.0010127
+0.3500,8.802,8.9301,9.0095,-0.69498,0.73152,0.00018733,0.0011516
+0.3400,8.8223,8.9356,9.0355,-0.68161,0.73544,0.00014276,0.0011991
+0.3300,8.8229,8.9299,9.0677,-0.64148,0.70927,0.00020469,0.0011651
+0.3200,8.7916,8.9148,9.0771,-0.57696,0.65342,0.00031478,0.0010457
+0.3100,8.7486,8.8856,9.0603,-0.49053,0.57226,0.00040273,0.00086144
+0.3000,8.6971,8.8338,9.0113,-0.36435,0.45041,0.00045384,0.00059094
+0.2900,8.629,8.7711,8.9337,-0.2245,0.31673,0.00043944,0.00030952
+0.2800,8.568,8.698,8.8363,-0.12519,0.19354,0.00037277,0.00016865
+0.2700,8.5,8.6089,8.7109,-0.20367,0.24967,0.00026327,0.00030211
+0.2600,8.4297,8.5048,8.5706,-0.33128,0.37629,0.0001538,0.00051734
+0.2500,8.3128,8.3879,8.4536,-0.45462,0.49965,0.00015227,0.00071669
+0.2400,8.145,8.2485,8.3456,-0.56264,0.60311,0.00025745,0.00088535
+0.2300,7.9283,8.0682,8.1914,-0.65573,0.68489,0.000394,0.0010266
+0.2200,7.7472,7.8964,8.0385,-0.69935,0.71759,0.00046557,0.0010962
+0.2100,7.5561,7.7063,7.8504,-0.70892,0.72502,0.00048473,0.0011191
+0.2000,7.371,7.5066,7.6409,-0.68368,0.70886,0.00044752,0.0010932
+0.1900,7.168,7.2803,7.3858,-0.62112,0.66358,0.00035782,0.0010133
+0.1800,6.9485,7.0343,7.1134,-0.53448,0.5869,0.00023265,0.00088064
+0.1700,6.723,6.7847,6.8357,-0.4361,0.49015,0.00013404,0.00070662
+0.1600,6.3869,6.4524,6.5157,-0.29886,0.34826,0.00019061,0.00044685
+0.1500,6.0709,6.1711,6.2657,-0.17834,0.22059,0.00031537,0.00022439
+0.1400,5.7369,5.8673,5.9946,-0.087892,0.18098,0.00041888,0.00020671
+0.1300,5.3939,5.5433,5.6935,-0.1929,0.29046,0.00047627,0.00041575
+0.1200,5.067,5.2118,5.3763,-0.31468,0.40515,0.00047231,0.00064499
+0.1100,4.7465,4.8802,5.0412,-0.41677,0.49152,0.00041344,0.00082618
+0.1000,4.3518,4.4649,4.6088,-0.52274,0.58335,0.00028347,0.00097676
+0.0900,4.0228,4.1137,4.2283,-0.58142,0.63578,0.00015346,0.0010234
+0.0800,3.6368,3.7172,3.809,-0.61274,0.65553,0.00011889,0.0010073
+0.0700,3.206,3.3213,3.41,-0.61376,0.64544,0.00024123,0.00093465
+0.0600,2.7842,2.9168,3.0289,-0.58701,0.60809,0.00035884,0.00082726
+0.0500,2.321,2.4789,2.6001,-0.53447,0.54429,0.00044169,0.0006922
+0.0400,1.8591,2.0099,2.1443,-0.45798,0.46073,0.00046453,0.00054798
+0.0300,1.3462,1.4792,1.6005,-0.35188,0.34679,0.00041597,0.00039271
+0.0200,0.88827,0.98063,1.0703,-0.23711,0.2361,0.00030818,0.0002553
+0.0100,0.43043,0.4798,0.5322,-0.1169,0.11929,0.00016198,0.00012469
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case8_envelopes.csv b/validation/experiments/delta_flume/envelopes/case8_envelopes.csv
new file mode 100644
index 00000000..6b8bfcfe
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case8_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.09524,0.17246,0.24085,-0.1122,0.13277,0.00020495,0.00024646
+0.9800,0.20139,0.35769,0.48133,-0.22159,0.25974,0.0003807,0.00046913
+0.9700,0.31725,0.53539,0.70861,-0.30997,0.36128,0.00049216,0.00063626
+0.9600,0.49401,0.7462,0.96939,-0.38995,0.45104,0.00053643,0.00076983
+0.9500,0.67707,0.93579,1.1869,-0.43214,0.49728,0.00049604,0.00082657
+0.9400,0.88171,1.1211,1.3993,-0.44875,0.50856,0.00041621,0.00084803
+0.9300,1.0912,1.3046,1.6063,-0.44046,0.49693,0.00035928,0.00085046
+0.9200,1.2349,1.4944,1.8253,-0.40648,0.4597,0.00039095,0.00083685
+0.9100,1.3861,1.6804,2.0086,-0.36468,0.4034,0.00048486,0.00080338
+0.9000,1.5547,1.8574,2.186,-0.34063,0.33751,0.0005732,0.00073209
+0.8900,1.7948,2.0956,2.3887,-0.28684,0.24038,0.00061051,0.00057507
+0.8800,2.001,2.2807,2.5289,-0.2405,0.21395,0.00056719,0.00041104
+0.8700,2.2458,2.4778,2.6543,-0.22047,0.2304,0.00045215,0.00023758
+0.8600,2.4844,2.6653,2.7851,-0.28808,0.30107,0.00030615,0.00017853
+0.8500,2.7451,2.8606,2.9604,-0.38475,0.43393,0.00019855,0.00032078
+0.8400,2.9192,3.0485,3.1748,-0.47548,0.55288,0.00027032,0.00048089
+0.8300,3.0672,3.2766,3.4208,-0.5778,0.68651,0.00045232,0.00063444
+0.8200,3.2035,3.4701,3.6291,-0.65985,0.7837,0.00057091,0.00073001
+0.8100,3.3584,3.6668,3.8538,-0.72973,0.85811,0.00062542,0.00079603
+0.8000,3.517,3.8535,4.0786,-0.78315,0.90599,0.0006134,0.00083879
+0.7900,3.7133,4.0443,4.2891,-0.83189,0.92522,0.00054623,0.00086359
+0.7800,3.9189,4.2325,4.4908,-0.8645,0.91471,0.0004563,0.00086797
+0.7700,4.1679,4.4351,4.7065,-0.86807,0.87323,0.00038914,0.00084481
+0.7600,4.4286,4.6545,4.9513,-0.84745,0.79236,0.00041726,0.0007867
+0.7500,4.6025,4.8459,5.149,-0.80239,0.71094,0.00049661,0.00071509
+0.7400,4.7449,5.0264,5.3243,-0.73534,0.62891,0.00056983,0.00063135
+0.7300,4.9127,5.2179,5.4912,-0.65243,0.54297,0.00060423,0.00053752
+0.7200,5.0895,5.3952,5.6305,-0.55038,0.45926,0.00058436,0.00044375
+0.7100,5.2944,5.5823,5.7577,-0.44036,0.37933,0.0005074,0.00036487
+0.7000,5.5167,5.769,5.9099,-0.34726,0.3348,0.00039101,0.00034745
+0.6900,5.7925,5.9747,6.1526,-0.39917,0.41568,0.00027899,0.00044292
+0.6800,5.9882,6.1473,6.347,-0.48792,0.48368,0.00027839,0.00057699
+0.6700,6.1161,6.3238,6.5354,-0.56197,0.55035,0.00037073,0.00071862
+0.6600,6.23,6.4946,6.7033,-0.61584,0.60012,0.00047614,0.00083137
+0.6500,6.3558,6.6701,6.8669,-0.64781,0.63816,0.00054993,0.00090489
+0.6400,6.5095,6.8503,7.0385,-0.65904,0.66196,0.00056979,0.00093079
+0.6300,6.7003,7.0408,7.2452,-0.65646,0.67389,0.00052483,0.00090805
+0.6200,6.8902,7.2191,7.4466,-0.64231,0.66092,0.00044658,0.00085925
+0.6100,7.0879,7.3944,7.6474,-0.61668,0.62145,0.00037379,0.00079768
+0.6000,7.2924,7.5626,7.8439,-0.57369,0.55989,0.00035514,0.00073123
+0.5900,7.4878,7.731,8.0373,-0.51606,0.47806,0.00040609,0.0006615
+0.5800,7.6452,7.9035,8.2161,-0.44734,0.3868,0.00048955,0.00059155
+0.5700,7.8129,8.0972,8.3937,-0.35744,0.32649,0.00056087,0.00052164
+0.5600,8.0042,8.2924,8.5431,-0.27886,0.33055,0.00057286,0.00048158
+0.5500,8.1946,8.4603,8.6589,-0.28221,0.33792,0.00052299,0.00048742
+0.5400,8.3911,8.6241,8.7694,-0.36421,0.36342,0.00042675,0.00052891
+0.5300,8.6068,8.7935,8.922,-0.46934,0.4222,0.0003063,0.00059657
+0.5200,8.8295,8.9648,9.1197,-0.56411,0.49966,0.00023898,0.00068263
+0.5100,8.9882,9.1352,9.3074,-0.63604,0.57563,0.00029739,0.00077732
+0.5000,9.1096,9.3238,9.5105,-0.68993,0.64757,0.00044225,0.00088928
+0.4900,9.2437,9.5106,9.7012,-0.72013,0.69193,0.00056486,0.0009968
+0.4800,9.3806,9.6793,9.881,-0.72187,0.70844,0.00061957,0.0010709
+0.4700,9.5428,9.8496,10.077,-0.69992,0.69809,0.00061342,0.0011092
+0.4600,9.7265,10.019,10.258,-0.65609,0.65918,0.00054716,0.0010949
+0.4500,9.9209,10.183,10.426,-0.59382,0.59868,0.00044162,0.0010235
+0.4400,10.128,10.345,10.608,-0.51325,0.51689,0.00033641,0.00089451
+0.4300,10.341,10.518,10.806,-0.43019,0.42228,0.00031187,0.00071046
+0.4200,10.465,10.663,10.966,-0.38655,0.37771,0.00039423,0.00055142
+0.4100,10.552,10.787,11.091,-0.3759,0.37924,0.00049558,0.00048558
+0.4000,10.646,10.899,11.186,-0.39731,0.40682,0.00056642,0.00053601
+0.3900,10.746,10.993,11.25,-0.45197,0.44688,0.00058236,0.0006637
+0.3800,10.847,11.076,11.281,-0.53003,0.49958,0.00053597,0.00080833
+0.3700,10.938,11.135,11.282,-0.62072,0.58133,0.00043819,0.0009212
+0.3600,11.029,11.183,11.302,-0.71247,0.68564,0.00029799,0.00099155
+0.3500,11.1,11.214,11.345,-0.7695,0.76681,0.00021863,0.0009948
+0.3400,11.078,11.225,11.383,-0.78937,0.81207,0.0002741,0.00094303
+0.3300,11.011,11.215,11.401,-0.79111,0.8345,0.00039753,0.00084792
+0.3200,10.941,11.18,11.386,-0.77792,0.83973,0.00051194,0.00073098
+0.3100,10.867,11.131,11.339,-0.75984,0.8262,0.00057669,0.00062724
+0.3000,10.778,11.051,11.237,-0.7453,0.7901,0.00058156,0.00055455
+0.2900,10.691,10.945,11.108,-0.73333,0.73689,0.00051221,0.00054722
+0.2800,10.609,10.83,10.982,-0.71675,0.67893,0.00039392,0.0005714
+0.2700,10.515,10.685,10.804,-0.6854,0.603,0.00023898,0.00059656
+0.2600,10.394,10.528,10.636,-0.63403,0.52593,0.00014245,0.00060298
+0.2500,10.202,10.345,10.482,-0.56636,0.44688,0.00021531,0.00058869
+0.2400,9.9657,10.146,10.309,-0.47726,0.40371,0.00036591,0.00055727
+0.2300,9.6851,9.8889,10.073,-0.39446,0.40565,0.00050955,0.00051788
+0.2200,9.4512,9.6566,9.8489,-0.39033,0.40413,0.0005687,0.00050162
+0.2100,9.2078,9.4061,9.586,-0.40249,0.388,0.00056437,0.00051535
+0.2000,8.9701,9.1525,9.3084,-0.42795,0.36487,0.00049839,0.00055937
+0.1900,8.7194,8.8658,8.9946,-0.46019,0.34228,0.00037395,0.00062679
+0.1800,8.4594,8.5585,8.6478,-0.48192,0.36672,0.00021435,0.00069743
+0.1700,8.1769,8.2546,8.3071,-0.49425,0.40746,0.00012348,0.00075316
+0.1600,7.7677,7.8528,7.9297,-0.4869,0.442,0.00024532,0.00079096
+0.1500,7.3823,7.5087,7.629,-0.46712,0.45088,0.00039765,0.00078765
+0.1400,6.981,7.1363,7.2918,-0.44786,0.4385,0.00051349,0.00075679
+0.1300,6.5596,6.7347,6.9186,-0.42878,0.40424,0.00057202,0.00069982
+0.1200,6.15,6.3271,6.5174,-0.40743,0.35541,0.0005589,0.00062527
+0.1100,5.7528,5.9156,6.0951,-0.37141,0.3028,0.00048121,0.00054397
+0.1000,5.2681,5.3997,5.5397,-0.30612,0.22796,0.0003205,0.00045092
+0.0900,4.8609,4.9609,5.0601,-0.24023,0.1967,0.00016033,0.00041312
+0.0800,4.3844,4.4768,4.5634,-0.16251,0.18878,0.00014205,0.00043828
+0.0700,3.869,3.9813,4.1146,-0.16716,0.18174,0.00030448,0.00051844
+0.0600,3.3542,3.4921,3.6498,-0.19052,0.18791,0.00045052,0.00060671
+0.0500,2.8007,2.9557,3.1258,-0.20308,0.2016,0.00055315,0.00067161
+0.0400,2.2395,2.39,2.5588,-0.19355,0.20512,0.0005823,0.00067569
+0.0300,1.6263,1.7599,1.8991,-0.16522,0.18142,0.00052137,0.00059265
+0.0200,1.0612,1.1651,1.2661,-0.11574,0.1354,0.0003869,0.00043743
+0.0100,0.52345,0.57282,0.6223,-0.05821,0.07119,0.00020298,0.00022886
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/envelopes/case9_envelopes.csv b/validation/experiments/delta_flume/envelopes/case9_envelopes.csv
new file mode 100644
index 00000000..e2bc7487
--- /dev/null
+++ b/validation/experiments/delta_flume/envelopes/case9_envelopes.csv
@@ -0,0 +1,102 @@
+z_over_L,x_min_D,x_mean_D,x_max_D,y_min_D,y_max_D,kx_rms_D,ky_rms_D
+1.0000,0,0,0,0.0019206,0.0019206,0,0
+0.9900,0.13093,0.21411,0.27653,-0.12303,0.13917,0.00027436,0.00029742
+0.9800,0.27061,0.4449,0.54168,-0.2464,0.27073,0.00050256,0.00056923
+0.9700,0.43814,0.66341,0.78672,-0.34781,0.38539,0.00063147,0.00077395
+0.9600,0.67027,0.93702,1.0797,-0.45086,0.51419,0.00064575,0.00094298
+0.9500,0.90527,1.1704,1.3351,-0.51062,0.60501,0.00053228,0.0010212
+0.9400,1.1443,1.401,1.6161,-0.54128,0.66742,0.00037002,0.001055
+0.9300,1.313,1.6253,1.8784,-0.55218,0.70474,0.00030678,0.0010614
+0.9200,1.4852,1.8613,2.164,-0.55783,0.71309,0.00047916,0.0010395
+0.9100,1.6713,2.0911,2.416,-0.53753,0.68896,0.00068956,0.00098342
+0.9000,1.8898,2.3152,2.6517,-0.48126,0.63605,0.00083382,0.00087563
+0.8900,2.2071,2.6058,2.9528,-0.36733,0.52763,0.00086025,0.00066255
+0.8800,2.4927,2.8372,3.1809,-0.26168,0.42937,0.00075583,0.00045921
+0.8700,2.8166,3.0777,3.3932,-0.19136,0.42667,0.00054481,0.00028181
+0.8600,3.0737,3.3065,3.5896,-0.29558,0.56939,0.00033225,0.00028087
+0.8500,3.2807,3.5486,3.8025,-0.43896,0.70825,0.00033739,0.00044598
+0.8400,3.4756,3.7889,4.0121,-0.56511,0.82601,0.00057686,0.00060296
+0.8300,3.7391,4.0664,4.326,-0.69157,0.94082,0.00083731,0.00074103
+0.8200,3.982,4.3096,4.5991,-0.76909,1.0136,0.00095147,0.00082329
+0.8100,4.2338,4.5561,4.8578,-0.8204,1.0758,0.0009371,0.00088948
+0.8000,4.4917,4.7867,5.0726,-0.83961,1.1317,0.00080875,0.00094732
+0.7900,4.7699,5.0324,5.275,-0.8299,1.1623,0.00059406,0.00099859
+0.7800,5.0373,5.258,5.4751,-0.81115,1.1628,0.00039473,0.0010272
+0.7700,5.2756,5.5103,5.7269,-0.79856,1.1369,0.00039824,0.0010183
+0.7600,5.4783,5.7874,6.0427,-0.74944,1.0766,0.00064155,0.00095212
+0.7500,5.6704,6.0245,6.3159,-0.68216,0.99655,0.00082876,0.00085854
+0.7400,5.8836,6.2478,6.5556,-0.58942,0.89787,0.00092003,0.00074672
+0.7300,6.1271,6.4798,6.7772,-0.46672,0.77589,0.00089933,0.00062444
+0.7200,6.3906,6.7013,6.9794,-0.35168,0.64432,0.00077679,0.00051267
+0.7100,6.661,6.9303,7.1754,-0.33014,0.54401,0.00057998,0.00043316
+0.7000,6.928,7.1561,7.3786,-0.33804,0.59781,0.00041141,0.0004337
+0.6900,7.1551,7.4125,7.6499,-0.42108,0.72644,0.00044951,0.0005551
+0.6800,7.3367,7.6263,7.9044,-0.52326,0.82135,0.00062611,0.00070561
+0.6700,7.5444,7.845,8.1446,-0.64164,0.92282,0.0007952,0.00085778
+0.6600,7.7599,8.0502,8.3742,-0.73421,1.0217,0.00088149,0.00097382
+0.6500,7.9742,8.2588,8.618,-0.80396,1.0911,0.00086847,0.0010438
+0.6400,8.1907,8.4763,8.8369,-0.84439,1.1314,0.00075047,0.0010635
+0.6300,8.4355,8.7098,9.0396,-0.85261,1.1368,0.00054962,0.0010404
+0.6200,8.6533,8.9278,9.2098,-0.82341,1.1119,0.00041069,0.001002
+0.6100,8.8724,9.1428,9.364,-0.7766,1.0806,0.00042808,0.00096108
+0.6000,9.0832,9.3487,9.5638,-0.72949,1.0453,0.0005756,0.00091937
+0.5900,9.2789,9.556,9.833,-0.67087,0.98914,0.00073619,0.00086653
+0.5800,9.46,9.7666,10.083,-0.59696,0.91109,0.00083515,0.00079493
+0.5700,9.6885,10.005,10.328,-0.51071,0.79856,0.00084185,0.00069538
+0.5600,9.9421,10.238,10.549,-0.44016,0.68187,0.00073956,0.00059952
+0.5500,10.194,10.445,10.733,-0.43099,0.62262,0.0005842,0.00055898
+0.5400,10.447,10.644,10.902,-0.48698,0.65704,0.00043205,0.0005872
+0.5300,10.679,10.847,11.102,-0.57975,0.74424,0.00037693,0.00068284
+0.5200,10.874,11.056,11.371,-0.67658,0.81225,0.00047758,0.00082305
+0.5100,11.041,11.256,11.642,-0.75544,0.84915,0.00063835,0.00096328
+0.5000,11.219,11.491,11.918,-0.81185,0.85697,0.00077632,0.0010908
+0.4900,11.402,11.721,12.166,-0.84694,0.85937,0.00082588,0.0011636
+0.4800,11.581,11.92,12.368,-0.8889,0.87887,0.00078781,0.0011657
+0.4700,11.772,12.128,12.55,-0.93152,0.89399,0.00067946,0.001099
+0.4600,11.965,12.332,12.72,-0.96359,0.87914,0.00053456,0.00096775
+0.4500,12.146,12.531,12.888,-0.97992,0.84557,0.00042514,0.00079449
+0.4400,12.328,12.725,13.082,-0.96973,0.80027,0.00043089,0.00061125
+0.4300,12.525,12.915,13.308,-0.94057,0.73409,0.00056747,0.00048053
+0.4200,12.69,13.08,13.479,-0.90095,0.67096,0.00070994,0.00047693
+0.4100,12.837,13.21,13.594,-0.86075,0.61864,0.00079206,0.00054005
+0.4000,12.97,13.316,13.668,-0.8129,0.58108,0.00080069,0.00060634
+0.3900,13.087,13.402,13.72,-0.75878,0.55043,0.00073065,0.00064678
+0.3800,13.206,13.472,13.745,-0.74371,0.5487,0.00058856,0.00066153
+0.3700,13.312,13.513,13.749,-0.77229,0.58014,0.00041493,0.00066141
+0.3600,13.374,13.537,13.755,-0.81308,0.60975,0.00028352,0.00065357
+0.3500,13.352,13.538,13.752,-0.84605,0.62106,0.0003476,0.00063902
+0.3400,13.3,13.519,13.761,-0.86475,0.61577,0.00050416,0.00062132
+0.3300,13.225,13.476,13.772,-0.86986,0.62599,0.00065456,0.00060987
+0.3200,13.138,13.409,13.758,-0.86753,0.64597,0.00074892,0.00062217
+0.3100,13.03,13.329,13.694,-0.86474,0.65102,0.00076947,0.00066404
+0.3000,12.906,13.212,13.562,-0.87936,0.6304,0.00070867,0.0007291
+0.2900,12.778,13.068,13.385,-0.90236,0.59947,0.00057692,0.00077344
+0.2800,12.647,12.911,13.195,-0.90957,0.59134,0.00042261,0.00077244
+0.2700,12.464,12.716,12.984,-0.90776,0.57162,0.00029383,0.00072481
+0.2600,12.25,12.513,12.741,-0.89122,0.55698,0.0003028,0.00064608
+0.2500,11.993,12.279,12.491,-0.86668,0.57139,0.0004251,0.00056431
+0.2400,11.697,12.016,12.235,-0.83004,0.58909,0.00057558,0.00051436
+0.2300,11.346,11.698,11.938,-0.78427,0.59985,0.00070513,0.00051565
+0.2200,11.05,11.4,11.655,-0.75037,0.59872,0.00074762,0.0005437
+0.2100,10.761,11.077,11.342,-0.75437,0.58232,0.00072259,0.00056371
+0.2000,10.446,10.743,11.017,-0.75946,0.55911,0.00063341,0.00056434
+0.1900,10.094,10.388,10.635,-0.74834,0.52693,0.00048752,0.00055172
+0.1800,9.7266,10.007,10.225,-0.74312,0.47712,0.0003243,0.00053778
+0.1700,9.3487,9.6246,9.8454,-0.73956,0.43078,0.00026124,0.00053442
+0.1600,8.8638,9.1316,9.4197,-0.71902,0.42436,0.00039191,0.00054868
+0.1500,8.4281,8.7103,9.0588,-0.70062,0.42488,0.00056877,0.00057623
+0.1400,7.9585,8.2567,8.652,-0.66618,0.41604,0.00071573,0.00061413
+0.1300,7.4877,7.7792,8.1978,-0.61252,0.39814,0.00079426,0.00065338
+0.1200,7.0295,7.2907,7.7061,-0.56153,0.38616,0.00078122,0.00067548
+0.1100,6.5526,6.8149,7.2008,-0.54613,0.36663,0.0006812,0.0006633
+0.1000,5.9507,6.209,6.536,-0.51464,0.32979,0.00046523,0.00059428
+0.0900,5.4594,5.7025,5.9689,-0.46703,0.27496,0.00025132,0.00050144
+0.0800,4.9204,5.1355,5.343,-0.40491,0.20759,0.00022167,0.0004238
+0.0700,4.3581,4.5699,4.7659,-0.3274,0.15325,0.00044342,0.00044381
+0.0600,3.7688,4.0084,4.2409,-0.27114,0.16808,0.00065376,0.00054651
+0.0500,3.1345,3.3916,3.6527,-0.257,0.18936,0.00080509,0.00065896
+0.0400,2.5024,2.7424,3.0091,-0.23108,0.19488,0.00085028,0.00071043
+0.0300,1.8105,2.014,2.241,-0.18623,0.16773,0.00076312,0.00065659
+0.0200,1.1794,1.3376,1.4982,-0.13064,0.12208,0.00056799,0.00049794
+0.0100,0.57282,0.66011,0.74146,-0.067831,0.063974,0.00029794,0.00026528
+0.0000,0,0,0,0.0019206,0.0019206,0,0
diff --git a/validation/experiments/delta_flume/measured_summary.csv b/validation/experiments/delta_flume/measured_summary.csv
new file mode 100644
index 00000000..b01519d9
--- /dev/null
+++ b/validation/experiments/delta_flume/measured_summary.csv
@@ -0,0 +1,46 @@
+quantity,case,U,value
+max_cf_disp_D,1,0.16,0.756538
+max_cf_disp_D,2,0.21,0.578777
+max_cf_disp_D,3,0.309,0.779326
+max_cf_disp_D,4,0.406,0.673778
+max_cf_disp_D,5,0.545,0.842763
+max_cf_disp_D,6,0.605,0.709345
+max_cf_disp_D,7,0.703,0.777016
+max_cf_disp_D,8,0.854,0.906623
+max_cf_disp_D,9,0.951,1.07449
+max_il_mean_D,1,0.161,1.06132
+max_il_mean_D,2,0.211,1.1945
+max_il_mean_D,3,0.31,3.45051
+max_il_mean_D,4,0.407,4.97342
+max_il_mean_D,5,0.546,6.68884
+max_il_mean_D,6,0.606,8.1267
+max_il_mean_D,7,0.704,8.8987
+max_il_mean_D,8,0.855,11.1844
+max_il_mean_D,9,0.953,13.5076
+max_il_dyn_D,1,0.16,0.206466
+max_il_dyn_D,2,0.21,0.0979251
+max_il_dyn_D,3,0.309,0.29709
+max_il_dyn_D,4,0.406,0.243781
+max_il_dyn_D,5,0.545,0.186736
+max_il_dyn_D,6,0.605,0.305004
+max_il_dyn_D,7,0.703,0.16926
+max_il_dyn_D,8,0.854,0.359082
+max_il_dyn_D,9,0.951,0.485263
+std_curv_il_kD,1,0.16,5.04942e-05
+std_curv_il_kD,2,0.21,3.42471e-05
+std_curv_il_kD,3,0.309,0.000194713
+std_curv_il_kD,4,0.406,0.000268844
+std_curv_il_kD,5,0.545,0.000231251
+std_curv_il_kD,6,0.605,0.000457232
+std_curv_il_kD,7,0.703,0.00030285
+std_curv_il_kD,8,0.854,0.000448194
+std_curv_il_kD,9,0.951,0.000623852
+std_curv_cf_kD,1,0.16,9.26657e-05
+std_curv_cf_kD,2,0.21,8.859e-05
+std_curv_cf_kD,3,0.309,0.000270412
+std_curv_cf_kD,4,0.406,0.000317895
+std_curv_cf_kD,5,0.545,0.000480763
+std_curv_cf_kD,6,0.605,0.000477281
+std_curv_cf_kD,7,0.703,0.000647034
+std_curv_cf_kD,8,0.854,0.000688661
+std_curv_cf_kD,9,0.951,0.000735512
diff --git a/validation/experiments/delta_flume/provenance.json b/validation/experiments/delta_flume/provenance.json
new file mode 100644
index 00000000..c86d40f1
--- /dev/null
+++ b/validation/experiments/delta_flume/provenance.json
@@ -0,0 +1,335 @@
+{
+ "source": "Chaplin, Bearman, Huera Huarte & Pattenden (2005a), Journal of Fluids and Structures 21(1), 3-24 (the riser, Sec. 2; the drag amplification, Eq. 4); Chaplin, Bearman, Cheng, Fontaine, Graham, Herfjord, Huera Huarte, Isherwood, Lambrakos, Larsen, Meneghini, Moe, Pattenden, Triantafyllou & Willden (2005b), Journal of Fluids and Structures 21(1), 25-40 (the blind-trial cases); the authors' presentation of the blind trial, 'Blind predictions of laboratory measurements of vortex-induced vibrations of a tension riser', Trondheim, October 2004 (the measured results); the project's pages at the University of Southampton, archived by the Internet Archive (mechanical properties, current zone)",
+ "doi": [
+ "10.1016/j.jfluidstructs.2005.04.010",
+ "10.1016/j.jfluidstructs.2005.05.016"
+ ],
+ "archived_pages": [
+ "https://web.archive.org/web/20041103155158/http://www.civil.soton.ac.uk:80/hydraulics/riser/mechanical%20properties(1).htm",
+ "https://web.archive.org/web/20041103154947/http://www.civil.soton.ac.uk:80/hydraulics/riser/benchmarking%20cases(1).htm"
+ ],
+ "data_used": "riser: L 13.12 m between pinned joints, D 28 mm, EI 29.9 N m^2, mass ratio 3.0 with the internal water (paper; the page gives 1.85 kg/m), EA 5.88 MN, structural damping 0.33 % of critical, top spring 11.4 kN/m (page); the lower 5.94 m in the current (page); slide 3: towing speeds and mean top tensions of cases 1-9; slides 7-15: the measured envelopes along the riser (envelopes/); slides 17-19: the measured maximum cross-flow displacement, maximum mean and dynamic in-line displacement and overall standard deviations of curvature (measured_summary.csv); slide 23: the measured dominant cross-flow mode numbers",
+ "extraction": "the slides are vector graphics: the measured points (filled circles of the measurement colour) and curves (polylines of 102 nearly equally spaced vertices along the riser, resampled to 101 equally spaced stations) are read as plotted coordinates and mapped linearly through the panel tick labels; the recovered towing speeds match slide 3 within 0.006 m/s; the envelope maxima of the mean in-line displacement match slide 17 within 0.05 D",
+ "assumptions": "fresh water, Ca 1 (as L3-C); the 11.4 kN/m top spring of the two the page lists; the structural damping as bending damping of a pure bending mode at 2 Hz; the static top tension in the current (drag unamplified) set to the measured mean; the curvature panels of slides 7-15 have no scale, so each envelope curvature shape is scaled so that its r.m.s. over the stations equals the slide-19 overall standard deviation",
+ "coefficients": "generic, not fitted to these measurements: Cl 0.8, cF 0.18, dF 0.08; in-line ClX 0.85, alpha 0.15 (Ulveseter et al. 2018); Cd 1.2; VIV AMPLITUDE Cv 0.8 constant with CdAmp = 1 + 2.3 s + 1.7 s^2, s = (A/D)/sqrt(2) (Chaplin et al. 2005a, Eq. 4); VIV DAMPING 0 0 1 (the amplification on the in-line drag only)",
+ "CableDyn_commit": "041337e (dev) with the mid-point VIV phase update (fix/viv-coupled-order)",
+ "validation_date": "2026-11-16",
+ "executable_name": "cabledyn.exe",
+ "executable_sha256": "see summary.json",
+ "compiler": "GNU Fortran 16.2.0",
+ "build_type": "Release",
+ "platform": "Windows 11 x86-64",
+ "segments": 64,
+ "dt_s": "per case, the largest of 0.005, 0.0025, 0.002, 0.001, 0.0005 at or below 1/200 of D/(0.18 U)",
+ "sensitivity": {
+ "dt_half": {
+ "1": {
+ "mode": 2,
+ "f_cf_hz": 0.92,
+ "max_cf_half_pp_D": 0.6535,
+ "max_il_mean_D": 1.19,
+ "std_curv_cf_kD": 5.6569e-05,
+ "std_curv_il_kD": 3.5342e-05,
+ "mean_top_tension_N": 408.5
+ },
+ "2": {
+ "mode": 3,
+ "f_cf_hz": 1.36,
+ "max_cf_half_pp_D": 0.6072,
+ "max_il_mean_D": 1.602,
+ "std_curv_cf_kD": 0.00011154,
+ "std_curv_il_kD": 7.2075e-05,
+ "mean_top_tension_N": 412.8
+ },
+ "3": {
+ "mode": 4,
+ "f_cf_hz": 2.0,
+ "max_cf_half_pp_D": 0.6299,
+ "max_il_mean_D": 3.265,
+ "std_curv_cf_kD": 0.00020482,
+ "std_curv_il_kD": 9.2011e-05,
+ "mean_top_tension_N": 475.5
+ },
+ "4": {
+ "mode": 4,
+ "f_cf_hz": 2.24,
+ "max_cf_half_pp_D": 0.6829,
+ "max_il_mean_D": 4.782,
+ "std_curv_cf_kD": 0.00022942,
+ "std_curv_il_kD": 0.00013668,
+ "mean_top_tension_N": 541.4
+ },
+ "5": {
+ "mode": 6,
+ "f_cf_hz": 3.68,
+ "max_cf_half_pp_D": 0.6622,
+ "max_il_mean_D": 6.309,
+ "std_curv_cf_kD": 0.00041604,
+ "std_curv_il_kD": 0.00024332,
+ "mean_top_tension_N": 653.9
+ },
+ "6": {
+ "mode": 6,
+ "f_cf_hz": 3.92,
+ "max_cf_half_pp_D": 0.6018,
+ "max_il_mean_D": 6.841,
+ "std_curv_cf_kD": 0.00044566,
+ "std_curv_il_kD": 0.00024711,
+ "mean_top_tension_N": 735.6
+ },
+ "7": {
+ "mode": 6,
+ "f_cf_hz": 4.24,
+ "max_cf_half_pp_D": 0.726,
+ "max_il_mean_D": 8.302,
+ "std_curv_cf_kD": 0.000466,
+ "std_curv_il_kD": 0.0002655,
+ "mean_top_tension_N": 835.6
+ },
+ "8": {
+ "mode": 6,
+ "f_cf_hz": 4.8,
+ "max_cf_half_pp_D": 0.7893,
+ "max_il_mean_D": 9.645,
+ "std_curv_cf_kD": 0.00049194,
+ "std_curv_il_kD": 0.00027017,
+ "mean_top_tension_N": 1045.2
+ },
+ "9": {
+ "mode": 7,
+ "f_cf_hz": 5.8,
+ "max_cf_half_pp_D": 0.7513,
+ "max_il_mean_D": 10.675,
+ "std_curv_cf_kD": 0.00064805,
+ "std_curv_il_kD": 0.00030531,
+ "mean_top_tension_N": 1147.4
+ }
+ },
+ "segments_128": {
+ "1": {
+ "mode": 2,
+ "f_cf_hz": 0.92,
+ "max_cf_half_pp_D": 0.6533,
+ "max_il_mean_D": 1.203,
+ "std_curv_cf_kD": 5.6652e-05,
+ "std_curv_il_kD": 3.5525e-05,
+ "mean_top_tension_N": 408.6
+ },
+ "2": {
+ "mode": 3,
+ "f_cf_hz": 1.36,
+ "max_cf_half_pp_D": 0.596,
+ "max_il_mean_D": 1.636,
+ "std_curv_cf_kD": 0.00011273,
+ "std_curv_il_kD": 7.3035e-05,
+ "mean_top_tension_N": 413.0
+ },
+ "3": {
+ "mode": 4,
+ "f_cf_hz": 2.0,
+ "max_cf_half_pp_D": 0.626,
+ "max_il_mean_D": 3.317,
+ "std_curv_cf_kD": 0.00020668,
+ "std_curv_il_kD": 9.449e-05,
+ "mean_top_tension_N": 476.0
+ },
+ "4": {
+ "mode": 4,
+ "f_cf_hz": 2.24,
+ "max_cf_half_pp_D": 0.6581,
+ "max_il_mean_D": 4.862,
+ "std_curv_cf_kD": 0.00023173,
+ "std_curv_il_kD": 0.00014027,
+ "mean_top_tension_N": 542.5
+ },
+ "5": {
+ "mode": 6,
+ "f_cf_hz": 3.68,
+ "max_cf_half_pp_D": 0.6618,
+ "max_il_mean_D": 6.412,
+ "std_curv_cf_kD": 0.00042566,
+ "std_curv_il_kD": 0.00025004,
+ "mean_top_tension_N": 655.8
+ },
+ "6": {
+ "mode": 6,
+ "f_cf_hz": 3.92,
+ "max_cf_half_pp_D": 0.588,
+ "max_il_mean_D": 6.938,
+ "std_curv_cf_kD": 0.0004522,
+ "std_curv_il_kD": 0.00025942,
+ "mean_top_tension_N": 737.3
+ },
+ "7": {
+ "mode": 6,
+ "f_cf_hz": 4.24,
+ "max_cf_half_pp_D": 0.7051,
+ "max_il_mean_D": 8.469,
+ "std_curv_cf_kD": 0.00047584,
+ "std_curv_il_kD": 0.00027317,
+ "mean_top_tension_N": 839.8
+ },
+ "8": {
+ "mode": 6,
+ "f_cf_hz": 4.84,
+ "max_cf_half_pp_D": 0.723,
+ "max_il_mean_D": 9.789,
+ "std_curv_cf_kD": 0.00049747,
+ "std_curv_il_kD": 0.00031993,
+ "mean_top_tension_N": 1049.4
+ },
+ "9": {
+ "mode": 8,
+ "f_cf_hz": 6.64,
+ "max_cf_half_pp_D": 0.5999,
+ "max_il_mean_D": 10.343,
+ "std_curv_cf_kD": 0.00070879,
+ "std_curv_il_kD": 0.00038944,
+ "mean_top_tension_N": 1133.7
+ }
+ },
+ "tmax_80_s_cases_5_9": {
+ "5": {
+ "mode": 6,
+ "f_cf_hz": 3.692,
+ "max_cf_half_pp_D": 0.6748,
+ "max_il_mean_D": 6.428,
+ "std_curv_cf_kD": 0.0004324,
+ "std_curv_il_kD": 0.00022074,
+ "mean_top_tension_N": 657.0
+ },
+ "9": {
+ "mode": 8,
+ "f_cf_hz": 6.615,
+ "max_cf_half_pp_D": 0.6148,
+ "max_il_mean_D": 10.151,
+ "std_curv_cf_kD": 0.00068681,
+ "std_curv_il_kD": 0.00036845,
+ "mean_top_tension_N": 1127.9
+ }
+ },
+ "tmax_80_s_cases_6_8": {
+ "6": {
+ "mode": 6,
+ "f_cf_hz": 3.908,
+ "max_cf_half_pp_D": 0.6792,
+ "max_il_mean_D": 6.859,
+ "std_curv_cf_kD": 0.00044732,
+ "std_curv_il_kD": 0.0002437,
+ "mean_top_tension_N": 736.0
+ },
+ "8": {
+ "mode": 6,
+ "f_cf_hz": 4.8,
+ "max_cf_half_pp_D": 0.7821,
+ "max_il_mean_D": 9.644,
+ "std_curv_cf_kD": 0.00049169,
+ "std_curv_il_kD": 0.00027079,
+ "mean_top_tension_N": 1045.2
+ }
+ },
+ "tmax_80_s_dt_half_cases_6_8": {
+ "6": {
+ "mode": 6,
+ "f_cf_hz": 3.908,
+ "max_cf_half_pp_D": 0.6042,
+ "max_il_mean_D": 6.829,
+ "std_curv_cf_kD": 0.00044457,
+ "std_curv_il_kD": 0.00024848,
+ "mean_top_tension_N": 735.2
+ },
+ "8": {
+ "mode": 6,
+ "f_cf_hz": 4.8,
+ "max_cf_half_pp_D": 0.7893,
+ "max_il_mean_D": 9.633,
+ "std_curv_cf_kD": 0.00049061,
+ "std_curv_il_kD": 0.00027237,
+ "mean_top_tension_N": 1044.8
+ }
+ },
+ "top_spring_38p1_kN_per_m": {
+ "1": {
+ "mode": 2,
+ "f_cf_hz": 0.92,
+ "max_cf_half_pp_D": 0.6492,
+ "max_il_mean_D": 1.161,
+ "std_curv_cf_kD": 5.6423e-05,
+ "std_curv_il_kD": 3.4946e-05,
+ "mean_top_tension_N": 415.7
+ },
+ "2": {
+ "mode": 3,
+ "f_cf_hz": 1.4,
+ "max_cf_half_pp_D": 0.6099,
+ "max_il_mean_D": 1.532,
+ "std_curv_cf_kD": 0.00010957,
+ "std_curv_il_kD": 7.2268e-05,
+ "mean_top_tension_N": 423.7
+ },
+ "3": {
+ "mode": 4,
+ "f_cf_hz": 2.08,
+ "max_cf_half_pp_D": 0.6112,
+ "max_il_mean_D": 2.984,
+ "std_curv_cf_kD": 0.00019718,
+ "std_curv_il_kD": 9.1364e-05,
+ "mean_top_tension_N": 504.3
+ },
+ "4": {
+ "mode": 4,
+ "f_cf_hz": 2.32,
+ "max_cf_half_pp_D": 0.6729,
+ "max_il_mean_D": 4.292,
+ "std_curv_cf_kD": 0.00023152,
+ "std_curv_il_kD": 0.00012869,
+ "mean_top_tension_N": 591.4
+ },
+ "5": {
+ "mode": 5,
+ "f_cf_hz": 3.24,
+ "max_cf_half_pp_D": 0.7171,
+ "max_il_mean_D": 5.649,
+ "std_curv_cf_kD": 0.00033914,
+ "std_curv_il_kD": 0.0001492,
+ "mean_top_tension_N": 726.0
+ },
+ "6": {
+ "mode": 6,
+ "f_cf_hz": 4.04,
+ "max_cf_half_pp_D": 0.5776,
+ "max_il_mean_D": 5.785,
+ "std_curv_cf_kD": 0.00039448,
+ "std_curv_il_kD": 0.00028874,
+ "mean_top_tension_N": 795.1
+ },
+ "7": {
+ "mode": 6,
+ "f_cf_hz": 4.48,
+ "max_cf_half_pp_D": 0.6833,
+ "max_il_mean_D": 7.188,
+ "std_curv_cf_kD": 0.0004468,
+ "std_curv_il_kD": 0.00025551,
+ "mean_top_tension_N": 934.6
+ },
+ "8": {
+ "mode": 5,
+ "f_cf_hz": 4.32,
+ "max_cf_half_pp_D": 0.7426,
+ "max_il_mean_D": 8.509,
+ "std_curv_cf_kD": 0.00040291,
+ "std_curv_il_kD": 0.00021742,
+ "mean_top_tension_N": 1187.7
+ },
+ "9": {
+ "mode": 7,
+ "f_cf_hz": 6.16,
+ "max_cf_half_pp_D": 0.7124,
+ "max_il_mean_D": 9.131,
+ "std_curv_cf_kD": 0.0006037,
+ "std_curv_il_kD": 0.00026373,
+ "mean_top_tension_N": 1284.3
+ }
+ }
+ }
+}
diff --git a/validation/experiments/delta_flume/response_comparison.csv b/validation/experiments/delta_flume/response_comparison.csv
new file mode 100644
index 00000000..f391228b
--- /dev/null
+++ b/validation/experiments/delta_flume/response_comparison.csv
@@ -0,0 +1,10 @@
+case,U_m_per_s,top_tension_N,dt_s,mode_measured,mode_cabledyn,f_cf_cabledyn_hz,max_cf_D_measured,max_cf_half_pp_D_measured_envelope,max_cf_half_pp_D_cabledyn,max_cf_error_percent,max_cf_envelope_error_percent,max_il_mean_D_measured,max_il_mean_D_cabledyn,max_il_mean_error_percent,std_curv_cf_kD_measured,std_curv_cf_kD_cabledyn,std_curv_cf_error_percent,std_curv_il_kD_measured,std_curv_il_kD_cabledyn,std_curv_il_error_percent,mean_top_tension_N_cabledyn
+1,0.16,405.0,0.0025,2,2,0.92,0.7565,0.7632,0.6534,-13.6,-14.4,1.061,1.19,12.1,9.2666e-05,5.6583e-05,-38.9,5.0494e-05,3.5349e-05,-30.0,408.5
+2,0.21,407.0,0.0025,3,3,1.36,0.5788,0.5612,0.6018,4.0,7.2,1.194,1.602,34.1,8.8590e-05,1.1148e-04,25.8,3.4247e-05,7.2081e-05,110.5,412.8
+3,0.31,457.0,0.0025,4,4,2.0,0.7793,0.8089,0.6282,-19.4,-22.3,3.451,3.265,-5.4,2.7041e-04,2.0469e-04,-24.3,1.9471e-04,9.1770e-05,-52.9,475.5
+4,0.4,506.0,0.001,5,4,2.24,0.6738,0.5948,0.6997,3.8,17.6,4.973,4.784,-3.8,3.1790e-04,2.2964e-04,-27.8,2.6884e-04,1.3606e-04,-49.4,541.4
+5,0.54,598.0,0.001,6,6,3.72,0.8428,0.8885,0.658,-21.9,-25.9,6.689,6.527,-2.4,4.8076e-04,4.4463e-04,-7.5,2.3125e-04,2.0013e-04,-13.5,659.6
+6,0.6,670.0,0.001,6,6,3.92,0.7093,0.7792,0.6792,-4.2,-12.8,8.127,6.935,-14.7,4.7728e-04,4.5466e-04,-4.7,4.5723e-04,2.3189e-04,-49.3,738.1
+7,0.7,743.0,0.001,7,6,4.24,0.777,0.717,0.7382,-5.0,3.0,8.899,8.279,-7.0,6.4703e-04,4.6324e-04,-28.4,3.0285e-04,2.6879e-04,-11.2,834.8
+8,0.85,923.0,0.0005,7,6,4.8,0.9066,0.8896,0.7685,-15.2,-13.6,11.184,9.658,-13.6,6.8866e-04,4.9356e-04,-28.3,4.4819e-04,2.6811e-04,-40.2,1045.7
+9,0.95,1002.0,0.0005,7,8,6.6,1.0745,0.9961,0.5945,-44.7,-40.3,13.508,10.151,-24.9,7.3551e-04,6.8680e-04,-6.6,6.2385e-04,3.6721e-04,-41.1,1127.9
diff --git a/validation/experiments/delta_flume/summary.json b/validation/experiments/delta_flume/summary.json
new file mode 100644
index 00000000..2a0e5ef7
--- /dev/null
+++ b/validation/experiments/delta_flume/summary.json
@@ -0,0 +1,261 @@
+{
+ "cases": [
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "segments": 64,
+ "dt_scale": 1.0,
+ "tmax_s": 40.0,
+ "statistics_after_s": 15.0,
+ "top_spring_N_per_m": 11400.0,
+ "effective_axial_stiffness_N": 145857.9,
+ "modes_right": 5,
+ "modes_within_one": 9,
+ "il_mean_within_17_percent": 7,
+ "il_mean_error_percent_range": [
+ -24.9,
+ 34.1
+ ],
+ "max_cf_error_percent_range": [
+ -44.7,
+ 4.0
+ ],
+ "max_cf_envelope_error_percent_range": [
+ -40.3,
+ 17.6
+ ],
+ "std_curv_cf_error_percent_range": [
+ -38.9,
+ 25.8
+ ],
+ "std_curv_il_error_percent_range": [
+ -52.9,
+ 110.5
+ ],
+ "per_case": [
+ {
+ "case": 1,
+ "U_m_per_s": 0.16,
+ "top_tension_N": 405.0,
+ "dt_s": 0.0025,
+ "mode_measured": 2,
+ "mode_cabledyn": 2,
+ "f_cf_cabledyn_hz": 0.92,
+ "max_cf_D_measured": 0.7565,
+ "max_cf_half_pp_D_measured_envelope": 0.7632,
+ "max_cf_half_pp_D_cabledyn": 0.6534,
+ "max_cf_error_percent": -13.6,
+ "max_cf_envelope_error_percent": -14.4,
+ "max_il_mean_D_measured": 1.061,
+ "max_il_mean_D_cabledyn": 1.19,
+ "max_il_mean_error_percent": 12.1,
+ "std_curv_cf_kD_measured": "9.2666e-05",
+ "std_curv_cf_kD_cabledyn": "5.6583e-05",
+ "std_curv_cf_error_percent": -38.9,
+ "std_curv_il_kD_measured": "5.0494e-05",
+ "std_curv_il_kD_cabledyn": "3.5349e-05",
+ "std_curv_il_error_percent": -30.0,
+ "mean_top_tension_N_cabledyn": 408.5
+ },
+ {
+ "case": 2,
+ "U_m_per_s": 0.21,
+ "top_tension_N": 407.0,
+ "dt_s": 0.0025,
+ "mode_measured": 3,
+ "mode_cabledyn": 3,
+ "f_cf_cabledyn_hz": 1.36,
+ "max_cf_D_measured": 0.5788,
+ "max_cf_half_pp_D_measured_envelope": 0.5612,
+ "max_cf_half_pp_D_cabledyn": 0.6018,
+ "max_cf_error_percent": 4.0,
+ "max_cf_envelope_error_percent": 7.2,
+ "max_il_mean_D_measured": 1.194,
+ "max_il_mean_D_cabledyn": 1.602,
+ "max_il_mean_error_percent": 34.1,
+ "std_curv_cf_kD_measured": "8.8590e-05",
+ "std_curv_cf_kD_cabledyn": "1.1148e-04",
+ "std_curv_cf_error_percent": 25.8,
+ "std_curv_il_kD_measured": "3.4247e-05",
+ "std_curv_il_kD_cabledyn": "7.2081e-05",
+ "std_curv_il_error_percent": 110.5,
+ "mean_top_tension_N_cabledyn": 412.8
+ },
+ {
+ "case": 3,
+ "U_m_per_s": 0.31,
+ "top_tension_N": 457.0,
+ "dt_s": 0.0025,
+ "mode_measured": 4,
+ "mode_cabledyn": 4,
+ "f_cf_cabledyn_hz": 2.0,
+ "max_cf_D_measured": 0.7793,
+ "max_cf_half_pp_D_measured_envelope": 0.8089,
+ "max_cf_half_pp_D_cabledyn": 0.6282,
+ "max_cf_error_percent": -19.4,
+ "max_cf_envelope_error_percent": -22.3,
+ "max_il_mean_D_measured": 3.451,
+ "max_il_mean_D_cabledyn": 3.265,
+ "max_il_mean_error_percent": -5.4,
+ "std_curv_cf_kD_measured": "2.7041e-04",
+ "std_curv_cf_kD_cabledyn": "2.0469e-04",
+ "std_curv_cf_error_percent": -24.3,
+ "std_curv_il_kD_measured": "1.9471e-04",
+ "std_curv_il_kD_cabledyn": "9.1770e-05",
+ "std_curv_il_error_percent": -52.9,
+ "mean_top_tension_N_cabledyn": 475.5
+ },
+ {
+ "case": 4,
+ "U_m_per_s": 0.4,
+ "top_tension_N": 506.0,
+ "dt_s": 0.001,
+ "mode_measured": 5,
+ "mode_cabledyn": 4,
+ "f_cf_cabledyn_hz": 2.24,
+ "max_cf_D_measured": 0.6738,
+ "max_cf_half_pp_D_measured_envelope": 0.5948,
+ "max_cf_half_pp_D_cabledyn": 0.6997,
+ "max_cf_error_percent": 3.8,
+ "max_cf_envelope_error_percent": 17.6,
+ "max_il_mean_D_measured": 4.973,
+ "max_il_mean_D_cabledyn": 4.784,
+ "max_il_mean_error_percent": -3.8,
+ "std_curv_cf_kD_measured": "3.1790e-04",
+ "std_curv_cf_kD_cabledyn": "2.2964e-04",
+ "std_curv_cf_error_percent": -27.8,
+ "std_curv_il_kD_measured": "2.6884e-04",
+ "std_curv_il_kD_cabledyn": "1.3606e-04",
+ "std_curv_il_error_percent": -49.4,
+ "mean_top_tension_N_cabledyn": 541.4
+ },
+ {
+ "case": 5,
+ "U_m_per_s": 0.54,
+ "top_tension_N": 598.0,
+ "dt_s": 0.001,
+ "mode_measured": 6,
+ "mode_cabledyn": 6,
+ "f_cf_cabledyn_hz": 3.72,
+ "max_cf_D_measured": 0.8428,
+ "max_cf_half_pp_D_measured_envelope": 0.8885,
+ "max_cf_half_pp_D_cabledyn": 0.658,
+ "max_cf_error_percent": -21.9,
+ "max_cf_envelope_error_percent": -25.9,
+ "max_il_mean_D_measured": 6.689,
+ "max_il_mean_D_cabledyn": 6.527,
+ "max_il_mean_error_percent": -2.4,
+ "std_curv_cf_kD_measured": "4.8076e-04",
+ "std_curv_cf_kD_cabledyn": "4.4463e-04",
+ "std_curv_cf_error_percent": -7.5,
+ "std_curv_il_kD_measured": "2.3125e-04",
+ "std_curv_il_kD_cabledyn": "2.0013e-04",
+ "std_curv_il_error_percent": -13.5,
+ "mean_top_tension_N_cabledyn": 659.6
+ },
+ {
+ "case": 6,
+ "U_m_per_s": 0.6,
+ "top_tension_N": 670.0,
+ "dt_s": 0.001,
+ "mode_measured": 6,
+ "mode_cabledyn": 6,
+ "f_cf_cabledyn_hz": 3.92,
+ "max_cf_D_measured": 0.7093,
+ "max_cf_half_pp_D_measured_envelope": 0.7792,
+ "max_cf_half_pp_D_cabledyn": 0.6792,
+ "max_cf_error_percent": -4.2,
+ "max_cf_envelope_error_percent": -12.8,
+ "max_il_mean_D_measured": 8.127,
+ "max_il_mean_D_cabledyn": 6.935,
+ "max_il_mean_error_percent": -14.7,
+ "std_curv_cf_kD_measured": "4.7728e-04",
+ "std_curv_cf_kD_cabledyn": "4.5466e-04",
+ "std_curv_cf_error_percent": -4.7,
+ "std_curv_il_kD_measured": "4.5723e-04",
+ "std_curv_il_kD_cabledyn": "2.3189e-04",
+ "std_curv_il_error_percent": -49.3,
+ "mean_top_tension_N_cabledyn": 738.1
+ },
+ {
+ "case": 7,
+ "U_m_per_s": 0.7,
+ "top_tension_N": 743.0,
+ "dt_s": 0.001,
+ "mode_measured": 7,
+ "mode_cabledyn": 6,
+ "f_cf_cabledyn_hz": 4.24,
+ "max_cf_D_measured": 0.777,
+ "max_cf_half_pp_D_measured_envelope": 0.717,
+ "max_cf_half_pp_D_cabledyn": 0.7382,
+ "max_cf_error_percent": -5.0,
+ "max_cf_envelope_error_percent": 3.0,
+ "max_il_mean_D_measured": 8.899,
+ "max_il_mean_D_cabledyn": 8.279,
+ "max_il_mean_error_percent": -7.0,
+ "std_curv_cf_kD_measured": "6.4703e-04",
+ "std_curv_cf_kD_cabledyn": "4.6324e-04",
+ "std_curv_cf_error_percent": -28.4,
+ "std_curv_il_kD_measured": "3.0285e-04",
+ "std_curv_il_kD_cabledyn": "2.6879e-04",
+ "std_curv_il_error_percent": -11.2,
+ "mean_top_tension_N_cabledyn": 834.8
+ },
+ {
+ "case": 8,
+ "U_m_per_s": 0.85,
+ "top_tension_N": 923.0,
+ "dt_s": 0.0005,
+ "mode_measured": 7,
+ "mode_cabledyn": 6,
+ "f_cf_cabledyn_hz": 4.8,
+ "max_cf_D_measured": 0.9066,
+ "max_cf_half_pp_D_measured_envelope": 0.8896,
+ "max_cf_half_pp_D_cabledyn": 0.7685,
+ "max_cf_error_percent": -15.2,
+ "max_cf_envelope_error_percent": -13.6,
+ "max_il_mean_D_measured": 11.184,
+ "max_il_mean_D_cabledyn": 9.658,
+ "max_il_mean_error_percent": -13.6,
+ "std_curv_cf_kD_measured": "6.8866e-04",
+ "std_curv_cf_kD_cabledyn": "4.9356e-04",
+ "std_curv_cf_error_percent": -28.3,
+ "std_curv_il_kD_measured": "4.4819e-04",
+ "std_curv_il_kD_cabledyn": "2.6811e-04",
+ "std_curv_il_error_percent": -40.2,
+ "mean_top_tension_N_cabledyn": 1045.7
+ },
+ {
+ "case": 9,
+ "U_m_per_s": 0.95,
+ "top_tension_N": 1002.0,
+ "dt_s": 0.0005,
+ "mode_measured": 7,
+ "mode_cabledyn": 8,
+ "f_cf_cabledyn_hz": 6.6,
+ "max_cf_D_measured": 1.0745,
+ "max_cf_half_pp_D_measured_envelope": 0.9961,
+ "max_cf_half_pp_D_cabledyn": 0.5945,
+ "max_cf_error_percent": -44.7,
+ "max_cf_envelope_error_percent": -40.3,
+ "max_il_mean_D_measured": 13.508,
+ "max_il_mean_D_cabledyn": 10.151,
+ "max_il_mean_error_percent": -24.9,
+ "std_curv_cf_kD_measured": "7.3551e-04",
+ "std_curv_cf_kD_cabledyn": "6.8680e-04",
+ "std_curv_cf_error_percent": -6.6,
+ "std_curv_il_kD_measured": "6.2385e-04",
+ "std_curv_il_kD_cabledyn": "3.6721e-04",
+ "std_curv_il_error_percent": -41.1,
+ "mean_top_tension_N_cabledyn": 1127.9
+ }
+ ],
+ "executable_sha256": "790c034e908a795af84e678c36c51cfa35df8ac1136a7d1f93f02bcdb1a5bf1b"
+}
diff --git a/validation/experiments/flotant/README.md b/validation/experiments/flotant/README.md
new file mode 100644
index 00000000..439e8d59
--- /dev/null
+++ b/validation/experiments/flotant/README.md
@@ -0,0 +1,341 @@
+
+
+# FLOTANT OD 48 mm research cable: VIV in tow tests
+
+This directory compares CableDyn with the tests of a power-cable specimen at MARIN for the EU
+project FLOTANT: de Wilde, Heijnsdijk & de Ridder (2021), Deliverable D5.5, MARIN report
+30995-53-DWB, a public deliverable without a DOI,
+. A 6.4 m
+cable of 48 mm outer diameter, a simplified 1:3 model of a 66 kV inter-array cable, hung
+vertically from the towing carriage with a 200 kg clump weight below it and was towed at 40
+speeds from 0.025 to 1.0 m/s. The report gives the cross-flow and in-line A/D_rms at three
+stations against the reduced velocity. The same specimen was forced by a hexapod in air and in
+water, and those RAOs are used here to set up and check the structural model.
+
+The tow tests are predicted with three published VIV coefficient sets, none of them fitted to
+these tests. The structure is identified from the forced-oscillation tests of the same specimen
+only, never from the tow data.
+
+In short: on the identified structure the set of Ulveseter et al. (2019), fitted by them to
+another riser, gives the height of the first cross-flow peak at mid-length (0.755 against
+0.776), but it responds from a lower speed, holds the lock-in 1.2 Ur longer than the test and
+stays high over the upper branch. The generic set is 38 % low at the peak and releases at the
+measured speed; the wake oscillator is 62 % low. The r.m.s. log errors over the three stations
+are 0.73, 0.59 and 1.21, large for all three sets.
+
+## The test (D5.5)
+
+- **Specimen (Table 2-1):** OD 48 mm, 6.4 m, 2.8 kg/m; 9.7 N/m in water (Table 2-2).
+- **Set-up in water (Secs. 2.4, 2.5):** from the top, the carriage (or the hexapod), a
+ six-component force frame, a Cardan joint, the cable, a Cardan joint, a swivel, a load cell
+ and the clump weight. Tension 1970 N at the top and 1436 N at the bottom (Table 6-1).
+- **Instrumentation (Sec. 3):** accelerometers at 1/2L, 3/4L and L from the top of the cable
+ (L is its lower end). The motions are the accelerations integrated twice, high-passed at
+ 3.5 rad/s for the tow tests (Table 3-4).
+- **A/D (Sec. 3.4.4):** Appendix 3 plots the standard-deviation A/D, A/D_rms = σ/OD (p. 53:
+ "The presented results are for standard deviation A/Drms"); the nominal A/D is √2 σ/OD. The
+ first peak is A/D_rms 0.78 (nominal 1.10) at Ur 5.7.
+- **Ur (Secs. 3.4.3, 6.3):** Ur = V/(OD f1) with f1 = 1.77 Hz.
+- **Tow tests (Table 6-2):** one test per speed, 0.025 m/s apart, the towing direction
+ alternating from 0.15 m/s on (forwards at odd multiples of 0.025 m/s from there, backwards at
+ even ones). Each test is analysed over its steady part, 37.5 s at 1.0 m/s up to 580 s at
+ 0.025 m/s.
+
+### Caveats of the data
+
+- **The Ur basis.** Ur uses f1 = 1.77 Hz, while Sec. 5.3 calls the 1.3 Hz peak of the in-water
+ RAOs the first mode. The origin of 1.77 Hz is not given. On a 1.3 Hz basis every Ur would be
+ 1.36 times larger. The comparison here is made at the tested speeds, so the basis only
+ labels the axis; all Ur values here are on the report's 1.77 Hz basis.
+- **The bottom tension.** Table 6-1 gives 1436 N at the bottom, while the in-water FEM table of
+ Sec. 5.4 gives 1687–1702 N along the chain above the clump, whose submerged weight it gives as
+ 1710.5 N. The cable's own wet weight (about 62 N) cannot explain a 534 N difference
+ between top and bottom. The model takes the FEM table; its static top tension is in the
+ results.
+- **Towing direction.** Speed and direction are confounded (one test per speed). Between Ur 5.8
+ and 9.2 the backward tests are mostly lower than the forward tests at the neighbouring speeds
+ (at 1/2L, 0.30–0.46 against 0.42–0.56). The report attributes small differences to the coil
+ curvature the specimen kept. The model is symmetric; the statistics are given over all tests
+ and per direction.
+- **Displacements from accelerometers.** The accelerometers tilt with the cable, so the
+ derived displacement holds a gravity term g θ/ω² (θ the slope of the cable), which the
+ report does not remove. The model output is processed the same way (below); without the term
+ the cross-flow A/D_rms of the three sets changes by up to 5 % at 1/2L, 8 % at 3/4L and
+ 25 % at L for Ur ≥ 3, and the r.m.s. log errors by at most 0.07.
+- **Not reported:** response frequencies (only the acceleration orbits of one test, Fig. 6-1),
+ repeat tests and uncertainties.
+
+## Model
+
+### Structure
+
+The line follows the report's node-by-node FEM input tables (Sec. 4.5 in air, Sec. 5.4 in
+water; `fem_air.csv`, `fem_water.csv`): 101 nodes 0.0765 m apart, with the lumped masses, the
+weights and the static tensions. Each table element is one CableDyn element (`--refine N`
+splits it into N), grouped into runs by the label of its lower node: steel links (EI 1e6 N m²,
+rigid next to the cable), Cardan joints and the wire (EI 1 N m², hinges) and the cable.
+
+- **Water:** fresh, 1000 kg/m³. The report does not state it; the 2.8 kg/m and 9.7 N/m of
+ Table 2-2 at OD 48 mm imply 1000 kg/m³. The cable's diameter is the OD; the other parts take
+ the diameter of the displaced volume of their weight in the table.
+- **Axial compliance:** the counterweight (air) or clump (water) keeps the tension nearly
+ constant. The model uses an axial spring k_ax = 20 kN/m in series with the table's EA, as
+ EA_eff = L/(1/k_ax + L/EA), with the unstretched lengths set so that the static tensions are
+ the table's.
+
+What the tests do not give, and how it was identified:
+
+- **Cable bending stiffness and damping, from the in-air RAOs (Appendix 1, 200 kg).** EI is not
+ measured: the tables' EI = 3.0 kN m² reproduces the in-air resonance (10.7 rad/s) only with
+ an empirical factor λ = 1.10 that MARIN introduced in the tensioned-beam formula to match it
+ (Sec. 4.5). The 2.8 % damping ratio of Sec. 4.4 is a single-degree-of-freedom fit, with an
+ assumed participation factor of 0.5, to one peak. Here a linear section was identified on a grid
+ of EI and the bending damping Bb (the `EI|Bb` form of the LINE TYPES EI column) against the
+ surge RAOs at 5 and 10 mm: EI near 1500 N m² puts the resonance at the measured frequency
+ (3000 puts it 5–6 % high), and the 10 mm peak needs a larger Bb than the 5 mm one (about 160
+ against 110 N m² s): the peak falls with amplitude faster than a linear section can follow,
+ as the report notes. The model takes EI 1650 N m² and Bb 130 N m² s, between the two. The ends of the in-air rig are Cardan
+ joints, a swivel and a pulley, whose friction is in the measured loss: Bb is an upper bound
+ for the cable's own damping.
+- **The lower end in water, from the in-water RAOs (Appendix 2, 200 kg, 5 mm, 1.0–3.0 Hz).**
+ The measured RAO has two peaks at 1/2L, at 1.3 and 1.8 Hz, with a notch at 1.5–1.6 Hz;
+ at 1.8 Hz station L moves little (surge 0.55 against 4.40 at 1/2L). MARIN's FEM table fixes the clump node and makes
+ the chain rigid (`--end table`); that model, and the same with the clump as a free point mass
+ (`--end free`, a `Free` End B), have one peak near 1.2–1.3 Hz. The model used here
+ (`--end identified`) has two elements below the cable that the tests point to, identified on
+ grids against the surge and sway RAOs over 1.0–3.0 Hz (run with sea-water density; the check
+ below, at 1000 kg/m³, gives the scores of this model):
+ - the link chain and its load cell bend with EI 100 N m² (best on surge; 250 N m² on
+ sway), neither a hinge (EI 1, which gives a spurious mode with large motion at L at
+ 2.6–2.7 Hz) nor rigid;
+ - the clump (200 kg, its displaced volume, C_d A 0.05 m² assumed, C_a 1) is a point load on
+ a short rigid segment held laterally by a spring K = 32.5 kN/m and a damper 20 N s/m (the
+ best K on sway, the cross-flow direction of the tow tests; 30 kN/m on surge), modelled as a
+ clamped cantilever post, K = 3 EI_p/l³ (l = 0.3 m), from a still anchor.
+
+ This end is phenomenological: an impedance that reproduces the measured split of the first
+ mode, not a measured property of the rig. The damper hardly matters (1–80 N s/m changed the
+ RAO score by 0.004 in the identification grid). The clump's geometry and the chain are not described in the report.
+
+The RAO check (below) runs the model as identified. The line is axisymmetric, so one
+forcing direction stands for surge and sway.
+
+### Hydrodynamics
+
+Uniform current along x over the whole line (the carriage speed), cross-flow (CF) along y.
+C_D 1.2 and C_a 1 on the cable and the hardware. Three published VIV coefficient sets on the
+cable, `--sets`:
+
+| Set | Source | Values | Fitted to |
+| --- | --- | --- | --- |
+| `uls19` | Ulveseter et al. (2019), Table 1 and Sec. 4.1 | C_v,y 0.85, f̂0 0.144 ± 0.064, in-line C_v,x 0.75, α 0.15, C_hh 1.5, C_D 1.2, C_M 2 | the NDP 38 m riser in uniform flow: blind here |
+| `b1` | The generic set of the Delta Flume riser case | C_l 0.8, f̂0 0.18 ± 0.08; in-line C_x 0.85, α 0.15 (Ulveseter et al. 2018, Table 3); `VIV AMPLITUDE` C_v 0.8 with the drag amplification of Chaplin et al. (2005, Eq. 4); `VIV DAMPING` `0 0 1` | nothing from these tests: blind |
+| `wake` | Facchinetti et al. (2004) | `WAKE OSCILLATOR` C_L0 0.3, St 0.2, ε 0.3, A 12; Morison drag | rigid-cylinder lift and lock-in data: blind |
+
+The values were checked against the source articles.
+
+### Run and processing
+
+- dt 2 ms, 60 s, statistics over t > 20 s (frequency resolution 0.025 Hz). The tests' steady
+ windows are longer (37.5–580 s, Table 6-2).
+- **As the report processes the measurement:** each station's displacement plus the gravity
+ term of its tilted accelerometer, g θ/ω² (θ from the two neighbouring nodes), high-passed at
+ 3.5 rad/s, then A/D_rms = σ/OD. `response_comparison.csv` also holds the plain displacement
+ (`..._displacement`).
+- Ur = V/(OD f1) with f1 = 1.77 Hz.
+- The dominant CF frequency at 1/2L is the spectral peak of the high-passed displacement.
+- **Statistics:** the r.m.s. log error, √(mean (ln ratio)²), over the tests from the onset the
+ report states, Ur ≥ 3 (30 speeds, 0.275–1.0 m/s); CF and in line, per station and over all
+ three. The peak is the largest CF A/D_rms at 1/2L; the release is the first tested Ur above
+ the peak where it falls below 70 % of the peak.
+- **RAOs:** a harmonic at the forcing frequency fitted over the last 10 s of each forced run
+ (5 periods of cosine ramp, then 25 s), of the displacement plus the tilt term, over the
+ hexapod amplitude; scored as the r.m.s. log error over the stations, in air over the resonance
+ band 1.4–2.0 Hz (1/8L, 1/4L, 1/2L, 3/4L from the bottom), in water over 1.0–3.0 Hz (1/2L,
+ 3/4L, L from the top).
+
+### Measurements
+
+`extract_d55.py` reads the report's PDF (not distributed; PyMuPDF, NumPy, SciPy and Pillow):
+
+- `fem_air.csv`, `fem_water.csv`: the FEM input tables of Secs. 4.5 and 5.4, from the text.
+- `measured_rao.csv`: the 5 and 10 mm RAOs of Appendices 1 and 2 (200 kg, surge and sway).
+ The charts are vector graphics: each series is read as plotted coordinates through the tick
+ labels (axis residual at most 1.2e-3); the frequencies fall on the 0.1 Hz test grid. The
+ axis is labelled "[rad]" and is in rad/s.
+- `measured_tow_ad.csv`: Appendix 3, A/D_rms against Ur at the three stations, in line (X) and
+ cross-flow (Y), 40 points per chart (39 for Y at L, where an edge marker is clipped). The
+ charts are raster images (1386 × 867): the axes are calibrated on the grey grid lines (Ur
+ residual 0.004) and the markers found by colour. Every point maps to a tested speed,
+ V = Ur OD f1, within 0.0085 m/s of the 0.025 m/s grid; the CF peak at 1/2L reads 0.776 at Ur
+ 5.58 (the report: 0.78 at 5.7).
+
+The data are digitised from the report; its figures are not reproduced.
+
+## Reproduce
+
+From the repository root, with `path/to/cabledyn.exe` the release executable or a local build:
+
+```powershell
+python validation/experiments/flotant/flotant_viv.py `
+ path/to/cabledyn.exe validation/experiments/flotant/work --jobs 24 `
+ --summary validation/experiments/flotant
+```
+
+The default is the committed record: the three sets at the 40 tested speeds (120 runs) and the
+90 forced-oscillation runs, about 15 minutes with 24 parallel runs on a 24-core workstation;
+each run reproduces its row of the record. `--parts tow` or `--parts rao`, `--sets` and
+`--speeds` (comma lists; quote them in PowerShell, `--speeds "0.45,0.475"`) select parts;
+`--end` changes the lower end of the tow model; `--dt`, `--refine` and `--tmax` the time step,
+the mesh and the run length. A run whose folder holds the same input files and executable is not repeated; `--keep`
+keeps the output tables (about 14 MB a tow run).
+
+## Results
+
+`response_comparison.csv` holds every tow run (all stations, both components, the measured
+value at the same speed, the response frequency and the mean top tension),
+`rao_comparison.csv` every forced run, `summary.json` the statistics and the SHA-256 of the
+executable, and `provenance.json` the sources, assumptions and sensitivity runs.
+
+### Structure: the forced-oscillation RAOs
+
+r.m.s. log error of the RAOs over the stations and the band; peaks of the RAO at 1/2L (Hz:
+RAO).
+
+| Case | Band | Surge | Sway | CableDyn peaks | Measured, surge | Measured, sway |
+| --- | --- | --- | --- | --- | --- | --- |
+| Air, 5 mm | 1.4–2.0 Hz | 0.227 | 0.278 | 1.7: 7.39 | 1.7: 8.68 | 1.7: 9.14 |
+| Air, 10 mm | 1.4–2.0 Hz | 0.209 | 0.230 | 1.7: 7.23 | 1.7: 5.88 | 1.7: 6.40 |
+| Water, 5 mm, MARIN's table end (`table`) | 1.0–3.0 Hz | 1.186 | 1.216 | 1.3: 3.94; 2.5: 1.36 | 1.3: 4.25; 1.8: 4.40 | 1.3: 4.31; 1.9: 2.99 |
+| Water, 5 mm, free clump (`free`) | 1.0–3.0 Hz | 1.174 | 1.208 | 1.4: 3.68; 2.6: 1.31 | as above | as above |
+| Water, 5 mm, identified end (`identified`) | 1.0–3.0 Hz | **0.459** | **0.743** | 1.2: 3.76; 1.9: 2.45 | as above | as above |
+
+- **In air** the resonance is at the measured 1.7 Hz. With one linear damping the peak is 15 %
+ below the 5 mm test and 23 % above the 10 mm test, which brackets the amplitude dependence the
+ test shows.
+- **In water** only the identified end gives the two peaks and the notch between them. The upper
+ peak is low (2.45 against 4.40 in surge; the test frequencies are 0.1 Hz apart about a sharp
+ peak), the lower one is 0.1 Hz low, and station L moves too much at the upper peak (1.18
+ against 0.55 at 1.8 Hz in surge). The sway fit is worse (0.743), since K and the chain EI are
+ the best values of different directions (above). The fixed and the free clump give one peak
+ near 1.3–1.4 Hz and a next mode at 2.5–2.6 Hz that the test does not have.
+
+### Tow tests
+
+Cross-flow (CF) and in-line (IL) A/D_rms over the 30 tests with Ur ≥ 3 at the three stations;
+the ratio is CableDyn over measured at the same speed.
+
+| Set | Fitted to these tests | CF r.m.s. log error (1/2L, 3/4L, L) | CF ratio, median | IL r.m.s. log error | CF peak at 1/2L (Ur, f) | Release Ur | Top tension (N) |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| Measured | | 0 | 1 | 0 | 0.776 (5.58) | 5.88 | 1970 |
+| `uls19` | no | 0.731 (0.690, 0.605, 0.876) | 1.60 | 0.742 | 0.755 (5.30, 1.25 Hz) | 7.06 | 1962–2076 |
+| `b1` | no | **0.594** (0.497, 0.479, 0.769) | 0.95 | 1.017 | 0.483 (3.83, 1.25 Hz) | 5.89 | 1962–2185 |
+| `wake` | no | 1.208 (1.190, 1.291, 1.137) | 0.41 | (no in-line VIV) | 0.296 (4.41, 1.30 Hz) | 5.30 | 1962–2031 |
+
+The measured top tension is Table 6-1's; the model's runs from the still-water value to the
+mean at 1.0 m/s.
+
+Cross-flow A/D_rms at 1/2L at every test from Ur 2.9, with the dominant cross-flow frequency of
+`uls19`:
+
+| V (m/s) | Ur | Direction | Measured | `uls19` | `b1` | `wake` | f (Hz), `uls19` |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| 0.250 | 2.94 | backwards | 0.03 | 0.10 | 0.36 | 0.17 | 0.97 |
+| 0.275 | 3.24 | forwards | 0.11 | 0.25 | 0.42 | 0.22 | 1.07 |
+| 0.300 | 3.53 | backwards | 0.18 | 0.42 | 0.46 | 0.26 | 1.15 |
+| 0.325 | 3.83 | forwards | 0.31 | 0.54 | 0.48 | 0.28 | 1.18 |
+| 0.350 | 4.12 | backwards | 0.43 | 0.62 | 0.47 | 0.29 | 1.20 |
+| 0.375 | 4.41 | forwards | 0.50 | 0.67 | 0.47 | 0.30 | 1.20 |
+| 0.400 | 4.71 | backwards | 0.67 | 0.72 | 0.46 | 0.28 | 1.23 |
+| 0.425 | 5.00 | forwards | 0.70 | 0.74 | 0.46 | 0.25 | 1.25 |
+| 0.450 | 5.30 | backwards | 0.66 | 0.75 | 0.44 | 0.17 | 1.25 |
+| 0.475 | 5.59 | forwards | 0.78 | 0.74 | 0.43 | 0.19 | 1.30 |
+| 0.500 | 5.88 | backwards | 0.30 | 0.74 | 0.32 | 0.21 | 1.32 |
+| 0.525 | 6.18 | forwards | 0.52 | 0.70 | 0.34 | 0.22 | 1.35 |
+| 0.550 | 6.47 | backwards | 0.33 | 0.65 | 0.36 | 0.22 | 1.38 |
+| 0.575 | 6.77 | forwards | 0.42 | 0.57 | 0.38 | 0.22 | 1.43 |
+| 0.600 | 7.06 | backwards | 0.46 | 0.48 | 0.39 | 0.21 | 1.82 |
+| 0.625 | 7.36 | forwards | 0.52 | 0.52 | 0.40 | 0.20 | 1.82 |
+| 0.650 | 7.65 | backwards | 0.43 | 0.56 | 0.41 | 0.18 | 1.85 |
+| 0.675 | 7.95 | forwards | 0.56 | 0.59 | 0.42 | 0.15 | 1.88 |
+| 0.700 | 8.24 | backwards | 0.38 | 0.62 | 0.44 | 0.04 | 1.90 |
+| 0.725 | 8.53 | forwards | 0.56 | 0.65 | 0.44 | 0.05 | 1.90 |
+| 0.750 | 8.83 | backwards | 0.36 | 0.68 | 0.45 | 0.06 | 1.93 |
+| 0.775 | 9.12 | forwards | 0.44 | 0.70 | 0.45 | 0.06 | 1.95 |
+| 0.800 | 9.42 | backwards | 0.37 | 0.71 | 0.45 | 0.07 | 2.00 |
+| 0.825 | 9.71 | forwards | 0.35 | 0.71 | 0.45 | 0.07 | 2.02 |
+| 0.850 | 10.01 | backwards | 0.30 | 0.71 | 0.45 | 0.08 | 2.08 |
+| 0.875 | 10.30 | forwards | 0.21 | 0.70 | 0.45 | 0.08 | 2.12 |
+| 0.900 | 10.59 | backwards | 0.28 | 0.70 | 0.45 | 0.09 | 2.17 |
+| 0.925 | 10.89 | forwards | 0.20 | 0.69 | 0.45 | 0.09 | 2.23 |
+| 0.950 | 11.18 | backwards | 0.18 | 0.67 | 0.45 | 0.09 | 2.27 |
+| 0.975 | 11.48 | forwards | 0.21 | 0.66 | 0.45 | 0.09 | 2.33 |
+| 1.000 | 11.77 | backwards | 0.20 | 0.64 | 0.19 | 0.09 | 2.38 |
+
+- **`uls19`** (Ulveseter et al. 2019, fitted to another riser):
+ - the first peak is 0.755 at Ur 5.30 against 0.776 at Ur 5.58, and from Ur 4.7 to 5.6 the
+ model is within 0.10 of every test (0.72–0.75 against 0.66–0.78);
+ - the rise starts at a lower speed: 0.25–0.67 against 0.11–0.50 at Ur 3.24–4.41;
+ - the lock-in holds to Ur 6.77 (0.57) and releases at Ur 7.06, 1.2 Ur after the measured
+ release at 5.88; the response stays on the lower in-water mode (1.2–1.4 Hz) up to there and
+ moves to the upper one (1.8–2.0 Hz) at the release;
+ - on the upper branch, Ur 7.0–8.0, it is within 0.03 of the forward tests (0.52–0.59 against
+ 0.52–0.56); above Ur 9 it holds 0.64–0.71 where the test falls to 0.18–0.44;
+ - in line at 1/2L it is about half the measured value during the lock-in (0.08–0.13 against
+ 0.14–0.23 at Ur 4.1–5.6) and mostly above it after the release;
+ - below the compared range it responds at Ur 1.47 (0.11 at 1.3 Hz, f D/U 0.49), where the
+ test shows none (0.002).
+- **`b1`** (generic): a plateau of 0.42–0.48 from Ur 3.24 to 5.59, 38 % below the measured
+ peak, from an early onset (0.36 at Ur 2.94 against 0.03); the release falls at the measured
+ Ur (5.89); the upper branch is 0.32–0.45. The in-line response during the lock-in is well
+ below the measured one (0.01–0.06 against 0.03–0.23).
+- **`wake`** (Facchinetti et al. 2004): 0.22–0.30 up to Ur 5 on the lower mode, 62 % below the
+ measured peak; on the upper mode from Ur 5.30 (0.15–0.22) and on a higher one (2.975–3.45 Hz,
+ 0.04–0.09) from Ur 8.24. The model has no in-line VIV force, so its in-line response is the
+ drag's alone.
+- **By direction** (1/2L, cross-flow r.m.s. log error, forward / backward tests): `uls19`
+ 0.647 / 0.729, `b1` 0.564 / 0.419, `wake` 1.214 / 1.164. The forward tests are the larger
+ ones on the upper branch, which suits `uls19` and not `b1`.
+- **No set predicts these tests.** The height of the first peak is reproduced by `uls19`, its
+ speed range by none: `uls19` locks in too early and too long, `b1` releases at the right speed
+ at 62 % of the amplitude, and the wake oscillator is too weak.
+
+### Lower end and the tow prediction
+
+`uls19` at all 40 speeds with the other two lower ends (`--end`; `provenance.json`):
+
+| End | CF r.m.s. log error (1/2L) | CF peak at 1/2L (Ur) | Release Ur | RAO r.m.s. log error, surge |
+| --- | --- | --- | --- | --- |
+| `identified` | 0.731 (0.690) | 0.755 (5.30) | 7.06 | 0.459 |
+| `table` (MARIN's fixed clump) | 0.721 (0.433) | 0.805 (5.59) | 8.83 | 1.186 |
+| `free` (a `Free` End B) | 0.692 (0.429) | 0.811 (5.59) | 9.12 | 1.174 |
+
+With the fixed or free clump the response at 1/2L drops to 0.19–0.36 from Ur 9.4, which lowers
+the error there, while station L moves 0.53–0.67 against the measured 0.14–0.32 and the lock-in
+releases 2.9–3.2 Ur late. The tow score over the three stations does not separate the ends;
+the identified end is used because it reproduces the RAOs. Every end releases late.
+
+### Convergence
+
+At 0.30, 0.45, 0.50, 0.60 and 0.80 m/s for the three sets (`provenance.json`):
+
+- half the time step (1 ms) changes no A/D_rms by more than 0.006 (cross-flow at most 2.1 %)
+ and the dominant frequency by at most one bin;
+- two elements per table element change no A/D_rms by more than 0.004 (cross-flow at most
+ 1.4 %), and the frequency not at all;
+- 120 s runs (100 s of statistics) change no A/D_rms by more than 0.005 (cross-flow at most
+ 1.0 %).
+
+For the RAOs, two elements per table element and half the time step change every r.m.s. log
+error by at most 0.001.
+
+## Limitations
+
+- The structure below the cable is an identified impedance, not a measured one, and the
+ in-water upper peak and station L are not matched closely; the cable's EI and damping come
+ from the in-air tests, whose losses include the end fixtures.
+- The tow tests are single runs per speed with the direction alternating, without repeats or
+ uncertainties; the forward and backward tests differ on the upper branch.
+- The measured response frequencies are not published, so the mode a set locks in to cannot be
+ checked against the test except through the amplitudes of the three stations.
+- The data are digitised from figures (Appendix 3 from raster images, ±0.004 in Ur).
diff --git a/validation/experiments/flotant/extract_d55.py b/validation/experiments/flotant/extract_d55.py
new file mode 100644
index 00000000..3492f619
--- /dev/null
+++ b/validation/experiments/flotant/extract_d55.py
@@ -0,0 +1,336 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: Apache-2.0
+# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+"""Extract the data of the FLOTANT D5.5 report used by flotant_viv.py from the report's PDF.
+
+ python extract_d55.py path/to/210430_FLT-D5.5_VIV_test_v0.pdf [OUTDIR]
+
+Writes, by default next to this script:
+ fem_air.csv, fem_water.csv the node-by-node FEM input tables (Sec. 4.5, in air, and Sec. 5.4,
+ in water): element label, position, accelerometer station, X Y Z,
+ constraint flags, lumped mass [kg], weight [N] (submerged in water),
+ static tension [N], EA [N], EI [N m^2]
+ measured_rao.csv the RAOs of Appendix 1 (in air, 200 kg, surge and sway) and Appendix
+ 2 (in water, 200 kg, surge and sway) at 5 and 10 mm
+ measured_tow_ad.csv A/D_rms against Ur of the 200 kg tow tests, Appendix 3
+
+The RAO charts are vector graphics: a series is a polyline with filled markers of one colour,
+named by the legend entry beside the same marker; data coordinates follow from the tick-label
+words by a linear map per chart (the frequency axis is labelled "[rad]" and is in rad/s). The
+Appendix 3 charts are embedded raster images (1386 x 867 px) with the tick labels inside the
+raster: their axes are calibrated on the light-grey gridlines (Ur -10, -5, 0, 5, 10; A/D from 0
+in the steps of PLOTS) and the markers are the tab:blue discs. Each digitised Ur is checked
+against the test speeds of Table 6-2 (multiples of 0.025 m/s, V = |Ur| OD f1, OD 0.048 m,
+f1 1.77 Hz).
+
+Needs PyMuPDF, NumPy, SciPy and Pillow; the report is not distributed with CableDyn.
+"""
+
+from __future__ import annotations
+
+import csv
+import io
+import re
+import sys
+from collections import defaultdict
+from pathlib import Path
+
+import numpy as np
+import pymupdf
+from PIL import Image
+from scipy import ndimage
+from scipy.cluster.vq import kmeans2
+
+HERE = Path(__file__).resolve().parent
+OD, F1 = 0.048, 1.77
+
+# ---------------------------------------------------------------- FEM input tables
+FEM_PAGES = {"air": (58, 59), "water": (49, 50)}
+ROW = re.compile(
+ r"(?P\d+)\s+(?P[A-Za-z]+)\s+(?P-?\d+\.\d+)\s+(?:(?P\d\.\d+L?|L|Hex|Top)\s+)?"
+ r"(?P-?\d+\.\d+)\s+(?P-?\d+\.\d+)\s+(?P-?\d+\.\d+)\s+(?P[01])(?=\s)\s+(?P[01])(?=\s)\s+"
+ r"(?P[01])(?=\s)\s+(?P[01])(?=\s)"
+ r"(?:\s+(?P-?[\d.]+)\s+(?P