Skip to content

feat(current): deck currents on the standalone mixed EI=0 + finite-EI deck - #79

Merged
SMI-Lab-Inha merged 2 commits into
devfrom
feat/mixed-route-currents
Nov 2, 2026
Merged

SMI-Lab-Inha merged 2 commits into
devfrom
feat/mixed-route-currents

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

The standalone mixed deck (EI = 0 lines and finite-EI cables between Fixed/Coupled/Vessel
points, run by the driver on the OpenFAST aggregate) now takes every deck current the single-line
routes take: a current OPTION (uniform or profile), a WaterKin CurrentMod 1 table and
MoorDyn-C Currents 1/2/5. Until now the route refused all of them (and the aggregate also
refused a deck current on any deck with a finite-EI cable).

Deck waves stay refused on the mixed route, and the coupled OpenFAST/FAST.Farm route is unchanged:
it keeps taking the host's field and refusing deck currents.

Design

  • CD_Init_Deck_Aggregate / CD_AGG_Init_From_Deck take a new optional deck_current (passed only
    by the driver's run_mixed_held_deck). With it, the current refusals (forbid_deck_ambient, the
    finite-EI scope, MoorDyn-C Currents 1/2/5) are lifted. The refusals of WaveKin 3/7 and deck
    waves stay. A deck-owned current is refused by name beside a host field (external_fluid), a
    host placement/farm/static_current, or bodies, rods and Connect/Free points (those decks
    run on the multibody or point-system march). Without dtM it is refused as on the single-line
    routes.
  • Statics: the static solves of the chains and the cables already take opts (with the static
    tangent gradient of a profile or grid). They now see the deck current at t = 0, as on the
    single-line routes.
  • Dynamics: an opaque CD_DeckCurrentRuntimeType (the deck options that carry the current, plus a
    sample workspace) is held by the aggregate. Its samplers call the single-line routes' own updaters:
    update_system_line_hydro (the system twin of update_wave_models) on the EI = 0 lines and
    update_hermite_deck_fluid on the cables. Every field therefore goes through
    deck_current_velocity, as on the other routes.
    • CD_AGG_Init_From_Deck samples it at t = 0 at the static state (the cables' first held field
      sets the consistent start acceleration).
    • CD_AGG_Refresh_Accelerations (the row-1 station of a motion) samples it again at t = 0 at
      the installed row.
    • CD_AGG_Step_Moving samples it at t_committed at the step-start nodes, as the single-line
      marches do; t_committed is required.
  • update_hermite_deck_fluid takes an optional workspace, so the aggregate's march makes no heap
    allocation per step. The single-line routes still call it without one, unchanged.
  • Python DeckFile mirrors the change: a mixed deck accepts the currents, and refuses deck waves
    and WaveKin 3/7 with the native wording.

Validation

New mixed_route_currents test (driver plus library): a 100 m cable and a 110 m chain, both
fairleads surging 1 m from rest, in cross currents. Numbers are fractions of each channel's range,
mixed route against the single-line routes. On dev every driver run of the mixed decks is refused.

