Skip to content

fix: CableDyn reader closes the remaining deck and torsion gaps - #30

Merged
SMI-Lab-Inha merged 1 commit into
devfrom
fix/cabledyn-compat-residuals
Nov 18, 2026
Merged

SMI-Lab-Inha merged 1 commit into
devfrom
fix/cabledyn-compat-residuals

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

Closes the remaining differences between read_cabledyn_deck / read_cabledyn_sections / the sea-state batch and what CableDyn actually does with a deck. Each item was checked against the CableDyn source (src/CableDyn_DeckDriver.f90, src/CableDyn_Loads.f90, doc/driver_format.md, doc/theory.rst) and, where a run could show it, against the CableDyn 0.4.2 driver.

Gap Before Now
EQUIVALENT BUOYANCY ignored: diameter_m / mass_kg_m showed the LINE TYPES row (0.29 m, 59.53 kg/m in the reproduction) CableDyn's resolution (0.30 m, 62.256 kg/m); raw values kept as line_types_diameter_m / line_types_mass_kg_m, equivalent_submerged_weight_N_m
Comments and records #/! cut everywhere (same as CableDyn); inline -- comment refused ("UnstrLen is not numeric: '--'"); a repeated section refused mirrors scan_comment, is_section_header, token_bounds, append_channel
LINE TYPES checks negative Cd/Ca and partial GAs GJ Irt Irn accepted refused, as by CableDyn
One-end torsion read twist-free without Twist channels CableDyn's resolve_one_end_torsion rules mirrored; a dynamic run of a solved line needs the channels
Batch property check EA and EI only also GJ and the torque–tension coupling K

Details

Equivalent buoyancy

CableDyn's apply_equivalent_buoyancy replaces the type's diameter by the row's D and its mass by

$$m = \rho_w \frac{\pi D^2}{4} + \frac{w}{g},$$

with w the submerged weight [N/m], before it runs. The reader now does the same, with CableDyn's checks (three columns, a known type, one row per type, D > 0, m ≥ 0). Verification: the lw24 deck with the row buoy 0.30 -100.0 and the same deck with buoy written as Diam 0.30, MassDenInAir 62.255818443635306 (the reader's value) give byte-identical .static.out, .out, .Line1.p.out and .Line1.t.out from CableDyn 0.4.2.

Records

  • -- starts a comment at the start of a record or after a separator, unless the record holds ---; a--b is a token.
  • A record holding --- is a section header named by its other characters; a section met again continues (CableDyn appends; the reader refused it). Both decks of the reproduction run in CableDyn with the same static state as the base deck.
  • A byte-order mark is dropped; a token opening with a quote runs past its closing quote to the next separator.
  • # and ! cut a record anywhere, inside quotes too — this is CableDyn's behaviour (doc/options.rst: "A # or ! starts a comment even inside a path"), so it is kept and now documented.
  • OUTPUTS: names split on spaces, tabs and commas with quotes dropped; only an unquoted END closes the list (get_token keeps the quotes, so CableDyn reads "END" as a name).

Torsion restrained at one end only

From doc/theory.rst (a free end): the statics are those of the line without torsion, but "in the dynamics the free end's node has no spring and no held angle ... torsional waves reflect there", and a roll $A\sin\Omega t$ of the restrained end turns the free end by $A/\cos kL$. So the twist is not provably zero: it is zero in the statics only (without coupling). The new fixture tests/data/cabledyn/lw24k.* (the lw24g deck with K = 0, CableDyn 0.4.2 build 4b94321) shows Twist1N<J> growing to −1.7e-3° in 1 s; a 30 s run of the deck reaches 0.18° at the sag bend.

CableDyn solves such a line only under the rules of resolve_one_end_torsion (every section gives GJ, End B Fixed, a dynamic run force-blended, a restrained End A on a rod or body only on a Fixed rod or a Rigid6 body); otherwise it runs it without the torsion columns and refuses Twist channels. The reader now mirrors those rules (CableDynLine.torsion_solved, torsion_note; BODIES and RODS rows are read for the end types), so:

  • a dynamic run of a solved line without Twist channels is refused with a message naming the cause; its statics (TMax 0) need none unless the type couples torque and tension;
  • a line CableDyn does not solve is read twist-free, and the fix: CableDyn deck reader takes the 0.4.x LINE TYPES grammar #28 coupling rule now applies only to solved lines (the channels could not be written otherwise);
  • section_channels lists Twist/Torq only for solved lines;
  • checks["torsion"] records the case.

Also from normalize_stock_endpoint_order: a line from a Fixed NodeA to a Free/Connect NodeB is swapped only when NodeA is not above NodeB.

Batch property check

On a 14-column LINE TYPES row, GJ is compared with CableXSec's lay torsional stiffness K_tt, and K through the coupling ratio

$$c = \frac{K}{\sqrt{EA,GJ}}, \qquad |c| < 1, \qquad EA_\text{free} = EA,(1 - c^2),$$

