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

ExnerBedloadTerm does not work with generic boundary conditions #280

Open
tkarna opened this issue Dec 2, 2021 · 0 comments
Open

ExnerBedloadTerm does not work with generic boundary conditions #280

tkarna opened this issue Dec 2, 2021 · 0 comments

Comments

@tkarna
Copy link
Contributor

tkarna commented Dec 2, 2021

At the moment the ExnerBedloadTerm checks whether zeros have been prescribed at the boundary to decide whether to include the boundary term or not:

thetis/thetis/exner_eq.py

Lines 115 to 127 in 8685cd9

for bnd_marker in (bnd_conditions or []):
no_contr = False
keys = [*bnd_conditions[bnd_marker].keys()]
values = [*bnd_conditions[bnd_marker].values()]
for i in range(len(keys)):
if keys[i] not in ('elev', 'uv'):
if float(values[i]) == 0.0:
no_contr = True
elif keys[i] == 'uv':
if all(j == 0.0 for j in [float(j) for j in values[i]]):
no_contr = True
if not no_contr:
f += -self.test*(fac*qbx*self.n[0] + fac*qby*self.n[1])*self.ds(bnd_marker)

This test, however, does not work if the boundary values are UFL expressions for instance (as in the case of tides with a time-dependent ramp up). We should find a better way of imposing the boundaries.

Why the 0.0 is a special case here? If we need to manually turn off the bedload term at certain boundaries I think we could add a special boundary flag to handle it. Maybe @mc4117 has some ideas.

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

No branches or pull requests

1 participant