Skip to content

Conversation

christavanijzendoorn
Copy link
Collaborator

  • 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
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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):
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Use isinstance(p['lambda'], (int, float)) instead of separate isinstance checks for better readability and performance.

Suggested change
if isinstance(p['lambda'], int) or isinstance(p['lambda'], float):
if isinstance(p['lambda'], (int, float)):

Copilot uses AI. Check for mistakes.

@@ -820,6 +828,23 @@ def calc_runup_stockdon(Ho, Tp, beta):
return eta, sigma_s, R


def calc_runup_ruggiero(Ho):
"""
Calculate runup according to /Ruggiero et al 2004.
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Documentation should include proper citation format and parameter descriptions. The docstring is incomplete compared to the existing calc_runup_stockdon function.

Suggested change
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.

Copilot uses AI. Check for mistakes.

Comment on lines +555 to +556
Update XX by YYY
layers.
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Placeholder text 'XX by YYY' should be replaced with actual description of what the function updates.

Suggested change
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.

Copilot uses AI. Check for mistakes.

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,:]))
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Long line with many arguments makes code hard to read. Consider breaking this into multiple lines or using a list comprehension.

Suggested change
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)

Copilot uses AI. Check for mistakes.

step6_check = ix_step6[1,args]
step7_check = ix_step7[1,args]
step8_check = ix_step8[1,args]
print(check)
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Use proper logging instead of print statements. Consider using logger.debug() or logger.warning() for debugging information.

Suggested change
print(check)
logger.debug(check)

Copilot uses AI. Check for mistakes.

christavanijzendoorn and others added 2 commits July 21, 2025 15:54
spelling corrected

Co-authored-by: Copilot <[email protected]>
proper warning

Co-authored-by: Copilot <[email protected]>
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