Skip to content

feat: evaluate SeaState's wave components at the line nodes; provenance record - #194

Merged
SMI-Lab-Inha merged 39 commits into
devfrom
feat/seastate-nodewise-kinematics
Dec 3, 2026
Merged

SMI-Lab-Inha merged 39 commits into
devfrom
feat/seastate-nodewise-kinematics

Conversation

@SMI-Lab-Inha

@SMI-Lab-Inha SMI-Lab-Inha commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Why

In a coupled OpenFAST run, CableDyn lines take their wave kinematics from SeaState's grid, which SeaState interpolates in space (Catmull-Rom cubic). Covering a long power cable or mooring footprint with a fine grid costs memory: SeaState's start-up peak is about three times the stored arrays, which is 15-16 GB for a 900 m grid at 12.5 m spacing. An oblique or short-crested sea needs a fine grid along both axes, which is often not feasible at all. #193 made CableDyn stop when the grid cannot carry the waves. This PR gives the lines a route that needs no grid, and it records what each run did.

What

Node-wise wave route: OPTIONS SEASTATE_SPECTRAL WaterKin

  • The lines evaluate SeaState's own first-order wave components (WaveElevC0, WaveDirArr, WaveDOmega, its wave numbers) at the line nodes.
  • Each node evaluates the components once per wave step, at its position advanced to the middle of the step. Between wave steps, cubic Hermite polynomials with the exact time derivatives interpolate the values.
  • SeaState conventions reproduced: the phase convention, the normalisation, the Nyquist weight, the finite-depth transfer (written in overflow-safe forms), every stretching mode (WaveStMod 0/1/2/3, Wheeler included), and analytic CurrMod = 1 current.
  • Truncation: waveKinTol (default 1e-6) lets each node drop the components whose velocity and acceleration variances stay within that fraction of the totals at every depth the node reaches. The bound is relative to the node's own depth, not the surface. The dropped variances are written per node to <root>.CD.wavekin.out.
  • Fails closed with a named message on second-order kinematics, WaveMod = 6, WvCrntMod 1 or 2, CurrMod = 2, a WaveTimeShift with waves, and more than 100000 components.
  • SEASTATE_GRID, SEASTATE and a deck without a WaterKin row keep the grid route unchanged (bit for bit).

Provenance record

  • Every OpenFAST, FAST.Farm and standalone run writes <RootName>.CD.provenance.json (<FarmRoot>.FarmCD.provenance.json, <out_root>.CD.provenance.json), schema cabledyn.provenance/1. It holds:
    • the host;
    • the wave route;
    • the sea: WaveMod, direction, wave step and period, depth, and an FNV-1a fingerprint of the components;
    • the grid and the waveGridCheck mode;
    • per line, the guard's findings: the nodes outside the grid, the deepest and shallowest of them, and the weighted velocity ratio at the shallowest one;
    • the variances the node-wise route drops.
  • It is written at the start and replaced in one step at the end, as complete, or as stopped after an error, including a stop by the guard at initialisation.
  • A checkpoint carries the record, so a restarted run writes the same record apart from restarted_from.

Tools and docs

  • integration/openfast/cabledyn_preflight.py checks a case before it runs:
    • line ends and hull joints against the grid, with a margin for platform motion;
    • NX/NY = 2 under a sea that varies along that axis;
    • the amplitude the grid keeps at the shortest wavelength that matters;
    • SeaState's memory and start-up peak;
    • whether SEASTATE_SPECTRAL takes the case.
  • integration/openfast/cabledyn_logscan.py lists, per run and line, what the guard found. Each log takes only its own run's record.
  • Docs: options, outputs (the record and its status rules), theory (the node-wise sums and truncation), the OpenFAST page (cost), the tutorial and examples README, and FAQs: why a coupled run stops where MoorDyn ran, MoorDyn parity, hull shielding.
  • Fix: the FAST.Farm shared-mooring instance now gets HostComplete (patch 0023), so its record reads complete after a normal end.

Checks

