Repository navigation
fix(openfast): sample the SeaState grid where the nodes are at the sample time - #197
Conversation
…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>
|
@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. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
|
📖 10 files modified
Preview · build overview · CableDyn · built Dec. 3, 2026, 7:38 p.m. UTC |
Why
CD_UpdateStatessamples 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 ofWhat
Grid route samples where the nodes are at the sample time.
advance_sample_positionskeeps 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):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:
Checks on this branch, rebased on #194:
.outand.CD.outidentical to the continuous run, bit for bittest_wave_gridvalidation/scripts/openfast_wave_grid_guard.pycompares byte for byte against a reference build; that reference now needs the same sampling, since an earlier build differs by design.