Skip to content

301 all snapwave changes in one#302

Draft
Leynse wants to merge 137 commits into
2026.01-Galibier-Releasefrom
301-all-snapwave-changes-in-one
Draft

301 all snapwave changes in one#302
Leynse wants to merge 137 commits into
2026.01-Galibier-Releasefrom
301-all-snapwave-changes-in-one

Conversation

@Leynse

@Leynse Leynse commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

…ource term calculation instead of bin dependent eeprev_ig, thanks to suggestion of Yasmine - results look promising
…ave energy, instead of the bin one

- Works, but not sure whether it is better than snapwave_ig_opt =3
…king point when IG waves should be released

- Determined based on delta Dw
…Zijlema (2022)

- Does at first glance not seem to influence much/enough
…h) where waves start breaking

- not sure this is the best place to do this...
- Add local wave height water depth ration 'gam' to his output
- For now with Qb determined based on upwind point
- For now with taking maxval over itheta for both qb and gam output
…king is started the velocity of cg_ig is changed to sqrt(g*h)

- In igopt 8 for now set only point 'k' to sqrt(g*h), not yet k1 and k2, to be discussed
- Does not work well in shadow zones currently, question is mostly how to determine Sxx_cons
… on integrated energies, and at the redistributing them over bins like for Dw

- Result pretty much the same as before with igopt 9
…cig as alrready mutliplied by ee_itheta,k) and in 'B' term

- ig opt 12 can be the working version in R
- Results don't look good yet, not sure whats wrong, it is like Snapwave trunk commit of Dano of 03-04-2025
…alue to multiply with snapwave_gamma factor for estimating the incident wave breaking point initiation, and setting the srcig to 0

- description: factor times gamma that is used to determine the maximum incident wave breaking point in the surf zone using local incident wave height over water depth ratio, among others used to set the IG source term to 0 shallower than this point
- Now include the /sqrt(2) so that value becomes gam (Hrms based) > 0.47 * gamma
- used for ig_opt >= 11
…lead to issues, therefore remove for ig_opt 12&12
- Only keep the (already precleaned) ig_opt 11&12 version of subroutine determine_infragravity_source_sink_term
- Add description qb_local, gam_local
…e_sink_term'

- Rename the main option 11 to ig_opt = 1 (=the default)
- For now keep also option 11 for ease, but exactly the same as 1
- Option 2 is name the same as ig_opt 1, but without using the conservative shoaling (as before)
- ig_opt = 3 is the same as option 1, but with including the cg_ig adjustment
- turn off ig_opt 12 - currently does not work, need to further check moving from R- to B-term
… is a more gradual decreasing of srcig to 0 .

- 'transition_factor' is controled around 'gamma_fac_br * gamma' as center
- And width controlled by transition_factor_width > 0.005 seems to work well
- With this, found best gamma_fac_br to be 0.45 now - adjusted default value
Leynse and others added 29 commits April 10, 2026 17:13
- Though, having the extra do-loop within the main loop probably not wanted for speed
- Also definition of effective depth to check!
… 0 to turn off wave forces and thus incident wave setup
Reinitialize the per-node Tp only for internal and Neumann-connected cells during the wind iteration so boundary cells keep their prescribed Tp (as set by update_boundaries). Implemented a loop that sets Tp(k)=Tpini for inner(k) and Tp(neumannconnected(k)) where present. Also added docs/_build to .gitignore and cleaned up minor whitespace.
* Fix directional asymmetry in wavemaker initialization for south-facing wavemakers

Two bugs in initialize_wavemakers() that caused incorrect or zero forcing for wavemakers with phi in the south half-plane (Q3/Q4):

Q3 validity check (phi ∈ [π, 1.5π)): wrong index passed to uv_index_z_nm — used Z-cell index ip instead of UV index nmu for the first left-neighbor (md1) check. This caused nearly all Q3 candidates to pass the validity filter, producing spurious wavemaker points for south-west-facing lines.

"Below" direction angfac (Q3 nd1/nd2, Q4 nd1/nd2): sin(π − φ) ≡ sin(φ) and sin(φ) ≤ 0 for φ ∈ [π, 2π), so max(sin(π − φ), 0) always returned zero, silencing all south-pointing wavemaker UV faces. Fixed to max(−sin(φ), 0).

* - Please double check this Claude bugfix #3 @maarten !

Fix wavemaker side-pointer not set for refined (*2) UV half-edges

On quadtree-refined grids, each coarse cell side can have two UV faces (*1 and *2). Only the *1 face was stored in wavemaker_nmu/nmd/num/ndm, so the *2 face injected flux without the continuity solver tracking it, causing mass drift near the wavemaker. No effect on uniform grids.

* - only write hm0_ig min/mean/max for wavemaker points

* - Last small fixes

* - Remove write statements

* Warn on wavemaker points at refinement boundary

Add a logical flag to detect wavemaker points adjacent to quadtree refinement and emit a log warning. Declares refinement_warning, initializes it to .false., sets it to .true. in the wavemaker point checks (where kcs(iz)==1), and writes a WARNING message to the log if any such cases are found. This helps notify users that wavemaker points along refinement boundaries are not recommended.

* - Cleanup message

---------

Co-authored-by: Maarten van Ormondt <maarten.vanormondt@deltares.nl>
@Leynse Leynse changed the base branch from main to 2026.01-Galibier-Release May 27, 2026 14:48
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.

All snapwave changes in one

3 participants