Check Result
Fast and Python ctest tiers, both BLAS kernels 403/403
Debug driver tier, both kernels 193/193
tests/test_wave_nodewise.f90 Airy theory for a few components at several depths, time derivatives against central differences (also under Wheeler), the four stretching modes, Hermite exactness and its (ω dt)^4/384 bound, truncation
openfast_wavekin_vertex.py: node-wise vs SeaState's grid at its vertices max relative difference about 4e-7 (single-precision FFT round-off)
openfast_wave_grid_guard.py: every stop/warn/pass case incl. WaveMod 6 pass; grid-route rows bit-identical to before; records stopped / complete as expected
openfast_wavekin_route.py: restart at 10 s on both routes continues bit for bit; records equal but for restarted_from
Weighted velocity ratio one component against sqrt(cosh 2k(z+h) / cosh 2kh), JONSWAP against a direct sum; guard cases read 0.19 (shallowest outside node at -41.9 m) and 0.47-0.50 (at -14.6 m)
waveKinTol on the r-test (Hs 6 m, Tp 12 s, 242 components) fairlead-tension std shift against keeping every component: 0.002 % at 1e-4, 0.0007 % at 1e-5, 0.0002 % at 1e-6
Sphinx -W, pre-commit pass

Cost: 1 h of sea, 600 nodes, 2407 components, on a machine shared with a 16-job campaign:

  • 360-421 components are kept per node at 1e-4 to 1e-6, taking 77-95 s, or about 6-7 % of a coupled hour.
  • Evaluating the components takes 77.4 of 78 s.
  • In deep water (h = 1000 m, every component kept), sending exponents below -708 to zero cut the time from 790 to 466 s with results equal to 10 digits.

Validation against a converged grid

Both cases pass. The solver code is that of 62f5255; the two later commits change only the validation script and a test.

Case Reference Worst tension Worst curvature Fairlead tension Result
V2: DLC 1.2 shortest Tp (Hs 1.84 m, Tp 7.44 s), 3600 s λ/10 grid; its halving agrees to 0.000 % on every channel std 0.21 %, DEL 0.26 % (Ten4N81) std 0.51 %, DEL 0.42 % (Curv4N93, Curv4N117) std ≤ 0.030 % PASS
V3: the same sea at 30 deg, 1200 s per-axis λ/10 grid cut at the 1e-5 depth-decay ratio; its halving along x agrees to 0.000 % std 0.30 %, DEL 0.31 % (Ten4N55, Ten4N93) std 0.41 %, DEL 0.44 % (Curv4N117) std ≤ 0.14 % PASS

Criteria: std 1 %, DEL 2 %, p99 3 %. Twist and torque are reported apart: worst std 0.05 %, DEL 0.20 %.

The first V3 reference, cut at the 1e-4 decay ratio, gave a 1.0-1.35 % tension-std gap at nine stations. It had lines outside its depth footprint, which the new grid check flags. At the 1e-5 cut, all four lines are within the 3.16e-3 footprint ratio, and the gap closes to 0.16-0.30 %, with the node-wise file unchanged. The gap was the reference's depth cut, not the node-wise route.

In a coupled OpenFAST run the lines take their waves from the SeaState
grid. A grid fine enough for the lines over the whole mooring costs tens
to hundreds of gigabytes under an oblique or short-crested sea, and a
coarse one interpolates across a large part of a wavelength. SeaState
builds its grid from its own first-order wave components, which stay in
its WaveField: summed at the nodes, they give the same field without a
grid.

