Skip to content
Discussion options

You must be logged in to vote

I think the probable reason for NaN is because the time-step is too long.

I can't know for sure without seeing the grid, but assuming you are using the same grid from the Oceananigans, example, then with U(x, y, z, t) = 0.2 * z, the current at the bottom of the domain is 0.2 * 64 = 12.8 m/s -- quite fast. So with 4m grid spacing (which is used in the example, but you may have changed it) a time-step with CFL=1 would be around Δt = 4 / 12.8 = 0.31 seconds.

I stripped down the example to produce this:

using Oceananigans
using Oceananigans.Units: minute, minutes, hours
using Oceananigans.BuoyancyModels: g_Earth
using GLMakie

grid = RectilinearGrid(size=(32, 32, 32), extent=(128, 128, 64))
c…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ammtD
Comment options

You must be logged in to vote
8 replies
@ammtD
Comment options

@glwagner
Comment options

@ammtD
Comment options

@glwagner
Comment options

@ammtD
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2382 on March 25, 2022 12:16.