Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wave height solve #215

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions aeolis/hydro.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,28 @@ def interpolate(s, p, t):
p['wave_file'][:,0],
p['wave_file'][:,2])

if p['process_runup']:
ny = p['ny']

for iy in range(ny + 1): # do this computation seperately on every y for now so alongshore variable wave runup can be added in the future

hs = s['Hs'][iy][0]
tp = s['Tp'][iy][0]
wl = s['SWL'][iy][0]

eta, sigma_s, R = calc_runup_stockdon(hs, tp, p['beach_slope'])
s['R'][iy][:] = R
s['eta'][iy][:] = eta
s['sigma_s'][iy][:] = sigma_s

if hasattr(s['runup_mask'], "__len__"):
s['eta'][iy][:] = apply_mask(s['eta'][iy][:], s['runup_mask'][iy][:])
s['R'][iy][:] = apply_mask(s['R'][iy][:], s['runup_mask'][iy][:])

s['TWL'][iy][:] = s['SWL'][iy][:] + s['R'][iy][:]
s['DSWL'][iy][:] = s['SWL'][iy][:] + s['eta'][iy][:] # Was s['zs'] before

# Alters wave height based on maximum wave height over depth ratio, gamma default = 0.5
s['Hs'] = np.minimum(h * p['gamma'], s['Hs'])

# apply complex mask
Expand All @@ -136,27 +158,6 @@ def interpolate(s, p, t):

if p['process_runup']:
ny = p['ny']

if ('Hs' not in p['external_vars']):

for iy in range(ny + 1): # do this computation seperately on every y for now so alongshore variable wave runup can be added in the future

hs = s['Hs'][iy][0]
tp = s['Tp'][iy][0]
wl = s['SWL'][iy][0]

eta, sigma_s, R = calc_runup_stockdon(hs, tp, p['beach_slope'])
s['R'][iy][:] = R
s['eta'][iy][:] = eta
s['sigma_s'][iy][:] = sigma_s

if hasattr(s['runup_mask'], "__len__"):
s['eta'][iy][:] = apply_mask(s['eta'][iy][:], s['runup_mask'][iy][:])
s['R'][iy][:] = apply_mask(s['R'][iy][:], s['runup_mask'][iy][:])

s['TWL'][iy][:] = s['SWL'][iy][:] + s['R'][iy][:]
s['DSWL'][iy][:] = s['SWL'][iy][:] + s['eta'][iy][:] # Was s['zs'] before

if ('Hs' in p['external_vars']):

eta, sigma_s, R = calc_runup_stockdon(s['Hs'], s['Tp'], p['beach_slope'])
Expand Down
Loading