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

free_surface default for a DistributedGrid #232

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/OceanSimulations/OceanSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Oceananigans
using Oceananigans.Units
using Oceananigans.Utils: with_tracers
using Oceananigans.Advection: FluxFormAdvection
using Oceananigans.DistributedComputations: DistributedGrid
using Oceananigans.Coriolis: ActiveCellEnstrophyConserving
using Oceananigans.ImmersedBoundaries: immersed_peripheral_node, inactive_node
using OrthogonalSphericalShellGrids
Expand Down Expand Up @@ -44,7 +45,7 @@ default_free_surface(grid) = SplitExplicitFreeSurface(grid; cfl=0.7)

# 70 substeps is a safe rule of thumb for an ocean at 1/4 - 1/10th of a degree
# TODO: pass the cfl and a given Δt to calculate the number of substeps?
default_free_surface(grid::TripolarGrid) = SplitExplicitFreeSurface(grid; substeps = 70)
default_free_surface(grid::Union{TripolarGrid, DistributedGrid}) = SplitExplicitFreeSurface(grid; substeps = 70)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just make this always the default?

Note that this doesn't cover ImmersedBoundaryGrid but it needs to (which is done on #230)

All these changes need tests I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another comment is: a better design for this function would pass in a minimum expected time-step. Then, it could be leveraged by users who find that the default doesn't work for them (but who may not be able to automatically guess how many substeps they need --- which depends on the depth of the ocean, gravitational acceleration, the grid spacing, and the minimum expected time-step.


function default_ocean_closure()
mixing_length = CATKEMixingLength(Cᵇ=0.01)
Expand Down
Loading