OPTIONS SEASTATE_SPECTRAL WaterKin takes that route. The new core module
CableDyn_WaveNodewise sums the components (WaveElevC0, WaveDirArr,
SeaState's own wavenumbers in EffWtrDpth) in the convention of
SeaState's inverse FFT, with every WaveStMod reproduced, the Nyquist and
zero-frequency terms, and depth factors that do not overflow in deep
water. Each node evaluates the components once per wave step at its
position advanced to the middle of the step and interpolates by cubic
Hermite polynomials with the exact time derivatives (including the
motion of the Wheeler depth). OPTIONS waveKinTol (default 1e-4) lets a
node drop, in order of wavenumber, the components whose velocity and
acceleration variances each stay within that fraction of their surface
totals, tabulated by depth so that the bound holds wherever the node
can reach; the kept components and dropped variances are written per
node to <root>.CD.wavekin.out. The steady current is SeaState's CurrMod 1
profile at the node, and a dynamic current field is read as SeaState
reads it. A checkpoint carries each node's values for its wave step.
Second-order kinematics, WaveMod 6, WvCrntMod 1 or 2, CurrMod 2 and a
WaveTimeShift stop the run with a message naming SEASTATE_GRID; the C
API refuses the route. SEASTATE, SEASTATE_GRID and a deck without a
WaterKin row keep the grid, bit for bit.

cabledyn_wavekin_check, built in the OpenFAST tree (patch 0006), compares
the route with SeaState's grid at its vertices and wave steps:
validation/scripts/openfast_wavekin_vertex.py passes eleven cases
(long-crested at 0, 30 and 90 deg in 50, 200 and 1000 m of water,
short-crested, regular, constrained, WaveStMod 1 to 3, and FAST.Farm's
Mod_WaveField 2 shift) with differences of at most 1.4e-6 of the grid's
largest value, the round-off of SeaState's single-precision FFT.
validation/scripts/openfast_wavekin_route.py checks the coupled route:
fairlead tensions within 0.4 % of the grid route on a grid valid for the
lines, a 30 deg sea on the platform-only grid, a restart that continues
bit for bit, and the refusals. test_wave_nodewise checks the sums
against Airy theory, the derivatives, the stretching modes, the Hermite
error bound and the truncation.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
A coupled run's outputs do not say which sea the lines saw, by which
route, or what the wave-grid guard found once a warning has scrolled
past in the log. Every OpenFAST, FAST.Farm and standalone run now
writes <RootName>.CD.provenance.json (<FarmRoot>.FarmCD.provenance.json,
<out_root>.CD.provenance.json): JSON of schema cabledyn.provenance/1
with the CableDyn version, the host, the wave route, SeaState's sea
(WaveMod, direction and spreading, wave step and period, effective
depth, waveKinTol, number of components and a 64-bit FNV-1a fingerprint
of WaveElevC0, WaveDirArr and WaveDOmega that identifies the sea
exactly), the SeaState grid and the waveGridCheck mode on the grid
route, and per deck line the out-of-grid record (largest node count,
first time, deepest and shallowest node), the resolution flag and the
largest velocity and acceleration variance fractions the node-wise
route drops. Values a host does not pass are null. The standalone
driver fills the sea from its waves row.

The record is written with status init after initialisation and
replaced in one step (MoveFileEx or rename) at the end, with status
complete after a normal end and stopped otherwise. A checkpoint carries
the record's run state after the node-wise cache, so a run restarted
from a checkpoint writes the same record as the uninterrupted one but
for restarted_from, the checkpoint time. Under waveGridCheck warn the
coverage check now goes on silently after its one warning for the
record, and the warning flag is carried through a checkpoint, so a
restart no longer repeats it; the grid-route results are unchanged bit
for bit and the default error mode is untouched.

test_provenance checks the fingerprint against reference values and
the JSON entries; test_provenance_sidecar.py runs the standalone driver
on still water, a JONSWAP sea and a run that fails after parsing; the
restart case of openfast_wavekin_route.py compares the records of a run
restarted at 10 s and the uninterrupted one, on the node-wise route and
on the grid route under waveGridCheck warn. The record is described in
doc/outputs.rst.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The wave-grid guard stops a coupled run whose lines leave the SeaState
grid or sample a grid with NX or NY = 2 under an oblique sea, but only
once OpenFAST has started, and SeaState may first spend minutes and
gigabytes building that grid. A campaign of many cases needs both
answers before it starts, and a summary of what the guard found after.

integration/openfast/cabledyn_preflight.py (standard library only)
reads the .fst, its SeaState and HydroDyn files and the CableDyn deck
and reports: the line ends and the hull's Morison joints against the
grid, with a margin for the platform motion; NX or NY = 2 under a sea
that varies along that axis; the amplitude SeaState's Catmull-Rom
interpolation keeps midway between grid points at the shortest
wavelength that matters (the highest frequency up to WvHiCOff with at
least 1 % of the peak spectral density); the memory SeaState stores and
its start-up peak; and whether WaterKin SEASTATE_SPECTRAL takes the
case, with a hull-only grid for that route. It exits with 1 when the
run would stop. The peak factor 3 rounds up the measured slope, 2.95,
of SeaState's peak working set against its stored arrays over four
grids of 21 MB to 270 MB.

integration/openfast/cabledyn_logscan.py reads OpenFAST logs, wrapped
as OpenFAST prints them, and lists per run the wave route, whether it
ended normally, and per line the nodes outside the grid (count, first
time, deepest and shallowest node) and the resolution finding; a
provenance record beside a log is preferred, since under waveGridCheck
warn it covers the whole run. --csv writes one row per run and line.

test_openfast_preflight_logscan.py runs both on synthetic cases. Both
tools are described in doc/openfast.rst with the memory formula.

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

Two questions a MoorDyn user meets first in a coupled run. A CableDyn
deck without a WaterKin row takes SeaState's field at its lines, while
MoorDyn without WaterKin keeps them in still water, and with SeaState
WaterKin MoorDyn reads the boundary kinematics outside the grid and
interpolates NX or NY = 2 across an oblique sea without a check. The
answer names the three ways on: SEASTATE_SPECTRAL, a grid over the
lines (sized with the pre-flight checker), or SEASTATE_GRID with
waveGridCheck warn to give the lines what MoorDyn's get, for comparing
the line models alone. The second answer states that neither wave route
applies the hull's diffraction, radiation or wake to the lines, and that
a line should start at the exit of an I-tube so that no node lies inside
the hull.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
Measured with the node-wise kernel alone on one core (gfortran -O3,
baseline x86-64): a one-hour sea of 2407 JONSWAP components (Tp 7.65 s,
WaveDT 0.2 s) at 600 nodes on three catenaries and a cable in 200 m of
water. At the default waveKinTol 1e-4 the nodes keep 73 components on
average and the sums take 14 s, about 1 % of a one-hour coupled run of
20 to 25 minutes; with 974 components the sums take 165 s when every
component is kept and 14 s at 1e-4.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
openfast_wavekin_compare.py reads the CableDyn records of the same
coupled case run on a converged SeaState grid and with WaterKin
SEASTATE_SPECTRAL, and compares per channel, after the start-up
transient, the standard deviation (within 1 %), the rainflow
damage-equivalent range (within 2 %) and, for the channels named, the
99th percentile of the absolute value (within 3 %), the thresholds
fixed before the validation runs. It exits with 1 on a failed
comparison and writes the table as CSV.

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

FAST.Farm told each turbine's CableDyn instance that the run had ended
normally before FARM_End, but not the farm-level instance of the
shared moorings (MooringMod = 5), so that instance always ended as if
on an error and its provenance record read "stopped" after a normal
end. The farm-level instance now gets the same flag; an abort still
ends it without.

Checked on the r-test FAST.Farm MD_Shared case with CableDyn for the
shared moorings (4 s): FAST.Farm.FarmCD.provenance.json reads
"complete".

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The tutorial and the example README enlarge the r-test SeaState grid to
reach the anchors. They now also give the other way: keep the platform
grid and set SEASTATE_SPECTRAL WaterKin, so that the lines take the
wave components at their nodes while the hull's Morison members read
the 100 m grid, and they point to the pre-flight checker for the memory
of either choice. The WaterKin row of the example deck lists the new
values.

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

The pre-flight checker evaluated SeaState's Catmull-Rom mid-cell
amplitude, 9/8 cos(phi/2) - 1/8 cos(3 phi/2), at any spacing, so a
spacing over half a wavelength, where the grid points alias the wave,
could read as keeping a quarter of it (23.8 % for the 100 m r-test grid
under a 41 m wavelength along x). It now keeps nothing from half a
wavelength on.

The check also takes SeaState's DEFAULT JONSWAP peak shape (from
Tp/sqrt(Hs), as SeaState sets it) instead of 3.3, and reports the
amplitude kept at the peak wavelength beside that at the shortest
wavelength that matters, so that a grid that aliases only the faint
high-frequency tail, as the 25 m grid of the tutorial does, is not
read as a grid that loses the sea. The log-scanner test no longer reads
a provenance record left by an earlier run of itself.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The log scanner took a run's end only from OpenFAST's own words, so a
FAST.Farm log, which ends "FAST.Farm terminated normally" or "Aborting
FAST.Farm", read as ended "unknown". It also took the wave route only
from the initialisation line, which a run restarted from a checkpoint
does not print again. It now reads both hosts' endings and, when the
log names no route, takes it from the provenance record beside it.
Checked on the logs of the route script's runs and a short FAST.Farm
shared-mooring run; the synthetic test covers both cases.

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