against $K_{et}/\sqrt{EA_\text{fixed},K_{tt}}$, both within the new torsion_rtol (default 25 %). The tolerance is wider than property_rtol because K_tt leaves out the components' own torsion and the radial relaxation of the layers (CH-GJ: +26 % and −27 %). The sign of K is CableDyn's ($M = GJ,\tau + K\varepsilon$, right-handed), the same as CableXSec's K_et (a positive twist tightens a right-hand lay). A mismatch is reported and stops the batch exactly as an EA/EI one does; a 10-column row is not compared.

Not changed

  • .V.out and .range.out reading (out of scope).
  • The reader still starts the material frame at End A without the roll of a restrained hang-off about its tangent, and does not apply the free End A turn of a line restrained at End B only (documented limitations, unchanged).

Gates

  • ruff check and ruff format --check on src tests examples validation release doc (CI command): clean. mypy: no issues in 119 source files.
  • pytest (full suite) with numba: 4546 passed, 3 skipped; with CABLEXSEC_DISABLE_NUMBA=1: 4432 passed, 117 skipped. Three small deck tests (RODS/BODIES row counts, zero-length rods, alpha_force_blend spelling) were added after these runs; tests/test_cabledyn_inputs.py, test_cabledyn_reader.py and test_sea_state_batch_inputs.py pass in both modes with them.
  • validation/scripts/run_validation.py --check: report current (58 rows, 5 registered FAIL, 0 REVIEW, 1 PARTIAL). Taxonomy: analytical_sanity 1190, independent_method 76, full_scale 35 (+1, the lw24k run).

EQUIVALENT BUOYANCY rows were ignored, so a line type showed the Diam
and MassDenInAir of its LINE TYPES row, not the values CableDyn ran
with. A row now replaces the diameter and sets the mass to
rhoW pi D^2/4 + w/g, as CableDyn's apply_equivalent_buoyancy does, with
its checks; line_types_diameter_m, line_types_mass_kg_m and
equivalent_submerged_weight_N_m keep the row's values. CableDyn 0.4.2
gives byte-identical output for the lw24 deck with the row
"buoy 0.30 -100.0" and for the deck with buoy written with this diameter
and mass.

Records are cut and split as CableDyn's scan_comment, is_section_header
and token_bounds do: "--" starts a comment at the start of a record or
after a separator (a LINES row ending in "-- comment" was refused), a
record holding "---" is a header named by its other characters, a
byte-order mark is dropped, a repeated section continues (it was refused)
and a token opening with a quote runs on to the next separator. "#" and
"!" still cut a record inside quotes, as CableDyn does. OUTPUTS rows are
split on spaces, tabs and commas with the quotes dropped, and only an
unquoted END closes the list.

LINE TYPES rows with a negative Cd/Ca, or a 14-column row whose GAs, GJ,
Irt and Irn are neither all zero nor all positive, are refused, as by
CableDyn.

CableDyn solves the torsion of a line restrained at one end only when
every section gives GJ, End B is Fixed, a dynamic run is force-blended
and a restrained End A on a rod or body is on a Fixed rod or a Rigid6
body (resolve_one_end_torsion); otherwise the line runs as without the
torsion columns. CableDynLine.torsion_solved and torsion_note follow
these rules (BODIES and RODS rows are read for them), section_channels
asks for Twist/Torq only on a solved line, and checks["torsion"]
records the case. In the dynamics a solved line twists without
torque-tension coupling too (torsional waves of its polar inertia, the
roll of the restrained end), so a dynamic run without Twist channels is
now refused where it was read twist-free. tests/data/cabledyn/lw24k.* is
the lw24g deck with K = 0 run by CableDyn 0.4.2 (development build
4b94321): the line twists by up to -1.7e-3 deg in 1 s (0.18 deg in a
30 s run). Its statics stay twist-free and are read without the
channels.

The anchor-first swap of a line from a Fixed NodeA to a Free or Connect
NodeB applies only when NodeA is not above NodeB, as in CableDyn.

run_sea_state_batch compares the deck GJ with the section's lay
torsional stiffness K_tt and the coupling ratio K/sqrt(EA GJ) with
K_et/sqrt(EA_fixed K_tt), within the new option torsion_rtol (default
25 %), on a 14-column LINE TYPES row. A mismatch stops the batch as one
of EA or EI does, unless allow_property_mismatch is set.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T02:01:10.058393Z 5bb04c6 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.

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #35972462 | 📁 Comparing 5bb04c6 against latest (240bf9c)

  🔍 Preview build  

19 files changed · ± 19 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 5bb04c6ec4

ℹ️ 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 67c580a into dev Nov 18, 2026
12 checks passed
SMI-Lab-Inha added a commit that referenced this pull request Nov 18, 2026
ci: validation report counts both new full-scale tests

#29 and #30 each added one full_scale test and each recorded 35 passed
against the 34 on the dev it branched from. On dev with both merged the
marker runs 36 passed, 1 skipped; the other two taxonomy lines are
unchanged (1190 and 76).

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/cabledyn-compat-residuals branch November 18, 2026 05:15
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