Skip to content

test: long-run VIV checks; one OpenMP thread per batch job; load-power and bending-damping speed-ups - #173

Merged
SMI-Lab-Inha merged 3 commits into
devfrom
feat/viv-long-run-checks
Nov 16, 2026
Merged

SMI-Lab-Inha merged 3 commits into
devfrom
feat/viv-long-run-checks

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

Three changes:

  1. A 400-cycle long-run check of the VIV synchronisation model (viv_long_run). Under prescribed motion, the phase error grows linearly in time and falls fourfold per halving of the step. On a locked-in line the load powers close the energy balance at second order, and the run's two halves agree, so nothing drifts.
  2. Batch studies run each case on one OpenMP thread when jobs > 1, which removes oversubscription.
  3. Two profiler-led speed-ups of the VIV and bending-damping paths, with outputs bit-identical.

1. Long-run VIV check (tests/test_viv_long_run.f90)

(P) Prescribed motion. Every node of a finite-EI cable moves across a 0.3 m/s flow as a rigid body, so the shedding phase obeys Adler's equation $\dot\psi = a - b\sin\psi$, solved in closed form.

Check Measured Gate
P1: outside the band (5.5 rad/s), error growth T/(T/2) 2.014 / 1.988 at 50 / 100 steps per cycle 1.8–2.2 (linear in time)
P2: order, 50 → 100 steps 4.01 3.6–4.4
P2: phase error after 400 cycles, 100 steps per cycle 0.0167 rad (4e-5 rad per cycle) ≤ 0.05 rad
P3: inside the band, lag against ψ* 3.0e-5 rad (the averaging-ripple floor); mean rate 5.8e-12 ≤ 1e-4 rad; ≤ 1e-8

(C) Lock-in. A taut 20 m line, finite-EI and EI = 0, with $\rho_\infty = 1$ and no added mass, so the load powers are the whole energy change. Run at 100 and 200 steps per cycle.

Check Finite EI EI = 0 Gate
C1: energy mismatch / VIV work, 100 steps 2.0e-4 1.8e-4 ≤ 3e-4
C1: order, 100 → 200 steps 3.98 3.67 3–5
C1: mismatch at T over T/2 1.00 1.00 ≤ 1.25
C2: halves, RMS A/D / VIV power 7.3e-4 / 1.8e-3 4.1e-4 / 9.0e-4 2e-3 / 1e-2
C3: halves, lock-in frequency 7.4e-5 1.9e-4 2e-3
C3: frequency change, 100 → 200 steps 1.6e-4 1.9e-4 5e-3

Why C1's bound is 3e-4. On the second-order phase update of #171, the lift takes the phase predicted from the previous step's mid-point rate, half a step behind the step's own. That is a second-order lag. The mismatch was 8.3e-5 before #171 and is 2.0e-4 now, still second order and stationary.

Every tolerance and its measured value is in the test header. The test takes 57 s in Release; label slow, TIMEOUT 1200.

2. One OpenMP thread per batch job

With jobs > 1, run_study (and cabledyn-study) runs every case with OMP_NUM_THREADS=1 unless the environment sets it, and study.json records omp_num_threads.

Measured on a 24-core workstation (gfortran Release):

  • Finite-EI VIV: 96 cases scale 13.3× at 24 jobs and 15.1× at 48. OpenMP inside one VIV run changes nothing: 1.79 s against 1.76 s.
  • Lazy-wave, 1024 elements: 24 jobs take 16.7 s with one thread each, 17.9 s with four and 19.1 s with the OpenMP default.

The Python manual gives the table and the recommended settings.

3. Speed-ups (outputs bit-identical)

  • Load-power channels. VIVPow, DragPow and DampPow each evaluated a line's node powers, 19 % of a VIV run. A row now evaluates them once for all of its power channels, on the Hermite, EI = 0 and system routes. Any failure still goes through the channel-at-a-time path, so its message is unchanged.
    • viv_taut_cable_inline.dat: 2.39 → 2.14 s.
    • The same line with 200 elements at 100 steps per cycle: 18.1 → 16.1 s.
  • Bending damping. The second derivatives of the curvature were computed in every residual evaluation, but only the position Jacobian needs them. They took 32 % of the Delta Flume case 9 run. Delta Flume case 9: 73.2 → 58.6 s.
  • New test. load_power_deck P6 checks that a power channel read alone equals the same channel among its line's other power channels, on all three routes.

Checks

