Skip to content

perf: channels only on written steps; cheaper nodal-twist residual and output transfer - #198

Merged
SMI-Lab-Inha merged 2 commits into
devfrom
perf/coupled-cost
Dec 3, 2026
Merged

SMI-Lab-Inha merged 2 commits into
devfrom
perf/coupled-cost

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Why

A coupled OpenFAST run of an operating IEA-15 MW turbine with three chains and a 66 kV lazy-wave cable (237 elements, nodal torsion, DT = 0.0125 s) costs about 100 CPU minutes per simulated hour. CableDyn takes about 70 % of that. A profile of the run located two costs that do no useful work:

  • Output channels. The tightly coupled solver calls CD_CalcOutput two to four times per step (3.3 on average here), and every call evaluated all deck channels: 14.6 % of the run. OpenFAST writes only every DT_Out.
  • Torsion kernel (twist_reference, 28 % inclusive).
    • The residual formed the 12 × 12 Hessian of the torque-tension coupling term, which only the tangent uses.
    • Every output call transfers the fairlead kinematics (Set_Torsion_Frames), which re-assembled the twist of every element at the committed shape. Only the end elements moved.

What

Channels only on written steps

  • CD_CalcOutput takes the optional CalcWriteOutput argument OpenFAST already passes to AeroDyn and BeamDyn.
  • Integration patch 0009 passes WriteThisStep .or. Linearize for CableDyn. Other hosts (FAST.Farm turbines go through the same glue; the C API and the standalone driver omit the argument) evaluate on every call, as before.
  • The loads are evaluated on every call.
  • A supercycled call that needs the channels, when the cached loads were taken without them, re-evaluates (chan_cached, cleared with loads_cached).

Torsion kernel

  • CD_HermiteTorsion_Stretch_Derivatives takes an optional want_hess; the residual path passes .FALSE.. The length and gradient are formed by the same operations either way.

  • assemble_twist keeps a memo per element away from a rigid end. It holds the inputs twist_reference reads there and its results:

    • inputs: the element's 12 DOFs, the reference unit tangents of its two nodes, tw_beta, l0, the coupling, the quadrature order;
    • results: rho, beta, g.

    A residual-only assembly takes the results only when every input is bitwise the memo's, so the memo cannot be stale. From the second output call of a step on, all elements but the end ones hit.

Results

The .out, .CD.out and .lin data are identical to dev (ae9f9b4), bit for bit:

Check Result
Operating deck, DT = dtM = 0.0125 s, 400 s identical
Same deck, cable supercycled (dtM = 0.025 s) identical
Checkpoint at 60 s: continuous run and the run restarted from it identical (each against dev's)
openfast_lin_ab.py (IEA-15 UMaine twin decks, CableDyn vs MoorDyn) PASS; every .lin file identical to dev's apart from its time stamp
Fortran fast tier, OpenBLAS Prescott and Haswell kernels 350/350 each

CPU time on the operating deck (400 s, one thread, gfortran):

Build Simulation CPU time Change
dev before these changes 11.23 min —
+ channels on written steps 9.79 min −12.8 %
+ residual without the stretch Hessian 9.41 min −3.9 %
+ twist memo 9.00 min −4.4 %

On the rebased branch, with dev (ae9f9b4) and this branch run side by side: 10.83 → 8.84 min (−18 %). The memo cuts the output-call overlay from 37.1 to 15.9 s. On the same deck at DT = 0.025 s, the channel change alone saves 10 % (6.33 → 5.68 min).

This needs the OpenFAST integration patches of this branch (patch 0009), which apply to the pinned base 2895884d2.

CD_CalcOutput takes the optional CalcWriteOutput argument that OpenFAST
passes to AeroDyn and BeamDyn. The integration patch of FAST_Funcs passes
WriteThisStep (or Linearize) for CableDyn, so the deck channels are
evaluated only at the steps OpenFAST writes and when it linearizes. The
tightly coupled solver calls CalcOutput two to four times per step, and
every call evaluated all channels.

The loads are evaluated as before. A supercycled call that needs the
channels when the cached loads were taken without them re-evaluates
(chan_cached, cleared with loads_cached). The committed-step .CD.out row
evaluates its own channels when the call skipped them.

IEA-15 MW lazy-wave deck, 17 stations with torsion channels, DT 0.025,
DT_Out 0.05, 400 s: channels 53.1 s -> 12.6 s, simulation CPU 6.33 ->
5.68 min. The .out and .CD.out are identical to dev, bit for bit, at
DT = dtM, supercycled (dtM = 2 DT) and after a checkpoint restart.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
…t reference

twist_reference formed the 12 x 12 Hessian of the torque-tension coupling
term (element_stretch) on every call, also for the residual, which
discards it. CD_HermiteTorsion_Stretch_Derivatives takes the optional
want_hess and the residual path passes .FALSE.; the length and gradient
are formed by the same operations either way.

assemble_twist keeps, per element away from a rigid end, the inputs that
twist_reference reads there (the element's 12 DOFs, the reference unit
tangents of its nodes, tw_beta, l0, the coupling, the quadrature order)
and its results (rho, beta, g). A residual-only assembly takes the results
when every input is bitwise the memo's. In OpenFAST every output call
transfers the fairlead kinematics with Set_Torsion_Frames, which assembled
the twist of every element at the committed shape; all elements but the
end ones now hit from the second call of a step on.

IEA-15 MW lazy-wave deck, 237 elements with torsion, DT 0.0125, 400 s,
operating rotor, one thread: 9.79 -> 9.41 min (stretch Hessian) -> 9.00
min (memo), overlay 37.1 -> 15.9 s. The .out and .CD.out data are
identical to the parent commit, bit for bit.

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 Dec 3, 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-12-03T21:02:20.570588Z 3fd9980 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

📖 10 files modified


Preview · build overview · CableDyn · built Dec. 3, 2026, 9:01 p.m. UTC

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 3fd9980c71

ℹ️ 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 cc8fad2 into dev Dec 3, 2026
25 of 26 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the perf/coupled-cost branch December 4, 2026 04:21
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