-
Notifications
You must be signed in to change notification settings - Fork 237
Introduce concept of initialization update state #4223
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
Conversation
@@ -60,8 +60,8 @@ model.velocities.u | |||
@apply_regionally set!(ϕ, value) | |||
end | |||
|
|||
initialize!(model) | |||
update_state!(model; compute_tendencies=false) | |||
# initialize!(model) |
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.
@simone-silvestri do you know why this is here? This has to do with free surface. But I am not sure why we need it. Note, it can’t be req for update_state bc the first call is in model constructor. So this may be superfluous, or it needs to happen sooner.
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.
Basically we are not guaranteed to call set! So nothing can depend on it
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.
This was there to make sure that the barotropic velocities are consistent with the velocities provided by set!
ting the model.
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.
Are the barotropic velocities not computed in update_state!
?
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.
Differently from other free surfaces, for the split explicit free surface the "source of truth" is the barotropic velocity, which is used to correct the total velocity in the pressure_correction
step. Therefore, the barotropic velocity needs to be initialized in some way if we set the velocities. In this step, the barotropic velocity is initialized with the vertical integral of the total velocity.
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 is the actual function that computes the barotropic velocities. Is there a way to call this independently? It's challenge that its grouped with initialize!(model)
. Also it's not clear from reading the code that this is intended to compute the barotropic velocities.
No description provided.