Gate Result
OPTION uniform / profile, Currents 1/2/5: static start chain exact; cable 4.9e-6 / 4.3e-6 / 1.3e-6 / 9.2e-7 / 2.1e-6 (out-of-plane offset, 4 um of 0.55 m, the coupled build's static polish; still water: exact)
March, coupled Newton controls (driver) cable 1.0e-3 to 1.1e-3 (still water: 1.2e-3); chain 2.1e-5 uniform, exact sheared (still water: 5.4e-5, the row-1 transfer)
March, the deck's Newton controls (library) cable 4.9e-6 / 4.7e-6 / 9.5e-7 / 2.4e-6, the static start's difference (still water: 1.9e-8)
Current felt mid nodes 0.55 m / 0.56 m out of plane (uniform); chain tension history changes by 3.0e-3
Currents 2 wrapping past its last sample equal to the unrolled table bit for bit; differs from the held table by 0.39 of the chain tension range after 6 s
Uniform field as Currents 1 / Currents 5 bit for bit / static start bit for bit and march 3.9e-8
Correction rewind (CD_AGG_Snapshot, step, CD_AGG_Restore, step) x10, still water and Currents 2 bit for bit
Refusals deck waves, uniform beside Currents 2, current without dtM

Further checks:

  • step_allocations_mixed_current: 0 heap allocations in 160 steps in a Currents 5 grid. It made
    640 (4 per step) with the cables' automatic sample arrays before the workspace.
  • Python: a native-verdict parity test over ten mixed-deck current/wave rows; driver_msg_mixed_current
    now runs the lazy-wave deck in its current, and driver_msg_mixed_waves checks the waves refusal.

Checks:

  • Release ctest: 345/345.
  • Checked Debug (-fcheck=all): 10/10 new and touched tests (mixed_route_currents,
    step_allocations_mixed_current, mixed_route_torsion, mdc_currents, openfast_aggregate*,
    driver_msg_mixed*).
  • pytest: 2189 passed, 75 skipped. The native mixed-route verdict test passes 10/10, and 5/10 fail
    against the dev driver.
  • ruff, strict mypy (only the 3 known errors), pre-commit, Sphinx -W, ifx duplicate-PUBLIC scan: 0.
  • Example A/B against dev: 53/53 decks identical.

Docs: driver_format.md, standalone_driver.rst, capabilities.rst, troubleshooting.rst,
VALIDATION.md, CHANGELOG.md.

… deck

The standalone mixed deck (EI = 0 lines and finite-EI cables between
Fixed/Coupled/Vessel points, run by the driver on the aggregate) refused
every deck current. It now takes those the single-line routes take: a
current OPTION (uniform or profile), a WaterKin CurrentMod 1 table and
MoorDyn-C Currents 1/2/5.

CD_Init_Deck_Aggregate and CD_AGG_Init_From_Deck take an optional
deck_current, passed only by run_mixed_held_deck. The static solves of the
chains and cables take the current at t = 0. CD_DeckCurrentRuntimeType
holds it, and the aggregate samples it with the single-line routes'
updaters (update_system_line_hydro, update_hermite_deck_fluid):
- at t = 0 at Init;
- at the row-1 station (CD_AGG_Refresh_Accelerations);
- at t_committed before every CD_AGG_Step_Moving.
The cable sampler takes an optional workspace, so the march allocates
nothing per step. Deck waves stay refused. The coupled route keeps the
host's field.

mixed_route_currents compares the mixed route with the single-line
routes, a cable and a chain in cross currents:
- the static start agrees exactly (chain) and to 4.9e-6 of the range
  (cable, the coupled build's static polish);
- with the same Newton controls the march agrees to 4.9e-6 (cable) and
  2.1e-5 (chain);
- a wrapping Currents 2 table equals its unrolled form bit for bit;
- a uniform Currents 1 profile equals uniform bit for bit, and a uniform
  Currents 5 grid equals it to 3.9e-8;
- correction rewinds are bit-identical.
step_allocations_mixed_current finds 0 heap allocations in 160 steps.
The Python validator follows the native verdicts.

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 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T22:13:04.990694Z a5a427b 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

read-the-docs-community Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35595742 | 📁 Comparing a5a427b against latest (fd1936d)

  🔍 Preview build  

32 files changed · ± 32 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 623f673ff3

ℹ️ 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".

Gate 4 of mixed_route_currents required the uniform Currents 1 profile
to reproduce OPTION uniform bit for bit. The profile's linear
interpolation between equal levels is exact on Windows and one ulp off
on Linux gfortran, which the march carries: the Linux Release CI job
measured 3.87e-8 of each channel's range and failed the gate. The gate
now takes the grid case's round-off tolerance (GRID_TOL 1e-7), and the
CHANGELOG and VALIDATION wording says to round-off.

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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: a5a427b3d5

ℹ️ 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 780708c into dev Nov 2, 2026
21 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the feat/mixed-route-currents branch November 3, 2026 01:31
SMI-Lab-Inha added a commit that referenced this pull request Nov 3, 2026
…#81)

## Summary

A finite-EI cable on the coupled aggregate (a mixed `EI = 0` + finite-EI standalone deck, OpenFAST `CompMooring = 5`, FAST.Farm, the C API) stepped to a fixed relative Newton tolerance of 5e-3 (200 iterations), whatever the deck's `dynamic_solver` row said; the same cable alone in a deck stepped to the deck's tolerance (default 1e-8, 30 iterations). Every route now takes the deck's `rel` and `max_iter`, and the static start `min(1e-6, rel)`.

## What the loose step did

- **Silent wrong tensions.** A lazy cable beside a chain, both fairleads moved 3.5 m: at `rhoInf` 1, `dtM` 0.05 s the mixed route's fairlead tension peaked at 4.3e5 N (anchor 5.5e5 N) against 1.9e4 N (2.1e3 N) for the cable alone; at `dtM` 0.1 s it fell to 8307 N against 10 799 N and the fairlead bend moment rose to 1612 against 3.9 N m (robustness campaign D03).
- **A non-dissipative coupled cable.** Held at both ends in still water, the residual each step left grew at `rhoInf` 0.4 into a sustained oscillation (+-14 N at 8 Hz on 1.2e4 N on the IEA-15 MW mixed cable, also inside OpenFAST), and at `rhoInf` 1 the march diverged (6.1e5 N within 5 s) (end-to-end validation E2E-D2). On that reproducer the held cable now stays constant (0 N range over the second half of 80 s at `rhoInf` 0.4, and at `rhoInf` 1).

Now the routes, and the C API, OpenFAST and FAST.Farm builds driven through the same motion, agree to 5e-8 of the peak tension; a seeded disturbance decays as on the single-line route.

## Also

- The standalone vessel march passed `TRANSPOSE(motion%rot(...))` as an orientation argument every step, which the compiler packed into a heap temporary; the DCM is formed in a local array (gate `step_allocations_driver_vessel`).
- `mixed_route_currents` (#79) needed a 2e-3 cable tolerance only because of the loose coupled step; its driver-level comparison now agrees exactly and the gate is at 1e-6.

## Cost

About 2.0 tangent factorisations per coupled cable step instead of 1.1: the aggregate step of the IEA-15 MW mixed example takes 38 % more CPU time.

## Checks

- New test `coupled_cable_tolerance` (gates 1-3: mixed vs single-line route at `rhoInf` 1 / `dtM` 0.05 and `rhoInf` 0.4 / `dtM` 0.1; C API, OpenFAST and FAST.Farm builds; held and seeded cables at `rhoInf` 0, 0.4, 1), each failing on the old code.
- ctest 350 of 350; checked Debug build (`-fcheck=all`) on the 13 touched tests; example A/B 53 of 53 identical; pre-commit, Sphinx `-W`, no duplicate `PUBLIC`.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
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