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

Some refactoring of time_step! to unify HydrostaticFreeSurfaceModel and NonhydrostaticModel #3895

Open
simone-silvestri opened this issue Nov 1, 2024 · 1 comment

Comments

@simone-silvestri
Copy link
Collaborator

simone-silvestri commented Nov 1, 2024

at the moment, the default time stepping function is designed with the non-hydrostatic model in mind, so the logical steps of a time step (or substep for RK3) are

step_variables!(...)
calculate_pressure_correction!(...) 
pressure_correct_velocities!(...)
compute_new_tendencies!(...)

In the hydrostatic model, we are extending the step_variables! function to include a step_free_surface! function that calculates η and we set

calculate_pressure_correction!(::HydrostaticFreeSurfaceModel, ...) = nothing

I would like to calculate the free surface in the calculate_pressure_correction! function to unify conceptually the NonhydrostaticModel and the HydrostaticFreeSurfaceModel, minimize the amount of code, and reduce the necessity for extending the time-stepping function.
This will make it easier to implement new time-stepping schemes that work for both the models

@glwagner
Copy link
Member

glwagner commented Nov 1, 2024

This is a good idea, the only comment is that we should possibly try to merge https://github.com/CliMA/Oceananigans.jl/pull/3867/files which makes a few small changes first

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

2 participants