A coupled run that the wave-grid guard stopped during initialisation
(nodes outside the grid, or NX or NY = 2 under a crossing sea) left its
provenance record with status "init": the guard wrote the record at
the stop, but OpenFAST does not reach CD_End after a failed
initialisation, where "stopped" is written. The guard now writes
"stopped" itself when its finding stops the run; a warning still
rewrites the record as "init". doc/outputs.rst states when each status
is written and that a coupled run stopped on another initialisation
error writes no record.

Checked with openfast_wave_grid_guard.py: the four stopped cases read
"stopped" (out of grid at initialisation, NY = 2 under an oblique and a
short-crested sea, out of grid mid-run), the warned and passing ones
"complete", and the grid route stays bit-identical to c09e755;
openfast_wavekin_route.py passes unchanged.

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

openfast_wavekin_route.py runs the grid route on the platform-only
r-test grid, which the guard stops at initialisation, and requires its
provenance record to read "stopped" with every line out of the grid.

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

A SeaState grid fine enough to be a reference for the node-wise wave
route cannot span a whole mooring in memory, but the waves die out
with depth. openfast_wavekin_converged.py size takes the node positions
from a node-wise run of the case (its <root>.CD.wavekin.out) and sets
the reference grid: the spacing a fraction (default 1/20) of the
shortest wavelength that matters at the shallowest node; half-widths
over the hull joints and the nodes above the depth where the sea's
horizontal wave-velocity variance falls to --decay (default 1e-6) of
its surface value, plus a margin; Z_Depth at that depth, the deeper
nodes taking the grid bottom's values, which are as small; and enough
cosine depth levels to keep every interval within the spacing. A
long-crested sea along an axis keeps 2 points across it. It prints the
SeaState rows and the stored memory and start-up peak of the grid and
of its halving.

