Skip to content

fix(openfast): sample the SeaState grid where the nodes are at the sample time - #197

Merged
SMI-Lab-Inha merged 3 commits into
devfrom
fix/grid-sample-positions
Dec 3, 2026
Merged

SMI-Lab-Inha merged 3 commits into
devfrom
fix/grid-sample-positions

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Why

CD_UpdateStates samples the SeaState wave field at the end of the mooring interval, t + DT. The node positions it reads, however, are those of the last commit, the start of that interval. On the grid route every node therefore took its kinematics one CableDyn step behind where it is, a phase error of $k,v,\Delta t_M$. The node-wise route (#194) already advances its evaluation points to the sample time.

What

  • Grid route samples where the nodes are at the sample time. advance_sample_positions keeps each node's positions at the last two distinct commit times. It advances the committed position to the sample time by that velocity (CD_WaveGrid_Advance):

    $$x_s = x_n + \frac{x_n - x_{n-1}}{t_n - t_{n-1}},(t_s - t_n)$$

    The first sample, which has no history, takes the positions as read. A retry or rewind restarts the history.

  • Checkpoint. The history travels in the OtherState with the held fluid fields, so a restarted run continues bit for bit.

  • Wave-grid guard. The coverage guard, the resolution check, the per-line report and the out-of-grid provenance record now read the positions actually sampled. A node that a step's motion carries out of the grid is found at that step.

Results

Grid-route results change at the level of the lag, by design:

Case Change
r-test chain mooring of the OpenFAST tutorial (Hs 6 m, Tp 12 s, 60 s, dtM 0.025 s) fairlead-tension std within 0.001 %; largest tension difference 196 N (0.001-0.002 std)
Wave-grid guard cases (1 s; 60 s mid-run case) std within 0.01 %; largest fairlead-tension difference 184 N on a std of 840 kN; the mid-run case stops at 4.15 s, one mooring step earlier, at the step whose sample position is the first outside the grid
Chain and lazy-wave cable mooring, dtM 0.0125 s, 300 s std of fairlead tension, cable tension, curvature, twist and torque within 0.001 %
IEA-15 MW operating in turbulent wind (10 m/s), chains + lazy-wave cable, DT 0.0125 s, statistics over 200-400 s std within 1.4 % (largest: cable inclination and hang-off curvature). The controlled rotor amplifies any small change on this short window: the 0.4.3 release exe (single precision) differs from the same model's gfortran double build by up to 4 %.

Checks on this branch, rebased on #194:

Check Result
Fortran fast tier, OpenBLAS Prescott and Haswell kernels 350/350 each
Coupled restart from a 60 s checkpoint (IEA-15 MW, chains + lazy-wave cable, controller off) .out and .CD.out identical to the continuous run, bit for bit
test_wave_grid positions read at one time and sampled at another advance exactly for nodes at constant velocity

validation/scripts/openfast_wave_grid_guard.py compares byte for byte against a reference build; that reference now needs the same sampling, since an earlier build differs by design.

…mple time

CD_UpdateStates samples the wave field at the end of the mooring
interval (t + DT), but the positions it reads are those of the last
commit, the interval's start, so the grid route took every node's
kinematics one CableDyn step behind it: a phase error of k v dtM. The
node-wise route already advanced its nodes from the time the positions
belong to (f852696).

The grid route now does the same. advance_sample_positions keeps each
node's positions at the last two distinct commit times and samples
SeaState at the committed position advanced to the sample time by that
velocity (CD_WaveGrid_Advance); a retry or rewind restarts the history,
and the first sample, without one, takes the positions as read. The
history travels in the checkpoint with the held fields, so a restarted
run continues bit for bit. The wave-grid guard still checks the
committed positions, and the provenance record is unchanged.

Grid-route results change at the level of the lag, by design:
- r-test chain mooring of the OpenFAST tutorial (Hs 6 m, Tp 12 s, 60 s,
  dtM 0.025 s): fairlead-tension std within 0.001 %, largest tension
  difference 196 N (0.001 to 0.002 std);
- the wave-grid guard cases (1 s; 60 s mid-run case): std within
  0.01 %, largest fairlead-tension difference 184 N on a std of 840 kN;
- a chain and lazy-wave cable mooring at dtM 0.0125 s, 300 s: the std
  of fairlead tension, cable tension, curvature, twist and torque
  within 0.001 %, the largest differences at the last printed digit
  (5 N of fairlead tension, 1e-7 1/m of curvature).
test_wave_grid checks that positions read at one time and sampled at
another are advanced exactly for nodes at constant velocity. The guard
script's byte-for-byte comparison now needs a reference build with the
same sampling; an earlier build differs by design.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The grid route now samples SeaState at the nodes' positions advanced to the
sample time, but the coverage guard, its message and the provenance record
still read the committed positions of the step's start. A node that a step's
motion carried out of the grid was sampled there without a finding. The guard,
the resolution check, the per-line report and the out-of-grid record now use
the positions sampled; the node-wise route reports the positions read, as
before.

On the guard cases the running and warned runs give the same data rows, bit
for bit, as the build before this change; the mid-run case stops at 4.15 s,
one mooring step earlier than at 4.175 s, the step whose sample position is
the first outside the grid.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
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-03T19:37:33.547893Z 00fa62e 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 00fa62e39a

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

@read-the-docs-community

Copy link
Copy Markdown

📖 10 files modified


Preview · build overview · CableDyn · built Dec. 3, 2026, 7:38 p.m. UTC

@SMI-Lab-Inha
SMI-Lab-Inha merged commit ae9f9b4 into dev Dec 3, 2026
25 of 26 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/grid-sample-positions 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