-
Notifications
You must be signed in to change notification settings - Fork 242
(0.98.0) Modify interface for OpenBoundaryCondition
s with schemes
and use Tuples in boundary_mass_fluxes
#4687
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
base: main
Are you sure you want to change the base?
Conversation
Can we change the name to just |
boundary_fluxes = merge(boundary_fluxes, (; left_matching_scheme_boundaries = Tuple(left_matching_scheme_boundaries), | ||
right_matching_scheme_boundaries = Tuple(right_matching_scheme_boundaries), | ||
total_area_matching_scheme_boundaries)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the benefits of a NamedTuple vs type here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand the question. What do you mean by type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a type other than NamedTuple --- a custom struct, which is an alternative to using a NamedTuple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess just the simplicity of using a common type that everyone's familiar with. I don't see disadvantages of using NamedTuple
s.
Sure, something like |
right, with Also what is a "perturbation advection scheme"? One thing to consider for the name is what the different alternatives might be so that we can choose a name that meaningfully distinguishes between them. From what I understand, we either have a scheme that strictly prescribes the boundary velocity, or a scheme that can evolve it, is that right? |
👍
Yes, and the schemes that predict what the boundary velocity can be from the flow (rather then prescribe/impose it) typically do so in order to minimize reflection. There is a lot of different nomenclature here, so I don't know what the best name is. When originally implementing this @jagoosw chose to call these schemes "matching schemes", but I haven't found that name elsewhere in the literature (@jagoosw feel free to chime in here; perhaps ![]() (So a note is that, us calling boundary conditions that prescribe the normal velocity without trying to minimize reflection as an And back to your point, |
As I remember, we settled on "matching scheme" since the scheme abstractly matches the interior physics with some prescribed boundary physics. I think that radiation schemes are a subset of this because an open boundary might e.g. be prescribing an inflow, and I gather that radiation schemes gained their name from their derivation from approximating the wave propagation from the Helmholtz equation, which isn't universally how you might want to treat an open boundary. So I think calling them all radiation schemes is misleading. For example, the Stevens boundary condition (https://mitgcm.readthedocs.io/en/latest/phys_pkgs/obcs.html) has nothing to do with that derivation. Similarly, for the "perturbation advection" we called it this because that describes what it does (i.e. it advects perturbations out of the domain with some mean velocity), this is similar to an Orlanski/radiation condition where the "mean" velocity is guessed by some particular procedure, or could be the boundary mean velocity like Simone describes here. If we can think of something else that describes what this does, then happy for it to be changed, but I think this is quite a good descriptor of what it can be used for. There is also a derivation in the docstring which kind of shows the advecting a pertubation idea. |
Given this API it could maybe just be called |
I like that. If there is only one kind of "scheme", it's better to avoid the adjective. Also just to rehash some very old conversations, originally we put off writing a unified API for |
I agree; and explain that kwarg |
Not reviving anything old at all! It's one of the points I'm making in the top comment :) If I understand correctly, I'll then remove the warning for this scheme. |
OpenBoundaryCondition
s with schemes
and use Tuples in boundary_mass_fluxes
src/BoundaryConditions/perturbation_advection_open_boundary_scheme.jl
Outdated
Show resolved
Hide resolved
I think this is ready. I bumped the minor version since we're changing the user interface for for open BCs with schemes. |
OpenBoundaryCondition
s with schemes
and use Tuples in boundary_mass_fluxes
OpenBoundaryCondition
s with schemes
and use Tuples in boundary_mass_fluxes
@glwagner I implemented your suggestions. This should be good to go. The reactant tests are failing for some reason, but I think that's not related to anything here in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the PR addresses review comments and it looks good to me! Just left a minor comment.
Should the perturbation_advection_open_boundary_scheme.jl
file be renamed to just perturbation_advection.jl
or perturbation_advection_scheme.jl
now?
This apparently came up in a conversation between @glwagner and @navidcy and was mentioned in #4674, so I'm opening this. This PR:
PerturbationAdvectionOpenBoundaryCondition
now that it has more rigorous testing and seems to be working properlymodel.boundary_fluxes
.