Skip to content

fix(waves): a MoorDyn-C mean level is added to the elevation alone - #104

Merged
SMI-Lab-Inha merged 1 commit into
devfrom
fix/wavekin-mean-level
Nov 8, 2026
Merged

SMI-Lab-Inha merged 1 commit into
devfrom
fix/wavekin-mean-level

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

A mean level in a MoorDyn-C kinematics file is now handled as MoorDyn-C handles it. This covers a non-zero omega = 0 row of wave_frequencies.txt (WaveKin 7) and the mean of wave_elevation.txt (WaveKin 3).

  • MoorDyn-C: the level is added to the elevation alone. The wave numbers stay those of WtrDpth, and the Wheeler stretching maps the water under the total elevation (SpectrumKin::getWaveKin, fillWaveGrid and WaveGrid::getWaveKin of v2.7.2).
  • CableDyn until now: it took the wave numbers at WtrDpth plus the level and measured z from that raised level, as it does for a WaterKin record.
  • WaterKin WaveKinMod 1: unchanged. Its mean still raises the still-water level. The docs now say that MoorDyn-F drops the mean (and the Nyquist bin) of such a record.

CD_Component_Wave_Kinematics takes an optional eta_offset: a steady level added to the surface the stretching maps.

Checks

A new wavekin_modes case (tests/data/wavekin_mdc_mean) runs MoorDyn-C v2.7.2, built here, through validation/scripts/wavekin_mdc_probe.cpp. The WaveKin 7 file has a 0.8 m level under six components in six directions; the WaveKin 3 file is the shared record raised by 0.8 m. Water depth is 50 m.

Case This change Before (negative control)
WaveKin 7, 40 points: elevation 1.0e-8 m 7.7e-3 m
WaveKin 7: velocity, acceleration (of scale) 1.1e-8, 5.9e-9 9.7e-3, 6.5e-3
WaveKin 3, 12 grid points: elevation 3.0e-7 m 2.2e-4 m
WaveKin 3: velocity, acceleration (of scale) 9.4e-5, 1.1e-4 6.0e-3, 6.6e-3

The WaveKin 3 remainder is MoorDyn-C's grid interpolation; the zero-mean case shows the same.

  • The v2.7.2 build reproduces the stored v2.7.1 references of tests/data/wavekin_mdc to 1e-16. wavekin_moordyn_c_reference.py regenerates both folders and reproduces the committed rows.
  • All 53 shipped example decks give byte-identical output to dev. That includes moordynC_wavekin, whose mean row is zero.
  • CTest 365 of 365, with no compiler warnings; pytest passes; Sphinx -W -n builds.

Results change only on WaveKin 3 and WaveKin 7 decks whose mean level is not zero. The CHANGELOG entry is in this PR.

A non-zero omega = 0 row of wave_frequencies.txt (WaveKin 7), or the mean of
wave_elevation.txt (WaveKin 3), is now added to the elevation alone, as
MoorDyn-C does: the wave numbers stay those of WtrDpth, and the Wheeler
stretching maps the water under the total elevation. CableDyn took the wave
numbers at WtrDpth plus the level and measured z from it. The mean of a
WaterKin WaveKinMod 1 record still raises the still-water level; the docs now
say that MoorDyn-F drops it.

CD_Component_Wave_Kinematics takes an optional eta_offset, a steady level in
the surface the stretching maps.

A new wavekin_modes case runs both files with a 0.8 m level against MoorDyn-C
v2.7.2, with six WaveKin 7 components in six directions. WaveKin 7 matches to
1e-8 of its scale, where the previous rule was 7.7e-3 m off in elevation and
1e-2 in velocity. WaveKin 3 matches to the existing grid tolerances, where it
was 6e-3 off in velocity.

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 Nov 8, 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-11-08T00:30:27.016078Z b2e6385 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

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35726270 | 📁 Comparing b2e6385 against latest (3d04008)

  🔍 Preview build  

19 files changed · ± 19 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: b2e638594c

ℹ️ 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 af95000 into dev Nov 8, 2026
22 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/wavekin-mean-level branch November 8, 2026 02:18
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