All on the branch rebased on dev f4c9958 (#171). The rebase onto 05a4f14 (#172) changes no Fortran source or test.

  • Full test suite: 431/431 on the default and on the Prescott OpenBLAS kernel.
  • Example A/B: all 134 example and test-data decks write bit-identical outputs on the old and new driver.
  • NDP validation (validation: NDP 38 m high-mode riser VIV in uniform flow (L3-N) #172): the 25 default runs reproduce their rows of the committed response_comparison.csv exactly.
  • Fallbacks: the example decks run with no fallback note.
  • Python suite: 3217 passed (47 skipped) against this build's library and driver.
  • pre-commit.

…thread per batch job

viv_long_run runs the synchronisation model for 400 cycles. Prescribed motion: every node of a
finite-EI cable moved across a 0.3 m/s flow as a rigid body, so the shedding phase obeys Adler's
equation, d psi/dt = a - b sin(psi), solved in closed form. Outside the band (5.5 rad/s) the
largest node error grows linearly in time (T/(T/2) 2.00 and 2.02 at 50 and 100 steps per cycle)
and is second order (3.98 from 50 to 100 steps): 0.033 rad after 400 cycles at 100 steps per
cycle. Inside the band the lag holds within 2.9e-5 rad of psi*, the averaging-ripple floor, at
every step size, and the mean rate is the motion's within 1.8e-10.

Lock-in, finite-EI and EI = 0 (taut 20 m line, rho_inf = 1, no added mass, 100 and 200 steps per
cycle): the load powers close E(t) - E(0) to 8.3e-5 / 7.9e-5 of the VIV work, second order (4.2 /
4.0; 1.1e-3 to 2.3e-7 over 25 to 1600 steps per cycle), and the mismatch grows no faster than the
work. The halves of the last three quarters agree in RMS A/D within 4.3e-4, mean VIV power within
1.1e-3 and lock-in frequency within 4.5e-4, below the change from 100 to 200 steps per cycle. The
coupled lock-in frequency converges at first order or slower (0.74, 0.41, 0.27 % per halving from
25 steps per cycle), while the phase update itself is second order. Every tolerance and its
measured value is in the test header. 26 s Release, 160 s Debug; label slow, TIMEOUT 1200. At 50
steps per cycle with rho_inf = 1 the finite-EI step does not converge on this line.

run_study with jobs > 1 now runs every case with OMP_NUM_THREADS=1 unless the environment sets it,
and study.json records omp_num_threads. Measured on the 24-core workstation (gfortran Release):
96 finite-EI VIV cases scale 13.3x at 24 jobs and 15.1x at 48; OpenMP inside one VIV run changes
nothing (1.79 s against 1.76 s), but on the 1024-element lazy-wave example 24 jobs take 16.7 s
with one thread each, 17.9 s with four and 19.1 s with the OpenMP default. The Python manual
gives the table and the recommended settings.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
…its Jacobian tensors

Profiling the finite-EI step with VIV on (gfortran Release, one thread):

- The load power channels evaluated CD_HermiteCable_Dyn_Load_Power (VIV lift, drag and structural
  damping over every element) once per channel: with VIVPow, DragPow and DampPow 19 % of a VIV run.
  A row now evaluates a line's node powers once for all its power channels: the Hermite row writer
  passes a per-row cache to eval_cable_channel, and the EI = 0 / system planned writer resolves the
  channels to CH_LOAD_POWER with a per-line, per-row stamp like its state and tension caches. Any
  failure still goes through the channel-at-a-time path, so its message is unchanged.
  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.
- CD_HermiteCable_Bending_Damping computed the second derivatives of the curvature (T, dP, dK,
  about 300 terms per Gauss point) in every residual evaluation, where only Kq uses them: 32 % of
  the Delta Flume case 9 run (64 elements, 80 000 steps, EI|-zeta|f). They are now evaluated only
  with Kq; the force takes the same operations. 73.2 s to 58.6 s.

Bit-identical: the 134 example and test-data decks, the two Delta Flume decks (cases 5 and 9) and
the load power decks of the EI = 0 line, the system and the cable match the reference build byte
for byte. load_power_deck P6 checks that a power channel read alone equals the same channel among
its line's other power channels and changes from row to row, on all three routes.

Remaining hot spots of the Delta Flume run: the bending damping's force path (Jacobian of the
curvature, MATMULs), the Morison drag kernels with their finiteness scans, the line position file
the deck writes every step (about 8 %), and the banded solves.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
On the mid-point phase update of #171 the energy closure of the
locked-in line is 2.0e-4 (finite EI) and 1.8e-4 (EI = 0) of the VIV
work at 100 steps per cycle, still second order (3.98 and 3.67 per
halving) and stationary (T against T/2 1.00): the lift takes the phase
predicted from the previous step's mid-point rate, half a step behind,
so the bound moves from 1.5e-4 to 3e-4. The phase error under prescribed
motion halves to 0.0167 rad after 400 cycles (order 4.01), and the
lock-in frequency now changes by 1.6e-4 and 1.9e-4 from 100 to 200
steps per cycle; the header no longer says it converges at first order,
nor that the finite-EI line fails at 50 steps per cycle (#169). Every
measured value in the header, the L2-VIV-long row and the changelog is
from this run.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T12:33:59.252334Z 0d5cb78 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35926384 | 📁 Comparing 0d5cb78 against latest (789cb6d)

  🔍 Preview build  

15 files changed · ± 15 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 0d5cb78a36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit 3d779fb into dev Nov 16, 2026
22 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the feat/viv-long-run-checks branch November 16, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant