Closed navidcy closed 3 years ago
Out of curiousity what resolution or grid spacing are you using?
I'm wondering if the second-order advection scheme is just being inaccurate at coarse resolutions.
Same as the simple_eady.jl
script.
Hmmm, yeah I'll let @glwagner answer this but I'm not super surprised to see numerical artifacts at 64x64x32 grid points on a 1000x1000x4 km domain.
Oceananigans might need better numerical methods (better advection scheme?). Climbing on the priority of things to do...
I'm actually not surprised to see numerical artifacts at this resolution. But I'm surprises they go away if you integrate for more... Usually when that happens NaN
s are not far away.
Ah interesting. I wonder if the Laplacian + biharmonic diffusivity are smoothing things out just in time, but not sure...
@navidcy this is one of the dangerous aspects of a finite volume method. Grid noise can resolve itself.
There's no way to anticipate numerical artifacts from domain size and grid resolution alone. For example, a resting solution of u=0 is perfectly resolved at 64x64x32 whether the domain is 1 mm or 1 parsec wide. We need to know the spatial scales we expect to appear in the simulation. One of the challenges of this setup is predicting the spatial scales that appear. The Rossby radius of deformation is obviously one scale, but depending parameters, much smaller scales may arise, I think.
Of course @glwagner, I agree....
But still, isn't it weird that artifacts appear and then go away?
Yeah --- why would that be? Is it a time-stepping error?
Well that's why I put up the issue in the first place! I find it rather strange. I've never seen it in any other turbulence simulation. Usually when grid-point noise appears then NaN values are eminent...
Usually when grid-point noise appears then NaN values are eminent...
That's not my experience with finite volume methods! It is my experience with spectral methods (it also seems DG exhibits similar behavior).
But the question I thought you might be asking is: what process drives the generation of grid-scale noise at some specific time? For example, the physics might require scales below the grid scale. However, its surprising such physics would arise and then disappear later in the simulation.
We use adaptive time-stepping, so a time stepper error is possible. Let's try lowering the CFL.
@navidcy try changing this line:
to
wizard = TimeStepWizard(cfl=0.02, Δt=20.0, max_change=1.1, max_Δt=2minute)
possibly its an error associated with the diffusion time-scale? 3 minute time step may be too long.
I mean, that shouldn't be the case because the diffusive time-scale is fixed at a tenth of a day, so longer than an hour. But AB2 I think is actually particularly sensitive to diffusive CFL instabilities. Biharmonic is especially tricky. It's definitely worth understanding this problem thoroughly.
Actually, I need to limit the time-step to 1 minute for stability.
hm, after this discussion playing around a bit with TimeStepWizard
input params I also tend to think that this is probably diffusive instability.
If you suspect diffusivity instability it might be worth printing out the "diffusive CFL" number with something like
using Oceananigans.Diagnostics: AdvectiveCFL, DiffusiveCFL
...
dcfl = DiffusiveCFL(wizard)
print("Diffusive CFL: $dcfl")
but I think it might require PR https://github.com/climate-machine/Oceananigans.jl/pull/557 and it doesn't support multiple closures so might have to calculating it manually might be easiest for this issue.
Is the stability criterion for biharmonic diffusivty stricter than Laplacian diffusivity?
Is this issue pertinent?
doubtful
If you run
simple_eady.jl
up some grid-scale noise appears at around 6hrs and then disappears...This can be seen, e.g., by changing https://github.com/glwagner/EadyTurbulence/blob/95a5da1682bb7cc7d543c1573c9e5ba6d275bd02/simple_eady.jl#L34 to
Is this physical? I doubt... But how come the model continues and resolves itself from this situation...?