Skip to content

Conversation

@tridelat
Copy link
Collaborator

This patch fixes the following issues:

  • Add wave stretching option to regular waves
  • Deep water check done with a common function (condition k*h>89.4 to be considered deep water)
  • Wheeler wave stretching done with a common function, and corrected when mwl=/=0

@tridelat tridelat requested a review from dav-og November 24, 2025 08:26
dav-og added a commit that referenced this pull request Dec 12, 2025
PR #77 was made before a major refactor - I've ported the changes over into the relevant new locations.
dav-og added a commit that referenced this pull request Dec 12, 2025
* Port Wheeler stretching fixes from PR #77 (by tridelat)

PR #77 was made before a major refactor - I've ported the changes over into the relevant new locations.

* Improve robustness in wave kinematics utilities

- Treat non-positive/very large/infinite water depth as “effectively infinite” in is_in_deep_water() (consistent with ComputeWaveNumber()), and clarify the 89.4 kh threshold is a numerical switch (tanh(kh)≈1).
- Avoid Wheeler stretching when depth is non-physical/unbounded (≤0, inf, or very large), and guard against h + eta near zero to prevent division-by-zero.
- Add checks and small‑kh limiting forms in water velocity/acceleration to avoid sinh(kh) division‑by‑zero / NaNs as k -> 0.
@dav-og dav-og closed this in #80 Dec 12, 2025
@dav-og
Copy link
Collaborator

dav-og commented Dec 12, 2025

Thanks @tridelat ! I’ve ported your changes onto the refactored wave code here: #80.

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.

2 participants