Repository navigation
fix: stop a coupled run whose SeaState grid misses its line nodes - #193
Conversation
In OpenFAST, the line nodes take their wave and current kinematics from the SeaState grid. A node outside the grid gets the kinematics of the nearest boundary point, out of phase beyond a half-width and too strong below Z_Depth, and CableDyn only warned once and ran on. A grid with NX = 2 or NY = 2 (three points across that axis) under waves that vary along the axis passed silently, although SeaState then interpolates across a large part of a wavelength: under waves along y, a grid with NY = 2 and a half-width near half a wavelength gives the lines between its points nearly the kinematics of y = 0. Both now stop the run by default. The coverage check runs at the static start and at every CableDyn step, and its message gives the time and, line by line, the number of nodes outside with the deepest and the shallowest of them. The resolution check runs at the start: it reads the directions of SeaState's wave components (the spread of WaveDirMod 1, the component directions of WaveMod 7, WaveDir for WaveMod 6), takes a direction as along an axis within 1e-4 deg, and stops when line nodes in the water lie between the grid points across a coarse axis. NY = 2 under waves along x and NX = 2 under waves along y still run. OPTIONS waveGridCheck warn turns both into warnings; error is the default. The rules live in a new core module, CableDyn_WaveGrid, tested without OpenFAST (test_wave_grid, which also checks that the option reaches the coupled aggregate). The coupled cases, which stop by default and run with warn, and the bit-identity of runs that pass, are checked by validation/scripts/openfast_wave_grid_guard.py against an OpenFAST build. The release smoke case on the platform-only MD_Shared grid sets waveGridCheck warn and requires the warning. The grid check now uses a workspace sized at initialisation instead of allocating every step. Runs that pass the checks give the same results, bit for bit. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The resolution check exempted a node in the water within 1 % of the grid spacing of a grid line across the coarse axis. On a coarse axis that spacing is the half-width, so the exemption could reach several metres: under an oblique sea a node 9 m off y = 0 is already wrong in phase by k 9 sin(beta), which the grid cannot represent, and the check ran only at the start, while the sea sways the lines off the grid line during the run. The hull's Morison members read the same grid and are interpolated across the axis too, which CableDyn cannot see node by node. The check now stops the run (one warning under waveGridCheck warn) whenever the grid has NX = 2 or NY = 2 under waves that vary along that axis and the lines sample the grid in the water at all, and its message lists those nodes by line. CD_WaveGrid_Off_Vertex, which only this exemption used, is removed with its tests. The coupled check requires that a line along y = 0 is now reported with the others. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
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 |
|
📖 7 files modified
Preview · build overview · CableDyn · built Dec. 2, 2026, 7:50 a.m. UTC |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c09e755522
ℹ️ 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".
For externally supplied wave kinematics (SeaState WaveMod 6) the guard took the sea's direction from WaveDir, which SeaState does not use in that mode: the heading lives in the supplied grid data. A valid field travelling along y on an NX = 2 grid then stopped at initialisation because the unused WaveDir was 0, and a crossing field could pass on an unrelated WaveDir. With WaveMod 6 a coarse axis (NX or NY = 2) is now judged from the supplied WaveVel and WaveAcc themselves: the run stops when they differ between the three grid points across that axis by more than 1e-5 of their largest magnitude, and a field that is the same along the axis passes. A non-finite value counts as differing. The rule is a pure function in CableDyn_WaveGrid (CD_WaveGrid_Field_Varies) with unit tests, and the coupled guard script gains two WaveMod 6 cases written from an Airy wave with WaveDir left at 0: at 30 deg on NY = 2 it stops by default and runs with waveGridCheck warn, at 0 deg it runs. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
Summary
In OpenFAST, the line nodes take their wave and current kinematics from the SeaState grid. Two grid problems used to pass with at most one warning:
Z_Depth.NY = 2under waves that are not along x (orNX = 2under waves not along y, or either under a short-crested sea) leaves three points 1 half-width apart across that axis. SeaState then interpolates across a large part of a wavelength or more, so lines and hull members between the points get the wrong amplitude and phase. Nothing warned about this.Both now stop the run by default. A new option turns them back into one warning.
waveGridCheck(wave_grid_check)error,warnerrorerrorstops the run with a message naming the time and, line by line, the nodes concerned;warnwarns once and runs on with SeaState's kinematicsBehaviour
WaveDirArrwhereWaveElevC0is nonzero, soWaveDirMod 1spreads andWaveMod 7component directions are covered; For externally supplied kinematics (WaveMod 6), which have no components and for which SeaState does not useWaveDir, the suppliedWaveVelandWaveAccare compared across the three grid points of the coarse axis instead (withinNY = 2under waves along x andNX = 2under waves along y still run: the field does not vary across the coarse axis there..outand.CD.outrows, byte for byte, asdev. The grid check now uses a workspace sized at initialisation instead of allocating at every step.MD_SharedSeaState file covers only the platform and now stops until its grid is enlarged, asdoc/tutorial_openfast.rstdescribes. The release smoke run of that case setswaveGridCheck warnand requires the warning in its log, since it tests the executable, not line loads.Implementation
src/CableDyn_WaveGrid.f90(new): the rules as pure functions of plain numbers (direction along an axis, coarse axes for a set of component directions), so they are unit-tested without OpenFAST.src/openfast/CableDyn_OF.f90:check_wavefield_grid(coverage, every step) andcheck_wavefield_resolution(at Init), both reporting by line; the option reaches the coupled aggregate through the deck driver.doc/options.rst,doc/openfast.rst,doc/troubleshooting.rst,doc/tutorial_openfast.rst,examples/cabledyn_options_reference.dat,CHANGELOG.md.Tests
tests/test_wave_grid.f90(ctestwave_grid): the direction rule (both senses, tolerance edge, non-finite), coarse axes for long- and short-crested sets, the data rule for supplied kinematics (zero, along-axis, crossing, round-off, NaN, single point), and the option reaching the coupled aggregate.validation/scripts/openfast_wave_grid_guard.py, against an OpenFAST build at the pinned commit: a line outside the grid,NY = 2at 30 deg, a short-crested sea withNY = 2, and a line that leaves the grid mid-run each stop by default and run underwarn;NY = 2at 0 deg andNX = 2at 90 deg run without a message; passing runs are byte-identical todev.Checks
ctest -L fortran -LE slow, default OpenBLAS kernelOPENBLAS_CORETYPE=Prescottctest -L python-fcheck=all:wave_grid,deck_driver,openfast_aggregate,openfast_aggregate_touchdown,openfast_shell-fcheck=allafter theWaveMod 6change:wave_grid,deck_driver,openfast_aggregateopenfast_wave_grid_guard.pyon an OpenFAST build of this branch (incl. twoWaveMod 6cases)dev53c9027.outand.CD.outrowssphinx-build -W --keep-going,test_documentationChecklist
pre-commit run --all-filespassesctest --test-dir build --output-on-failurepassespython -m pytest tests python/testspasses (if Python or validation records changed)[Unreleased](heading added if missing) for user-visible changesdoc/updated for changed inputs, options, or outputsfeat:,fix:,docs:, ...)git commit -s) under theDeveloper Certificate of Origin