Skip to content

Dynamic revetment implementation - #248

Open
christavanijzendoorn wants to merge 4 commits into
mainfrom
aeolis-dynarevdev
Open

Dynamic revetment implementation#248
christavanijzendoorn wants to merge 4 commits into
mainfrom
aeolis-dynarevdev

Conversation

@christavanijzendoorn

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

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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
FileDescription
aeolis/wind.pyAdds z0_grid method for spatially varying roughness and fixes shear stress array handling
aeolis/threshold.pyImplements new sediment trapping threshold modification based on roughness density
aeolis/shear.pyEnhances shear module to handle spatially varying stress values and removes unused whitespace
aeolis/hydro.pyAdds Ruggiero runup method option alongside existing Stockdon method
aeolis/constants.pyDefines new constants and configuration parameters for composite beach processes
aeolis/bed.pyImplements comprehensive composite beach bed update algorithm with sand-cobble interactions
Comments suppressed due to low confidence (2)

Comment threadaeolis/threshold.py Outdated
Comment threadaeolis/threshold.py
s['Rti'] = Rti

# modify shear velocity threshold
if isinstance(p['lambda'], int) or isinstance(p['lambda'], float):

CopilotAIJul 21, 2025

Copy link

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
ifisinstance(p['lambda'], int) orisinstance(p['lambda'], float):
ifisinstance(p['lambda'], (int, float)):

Copilot uses AI. Check for mistakes.
Comment threadaeolis/hydro.py

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

CopilotAIJul 21, 2025

Copy link

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
Calculaterunupaccordingto/Ruggieroetal2004.
CalculaterunupaccordingtoRuggieroetal. (2004).
Thisfunctioncalculatestherunupfordissipativeconditionsbasedon
thesignificantwaveheight (Ho). Theformulaisderivedfromthework
ofRuggieroetal. (2004).
Parameters
----------
Ho : float
Significantwaveheight (inmeters).
Returns
-------
eta : float
Meanwaterlevel (setto0forthismethod).
sigma_s : float
Standarddeviationofswashoscillations (setto0forthismethod).
R : float
Totalrunupheight (inmeters).
References
----------
Ruggiero, P., Komar, P. D., McDougal, W. G., Marra, J. J., &Beach, R. A. (2004).
Waverunup, extremewaterlevelsandtheerosionofpropertiesbackingbeaches.
JournalofCoastalResearch, 20(3), 1018-1026.

Copilot uses AI. Check for mistakes.
Comment threadaeolis/bed.py
Comment on lines +555 to +556
Update XX by YYY
layers.

CopilotAIJul 21, 2025

Copy link

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
UpdateXXbyYYY
layers.
Updatesthesandlevel, cobblethickness, andrelatedparameters
forcompositebeaches. Thisincludesadjustingthebathymetry
basedonchangesinsandcoverandmanagingtheoverlapand
distributionofcobblesandsandlayers.

Copilot uses AI. Check for mistakes.
Comment threadaeolis/bed.py
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,:]))

CopilotAIJul 21, 2025

Copy link

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.
Comment threadaeolis/bed.py Outdated
Comment threadaeolis/bed.py
step6_check = ix_step6[1,args]
step7_check = ix_step7[1,args]
step8_check = ix_step8[1,args]
print(check)

CopilotAIJul 21, 2025

Copy link

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.
christavanijzendoornand others added 2 commits July 21, 2025 15:54
spelling corrected
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
proper warning
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for freeto 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

@christavanijzendoorn