prepare makes three copies of the case on that grid, so that the hull
sees the same waves in all of them: reference and halved on the grid
route (waveGridCheck warn for the deep nodes outside the grid, which
the provenance record lists) and spectral on the node-wise route, for
openfast_wavekin_compare.py.

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

waveKinTol bounded the velocity and acceleration variance a node drops
relative to their totals at the surface. A deep node sees only the
long waves, whose variance there is a small part of the surface total,
so the bound let it drop a large part of what it sees: on the r-test
chain mooring under Hs 6 m, Tp 12 s, 1e-4 moved the fairlead-tension
standard deviation by 0.66 % against keeping every component.

The truncation table now compares, at each of its 1024 depth levels,
the dropped variances with the totals of all components at that depth,
velocity and acceleration separately. A dropped component has a larger
wavenumber than every kept one and decays faster with depth, so the
dropped share of a prefix only falls with depth; a node keeps taking
the prefix of the shallowest depth it can reach, and both bounds now
hold relative to the sea at every depth it reaches. The per-node report
(<root>.CD.wavekin.out), the initialisation line and the provenance
record's dropped-variance maxima are relative to the totals at the
node's depth. The default becomes 1e-6.

test_wave_nodewise checks the bound below the shallowest reach and the
normalisation by the totals at depth. The docs (options, theory,
OpenFAST, outputs) and CHANGELOG state the depth-relative bound.

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

The log scanner took the first readable *.CD.provenance.json in a log's
folder, whichever run wrote it. In a folder with A.log, B.log and the
records of both, A's report took B's record and preferred it to A's own
log, so a clean run could read as a guard finding and the scanner exit
with 1. A record line without an "id" also raised a KeyError.

A log now takes <stem>.CD.provenance.json (or .FarmCD.) when it is named
after its run's root; otherwise the only record in its folder, unless
another log there is named after that record's root. A log of another
run takes no record and is reported from the log alone. Line entries
without a usable id are skipped. The test covers two runs in one folder,
another run's record beside a log, and an entry without an id.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
… pre-flight check

Four differences between the pre-flight checker and the run it checks:
- the memory used WaveTMax/WaveDT rounded up to an even number, where
  SeaState goes on to round NStepWave/2 up to a product of the first
  nine primes (PSF) for its FFT; the checker and the reference-grid
  sizer now take SeaState's count;
- a quoted value with spaces ("my dir/SeaState.dat") was cut at the
  first space; a quoted value is now read whole;
- a malformed HydroDyn joint table raised a bare Python error; it is now
  an input error naming the file and line (exit 2);
- second-order kinematics and WvCrntMod were listed as refusals of
  SEASTATE_SPECTRAL also without waves, which the module accepts; they
  now count only with waves, as in the module.
The synthetic test covers each.

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

