-
Notifications
You must be signed in to change notification settings - Fork 193
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
The definition of gravity_unit_vector
apparently doesn't match it's name
#2356
Comments
gravity_unit_vector
gravity_unit_vector
apparently doesn't match it's name
Or we can change how the code works ? |
Are you proposing that we change the code so that |
It would involving changing a sign somewhere, and might allow us to clean up the language? |
I propose we change the code and keep the current kwarg name |
My issue with changing the code (if I understand what you guys are proposing) is that it negatively impacts other aspects of the code. For example, right now this plays nice with the Coriolis parameter definition on a tilted/rotated domain. Currently we can model a domain tilt with buoyancy = Buoyancy(model=BuoyancyTracer(), gravity_unit_vector=ĝ)
coriolis = ConstantCartesianCoriolis(f=params.f₀, rotation_axis=ĝ) which makes for a really seamless and simple user interface. It wouldn't be as nice if we flipped the unit vector for buoyancy in the code. Also we'd need to define another direction in addition to By changing |
Isn't this a rather northern-hemisphere-centric view? Gravity points along the axis of Earth's rotation in the Southern hemisphere. @navidcy please chime in. |
I don't think the verbosity of a default matters. |
I don't think think so. I was born, raised, and lived Brazil until I was 27, and I think it's easier to flip the value of Ultimately I'm okay if you still wanna change the code and keep the name. I just think something needs to change as right now there the definition not 100% consistent. |
😆 |
The notation julia> θ = 5
5
julia> ĝ = [0, sind(θ), cosd(θ)] * 9.81
3-element Vector{Float64}:
0.0
0.8549978363545268
9.772669988280024
julia> -ĝ
3-element Vector{Float64}:
-0.0
-0.8549978363545268
-9.772669988280024 But I think we should convert |
This issue got buried deep but I think we should resolve it. At this point I do think it's kind of late to keep the same name ( @glwagner @francispoulin what do you think? |
If we change the name and that's a breaking change we will bump the version and all users will be happy or keep working with the Oceananigans version they want to. |
I understand that it'll just be a breaking release. My concern is that a user that has a tilted-domain simulation with But if we think that's an acceptable price (I don't know how many people use this feature) and that keeping the name while changing the code is the way to go, then I'm fine moving forward with that. I do think we should decide this and resolve this though. |
We can add a warning message "note that if you used to use version blah then this now changed... etc" and keep it there for a bit. |
It's not too late to change it. The code isn't written in stone. |
I am okay with a change of names. If the new name is clearer then probably better to change it sooner than later. |
This was resolved by #2990 so I'm closing it |
I have recently realized that the current definition of
gravity_unit_vector
is a vector that's in the opposite direction to gravity:Oceananigans.jl/src/BuoyancyModels/buoyancy.jl
Lines 11 to 13 in 10a9479
This sounds counter-intuitive to me. I wonder if we can come up with a better name. Maybe
buoyancy_unit_vector
? It can't be something likevertical_unit_vector
because then we'd potentially run into inconsistencies (see #2266).The text was updated successfully, but these errors were encountered: