Conversation
christavanijzendoorn
commented
Jul 21, 2025
- New runup method included
- z0 can be defined based on grid
- shear module can handle spatially varying z0
- implementation of sand infilling within cobble
- sediment trapping implemented based on roughness density
- constants added where needed
- New runup method included - z0 can be defined based on grid - shear module can handle spatially varying z0 - implementation of sand infilling within cobble - sediment trapping implemented based on roughness density - constants added where needed
There was a problem hiding this comment.
Pull Request Overview
This PR implements dynamic revetment functionality for coastal modeling, introducing composite beach handling with sand-cobble interactions, new runup calculation methods, and enhanced roughness-based sediment trapping capabilities.
Key changes include:
- Implementation of spatially varying roughness length (z0) from grid data
- Addition of Ruggiero runup method as alternative to existing Stockdon method
- New sediment trapping mechanism based on roughness density (lambda) for larger scale elements
- Comprehensive composite beach bed update algorithm handling sand infilling within cobble layers
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| aeolis/wind.py | Adds z0_grid method for spatially varying roughness and fixes shear stress array handling |
| aeolis/threshold.py | Implements new sediment trapping threshold modification based on roughness density |
| aeolis/shear.py | Enhances shear module to handle spatially varying stress values and removes unused whitespace |
| aeolis/hydro.py | Adds Ruggiero runup method option alongside existing Stockdon method |
| aeolis/constants.py | Defines new constants and configuration parameters for composite beach processes |
| aeolis/bed.py | Implements comprehensive composite beach bed update algorithm with sand-cobble interactions |
Comments suppressed due to low confidence (2)
| s['Rti'] = Rti | ||
|
|
||
| # modify shear velocity threshold | ||
| if isinstance(p['lambda'], int) or isinstance(p['lambda'], float): |
There was a problem hiding this comment.
Use isinstance(p['lambda'], (int, float)) instead of separate isinstance checks for better readability and performance.
| if isinstance(p['lambda'], int) or isinstance(p['lambda'], float): | |
| if isinstance(p['lambda'], (int, float)): |
|
|
||
| def calc_runup_ruggiero(Ho): | ||
| """ | ||
| Calculate runup according to /Ruggiero et al 2004. |
There was a problem hiding this comment.
Documentation should include proper citation format and parameter descriptions. The docstring is incomplete compared to the existing calc_runup_stockdon function.
| Calculate runup according to /Ruggiero et al 2004. | |
| Calculate runup according to Ruggiero et al. (2004). | |
| This function calculates the runup for dissipative conditions based on | |
| the significant wave height (Ho). The formula is derived from the work | |
| of Ruggiero et al. (2004). | |
| Parameters | |
| ---------- | |
| Ho : float | |
| Significant wave height (in meters). | |
| Returns | |
| ------- | |
| eta : float | |
| Mean water level (set to 0 for this method). | |
| sigma_s : float | |
| Standard deviation of swash oscillations (set to 0 for this method). | |
| R : float | |
| Total runup height (in meters). | |
| References | |
| ---------- | |
| Ruggiero, P., Komar, P. D., McDougal, W. G., Marra, J. J., & Beach, R. A. (2004). | |
| Wave runup, extreme water levels and the erosion of properties backing beaches. | |
| Journal of Coastal Research, 20(3), 1018-1026. |
| Update XX by YYY | ||
| layers. |
There was a problem hiding this comment.
Placeholder text 'XX by YYY' should be replaced with actual description of what the function updates.
| Update XX by YYY | |
| layers. | |
| Updates the sand level, cobble thickness, and related parameters | |
| for composite beaches. This includes adjusting the bathymetry | |
| based on changes in sand cover and managing the overlap and | |
| distribution of cobbles and sand layers. |
| ix_step8 = ix_ero & ix_sc & ix_sc_noaccom | ||
|
|
||
| # Check if all locations are assigned to a single step | ||
| ix_steps = np.vstack((ix_nocob[1,:], ix_step0[1,:], ix_step1[1,:], ix_step2[1,:], ix_step3[1,:], ix_step4[1,:], ix_step5[1,:], ix_step6[1,:], ix_step7[1,:], ix_step8[1,:])) |
There was a problem hiding this comment.
Long line with many arguments makes code hard to read. Consider breaking this into multiple lines or using a list comprehension.
| ix_steps = np.vstack((ix_nocob[1,:], ix_step0[1,:], ix_step1[1,:], ix_step2[1,:], ix_step3[1,:], ix_step4[1,:], ix_step5[1,:], ix_step6[1,:], ix_step7[1,:], ix_step8[1,:])) | |
| ix_steps_list = [ | |
| ix_nocob[1,:], | |
| ix_step0[1,:], | |
| ix_step1[1,:], | |
| ix_step2[1,:], | |
| ix_step3[1,:], | |
| ix_step4[1,:], | |
| ix_step5[1,:], | |
| ix_step6[1,:], | |
| ix_step7[1,:], | |
| ix_step8[1,:] | |
| ] | |
| ix_steps = np.vstack(ix_steps_list) |
| step6_check = ix_step6[1,args] | ||
| step7_check = ix_step7[1,args] | ||
| step8_check = ix_step8[1,args] | ||
| print(check) |
There was a problem hiding this comment.
Use proper logging instead of print statements. Consider using logger.debug() or logger.warning() for debugging information.
| print(check) | |
| logger.debug(check) |
spelling corrected Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
proper warning Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>