Review findings on the OpenFAST module:
- sample_nodewise advanced a node from the sample time, the end of the
  mooring interval, although the positions it reads are those of the
  interval start (the last commit), so the evaluation point lagged by
  one mooring step (a phase k v dtM). The positions now carry their own
  time (sample_wavefield's t_positions, the last commit), from which
  the node is advanced and its velocity taken. The grid route samples
  the same start-of-interval positions at the interval end; it is left
  unchanged here (bit-identical), its lag is k v dtM: at dtM = 0.0125 s
  and a node speed of 1 m/s, 0.0009 rad at the peak of a Tp 7.44 s sea
  and 0.013 rad at its 3.2 rad/s cut-off.
- rebuild_from_checkpoint marked every rebuild as a restart in the
  provenance record. The same run restoring one of its own states
  (CalcSteady's operating points) is not a restart: its record now goes
  on with what the run has found and reports no restarted_from.
- at initialisation the checkpoint mirror was saved before the grid
  resolution check noted its finding in the record, so a checkpoint
  before the first mooring solve restarted without
  grid_coarse_across_waves; the mirror is saved again after the check.
- a WaveTimeShift stopped the node-wise route also without waves; it
  now stops it only when SeaState has waves.

openfast_wavekin_route.py passes: with this and the depth-relative
waveKinTol default the two routes agree within 0.12 % in fairlead-
tension standard deviation (0.36 % before both), and the restarts at
10 s continue bit for bit with equal records.

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

Review findings on the provenance writer:
- when the final move failed, <record>.tmp stayed behind; the move now
  removes the written file when it fails;
- on Windows a reader holding the old record open (a sharing, lock or
  access violation) made MoveFileEx fail at once; the move is retried
  for up to a second before it gives up;
- wave_dt and wave_tmax, which SeaState holds in single precision, were
  written with the single-precision tail (2.0000000298023224E-001); they
  are now the shortest numbers that read back to the same
  single-precision value (2.0E-001).

test_provenance checks the wave step and a record whose target is a
directory: the write fails and leaves no temporary file.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The docs called the node-wise kinematics between the grid vertices
"exact". They are the sums of the components, not an interpolation,
less what each node may drop under waveKinTol. The theory page now also
states that the free-surface elevation a node takes (for its wetting
and, under Wheeler stretching, its mapped depth) is summed over the
same kept components, and what that does to a deep node.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The reference-grid sizer gave both horizontal axes the spacing of the
wavelength along the waves. A long-crested sea at direction beta has
the wavelength lambda/|cos beta| along x and lambda/|sin beta| along y,
so each axis now takes its own spacing (and 2 points across a sea along
the other axis); the vertical keeps the spacing along the waves. The
halving check refines the axes named in --halve (x by default), and
--wave-dir and --wave-tmax size for another heading or wave period, as
for the oblique validation case.

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

Review findings on CableDyn_WaveNodewise:
- in deep water the image term exp(-k(z + 2h)) of a short wave falls
  below exp(-708), where the block exponential leaves its vector path
  for a library call per element and returns subnormals; an exponent at
  or below -708 now gives exactly 0 (under 1e-307 of the amplitude, a
  change at round-off only);
- each evaluation zeroed all 64 x 29 lane sums; it now zeroes only the
  lanes and columns it uses;
- a field with more than 100000 components (CD_NWK_MAX_COMPONENTS)
  stops with a named error that says to shorten WaveTMax or narrow the
  cut-off frequencies;
- the module header states that CD_NWK_Eval uses the field's workspaces
  and is not reentrant: one field serves one thread at a time.

test_wave_nodewise checks the component limit and a deep node whose
short wave underflows. Reference bench (1 h, WaveDT 0.2 s, 600 nodes,
2407 components, Tp 7.65 s, one core, baseline x86-64 build, machine
shared with other jobs):
- h = 1000 m, every component kept: 790 s before, 466 s after, with
  the sum of |u| over all nodes and steps equal to 10 digits;
- h = 1000 m, waveKinTol 1e-6: 100 s before and after (the kept
  components do not reach the underflow);
- time split at h = 200 m, 1e-6 (78 s): evaluations at the nodes 77.4 s
  (block sine/cosine, exponentials and lane sums), the 16 Hermite
  interpolations per node and wave step 1.6 s, the shared time phasors
  0.4 s, the per-node prefix lookups 0.03 s.

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

The provenance record's out_of_grid entry always wrote
weighted_velocity_ratio_max as null, so a reader could not tell whether
the nodes that took SeaState's boundary kinematics mattered. It is now
the rms wave-particle velocity magnitude (horizontal and vertical) at
the depth of the line's shallowest node outside the grid, over its
value at the still-water level, from SeaState's own first-order
components (amplitudes from WaveElevC0, omega_i = i WaveDOmega) with the
finite-depth Airy transfer in EffWtrDpth: per component
D1^2 + D2^2 = 2 (e^{2kz} + e^{-2k(z+2h)}) / (1 - e^{-2kh})^2, which does not
overflow and tends to e^{2kz} in deep water. The depth is the node's
own, without stretching; the ratio is 1 at and above the still-water
level. Since it only grows toward the surface it is evaluated when the
guard notes a new shallowest node, at no cost per step, and carried
through a checkpoint with the rest of the record. It works on both
routes when SeaState has components and is null without them (still
water, WaveMod 6). The guard's out-of-grid message gives the ratio at
each line's shallowest flagged node ("weighted velocity ratio 0.19 at
the shallowest node").

CD_NWK_Velocity_Ratio (CableDyn_WaveNodewise) is checked in
test_wave_nodewise against sqrt(cosh 2k(z+h) / cosh 2kh) for one
component, a direct cosh/sinh sum over a JONSWAP set, the deep-water
limit e^{kz} and the clamping at the surface; test_provenance writes a
known value. On the guard cases the r-test lines outside the 100 m
platform grid at t = 0 read 0.19 (shallowest outside node at -41.9 m)
and the line that swings out mid-run 0.47 to 0.50 (at -14.6 m); the
grid-route results are bit-identical to before. outputs.rst defines the
field, and openfast.rst shows it in the guard's message.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
With the bound relative to the variance at each node's depth, the nodes
of the reference case keep about 420 of 2407 components at the default
1e-6 (360 at 1e-4): a deep node keeps the long waves that reach it, a
node near the surface nearly all. The sums then take about 80 s per
coupled hour at 600 nodes on one core, some 6 % of the run, and the
Hermite interpolation adds 2 % to that; keeping every component takes
about 510 s.

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 2, 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-03T09:15:39.934266Z ccfe139 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

read-the-docs-community Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

📖 10 files modified


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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ceb8a215a

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

…oint

Three findings of the review of #194.

The pre-flight check stopped a case whose line ends lie outside the
SeaState grid although the deck sets waveGridCheck warn, under which
CableDyn runs on with a warning; the finding is now a note in warn mode,
as the resolution finding already was.

The hull-only grid it recommends was spaced for the shortest wavelength
at the deepest hull joint, where the short waves have decayed, so it
under-resolved the members near the surface. It is now spaced for the
shallowest wetted joint (a joint above the water counts as the surface).

The converged-grid script and the pre-flight test loaded the pre-flight
module without registering it in sys.modules, which its dataclasses need
on Python before 3.14, so both failed at import there. They register it
first.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53a869fe51

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

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cec76e712d

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

The pre-flight checker took the directions of every WaveMod 7 component
with a nonzero height when it judged NX = 2 or NY = 2, including the
components outside WvLowCOff to WvHiCOff that SeaState removes. A kept
0.5 rad/s component at 0 deg and a removed 2 rad/s component at 45 deg
stopped an NY = 2 grid that CableDyn accepts: its check at
initialisation looks only at the components SeaState keeps (nonzero
WaveElevC0). The directions are now taken within the kept band, as the
shortest wavelength already was.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbf3d49f1d

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

Comment thread src/openfast/CableDyn_OF.f90 Resolved
…s depth in the reference grid

On WaterKin SEASTATE_SPECTRAL the steps take a CurrMod 1 current at each
node's depth, but the static start still took it at SeaState's vertical
grid levels, linear between them. On the hull-only grids the route allows,
that start was in another current: with NZ = 2 over the whole depth the
1/7 power law became a straight line from the seabed to the surface, 0.5
of the surface speed at mid-depth where the profile gives 0.906, and the
run began away from its equilibrium. In a 1 m/s current on the IEA-15 MW
UMaine case the line tensions at t = 0 were up to 2.0 % from those of the
grid route on 81 levels, as on the grid route with two.

The OpenFAST shell now also samples the current for the spectral route
(seastate_static_current with nodewise): levels uniform in the seventh
root of the height above the seabed, so the power law grows by 1/200 of
its surface value from one to the next, with the seabed, the still-water
level and the near-surface knee, between which the other parts are
linear. CD_AGG_Init_From_Deck and CD_Init_Deck_Aggregate take it as
static_current_nodewise and use it in place of static_current for a deck
on that route; the checkpoint rebuild does the same. The case above now
starts within 0.08 % of the 81-level start.

openfast_wavekin_converged.py size cut the reference grid at the depth
where the waves have died out. A SeaState current varies down to the
seabed, so the grid route gave the deeper nodes the grid-bottom current
where the spectral route evaluates the profile, an error that halving the
spacing cannot remove. With a CurrMod 1 current (or a CurrMod 2 one) the
grid now keeps the whole depth, and the default halving refines z too.

Tests: test_openfast_aggregate checks that a spectral deck starts in
static_current_nodewise and a grid deck in static_current;
openfast_wavekin_route.py adds the current start (0.08 %, grid route on
two levels 2.0 %, limit 0.25 %) and a restart in that current (bit for
bit); the pre-flight test checks the whole depth and the z halving.
Release CTest 439/439 on the Prescott and Haswell kernels.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e03b49bfb

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

…decks

openfast_wavekin_converged.py set_waterkin replaced the first word of a
WaterKin row. A deck that names its WaterKin file in quotes with a space,
"water kin.dat" WaterKin, became SEASTATE_GRID kin.dat" WaterKin, which
CableDyn reads as the option kin.dat", so the reference, halved and
spectral decks could not run. A quoted value is now replaced whole, as
the pre-flight checker reads it.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83970a07e7

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

Comment thread src/CableDyn_WaveNodewise.f90 Resolved
On the node-wise route a node summed the free-surface elevation over the
components it keeps for its kinematics. Under Wheeler stretching that
elevation sets the depth z' = h (h + z)/(h + eta) - h at which the kept
components are evaluated, and a short wave too short to reach the node
still moves the surface above it. In 200 m of water under unit waves of
0.30 and 3.0 rad/s with coincident crests, a node at -30 m drops the
short wave at the default waveKinTol, and its velocity at the crest was
0.75 % off the full sum.

The elevation now has its own prefix, at least the kept one, tabulated
with it under Wheeler stretching. An elevation error d eta moves z' by
(h + z')/(h + eta) d eta and the kept velocity by its vertical gradient
times that; the prefix is the shortest for which the variance of that
error, over the kept components, is within waveKinTol of the velocity
variance at z', and likewise for the acceleration (with the dropped
elevation rate through the moving depth). Both factors fall with depth,
so the prefix of a node's shallowest mapped depth serves every depth it
reaches. Without Wheeler stretching the elevation only decides wetting
and keeps the kept prefix, as before.

test_wave_nodewise checks the case above: the elevation keeps the short
wave and the crest velocity equals the full sum within 1e-3 (both fail
before). On the IEA-15 MW UMaine case with WaveStMod 3 the fairlead and
anchor tension statistics move by at most 0.001 % and the run takes
8.9 s against 8.6 s. openfast_wavekin_route.py passes on a clean build;
Release CTest 439/439 on the Prescott and Haswell kernels.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbe4213c64

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

… that refines nothing

openfast_wavekin_converged.py size halved x by default. Under a
long-crested sea along y (WaveDir 90) x is uniform and keeps its two
points, so the halved grid equalled the reference (NX 2, NY 14, NZ 162
on the hull-sizing test case) and the comparison of the two could only
report convergence. The default now refines every horizontal axis the
waves vary along, and z with a current; a --halve that changes no
dimension stops with a message instead of preparing two equal grids.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe6ebf9a89

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

The pre-flight checker took WaveMod 7 components with different headings
as a short-crested sea, coarse on both axes, so components at 0 and 180
deg stopped an NY = 2 grid that CableDyn accepts: its check
(CD_WaveGrid_Coarse_Axes) judges each direction modulo 180 deg, and such
a sea is uniform in y. Headings now differ only when they differ modulo
180 deg, likewise for 90 and 270 deg and NX = 2.

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

Copy link
Copy Markdown

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

Reviewed commit: 62f525514b

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

openfast_wavekin_converged.py size kept the whole depth, and halved its
levels, for any SeaState current. Of a CurrMod 1 current only the 1/7
power law (CurrSSV0) varies down to the seabed, as a CurrMod 2 user
current may. The near-surface current (CurrNSV0) is zero below CurrNSRef
and the depth-independent one (CurrDIV) is the same at every depth, so
the grid-bottom value the deeper nodes take is already right below
CurrNSRef. On the IEA-15 MW validation case (near-surface current only,
CurrNSRef 20 m, 200 m of water) the rule made the reference grid NZ 105
(start-up peak 56 GB at 0 deg, 128 GB at 30 deg) where the waves need
NZ 51 down to z_cut.

The grid now keeps the whole depth, and halves z by default, only with a
power-law or user current; with a near-surface current it reaches at least
CurrNSRef.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d1a92732a

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

…letes it

openfast_wavekin_converged.py prepare replaces its reference, halved and
spectral folders by deleting them first. With --case-dir /work/reference
and --out /work it deleted the case itself and then failed to copy it
(FileNotFoundError), and an --out inside the case copied the case into
itself. Each output folder is now checked against the case before
anything is deleted: one that is the case, holds it or lies inside it
stops the run with a message.

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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ccfe139531

ℹ️ 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 dd043bb into dev Dec 3, 2026
22 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the feat/seastate-nodewise-kinematics 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