Repository navigation
perf: channels only on written steps; cheaper nodal-twist residual and output transfer - #198
Conversation
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>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
📖 10 files modified
Preview · build overview · CableDyn · built Dec. 3, 2026, 9:01 p.m. UTC |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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:
CD_CalcOutputtwo 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 everyDT_Out.twist_reference, 28 % inclusive).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_CalcOutputtakes the optionalCalcWriteOutputargument OpenFAST already passes to AeroDyn and BeamDyn.0009passesWriteThisStep .or. Linearizefor 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.chan_cached, cleared withloads_cached).Torsion kernel
CD_HermiteTorsion_Stretch_Derivativestakes an optionalwant_hess; the residual path passes.FALSE.. The length and gradient are formed by the same operations either way.assemble_twistkeeps a memo per element away from a rigid end. It holds the inputstwist_referencereads there and its results:tw_beta,l0, the coupling, the quadrature order;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.outand.lindata are identical todev(ae9f9b4), bit for bit:dev's)openfast_lin_ab.py(IEA-15 UMaine twin decks, CableDyn vs MoorDyn).linfile identical todev's apart from its time stampCPU time on the operating deck (400 s, one thread, gfortran):
devbefore these changesOn 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 base2895884d2.