Skip to content

Wet point Coriolis scheme and bugfix in GM tapering#2729

Merged
simone-silvestri merged 30 commits intomainfrom
ss/ho_coriolis
Sep 21, 2022
Merged

Wet point Coriolis scheme and bugfix in GM tapering#2729
simone-silvestri merged 30 commits intomainfrom
ss/ho_coriolis

Conversation

@simone-silvestri
Copy link
Copy Markdown
Collaborator

@simone-silvestri simone-silvestri commented Sep 8, 2022

A Simple preliminary way to use our advection reconstruction stencils to do high-order Coriolis reconstruction

advection = WENO(grid)
coriolis = HydrostaticSphericalCoriolis(scheme = advection)

this PR is here just to test the idea, but the design will probably change

@glwagner
Copy link
Copy Markdown
Member

glwagner commented Sep 8, 2022

This is interesting. I like the concept of reusing the scheme kwarg. But I think this isn't sustainable given the future planned changes to the advection scheme API, right? Ie an "advection scheme" is going to be more comprehensive. Also, it doesn't make sense unless we are using vector invariant.

Another possibility is to add another kwarg.

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

Yes, I think we should probably put the high-order reconstructions in Operators

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

We can also do

advection = UpwindBiasedFifthOrder()
coriolis = HydrostaticSphericalCoriolis(scheme = advection)

# curvilinear grids).

using Oceananigans.Advection: AbstractAdvectionScheme, _left_biased_interpolate_yᵃᶜᵃ, _right_biased_interpolate_xᶜᵃᵃ
using Oceananigans.Advection:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just curious: why put this in a separate file rather than adding to hydrostatic_spherical_coriolis.jl?

@glwagner
Copy link
Copy Markdown
Member

Yes, I think we should probably put the high-order reconstructions in Operators

When we give an advection scheme to scheme, is there an assumption that we are using vector invariant? I'm still a little confused by the logic of the API. Maybe clarifying here will help?

@simone-silvestri simone-silvestri changed the title [WIP] Advection-like Coriolis reconstruction Wet point Coriolis scheme and bugfix in GM tapering Sep 20, 2022
@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

The advection-like Coriolis scheme was a non-sequitur because f is a very regular field, so upwinding it was just decreasing performance without a significative increase in quality of the simulation.

On the other hand, upwinding u is very much discouraged because the energy builds up rapidly (by upwinding the velocity the divergence of the reconstructed tangential velocity is not a direct interpolation of the divergence of the original velocity, which is a necessary condition to maintain the algorithm stable).

The only thing I can think to increase the order of velocity interpolation in the Coriolis force is to use a centered high-order scheme to interpolate velocity, but that would not help with the noise since a centered scheme is dispersive in nature.

I converted this PR to implement a WetPointCoriolisScheme (described in Numerical boundary layers and spurious residual flows).
This is just a simple addition to an enstrophy conserving scheme where edge ("dry") points are neglected in the interpolation of the velocity in the tangential direction.

A comparison of the output of this scheme in a global 1 degree setup will follow

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

simone-silvestri commented Sep 20, 2022

additionally a very small but significant bug has been corrected in the GM tapering, where, if we had bz == 0 the tapering would become Inf.

This is very rare occasion but it was happening with some particular initial conditions

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

simone-silvestri commented Sep 20, 2022

Comparison with the default HydrostaticSphericalCoriolis() on main (left) and HydrostaticSphericalCoriolis(scheme = WetPointEnstrophyConservingScheme()) (right)
The figure below is the zonal velocity (u, top) and the vertical velocity (w, bottom) at the surface averaged over a year after 20 years of evolution from ECCO interpolated initial conditions.
Note the strikingly lower noise emanating from the boundaries (especially in the w velocity) using the new coriolis scheme

Screen Shot 2022-09-20 at 11 20 11 AM

Copy link
Copy Markdown
Member

@glwagner glwagner left a comment

Choose a reason for hiding this comment

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

Great work. Just a doc string and minor clean up needed.

Copy link
Copy Markdown
Member

@navidcy navidcy left a comment

Choose a reason for hiding this comment

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

Also bump patch release

@navidcy navidcy added bug 🐞 Even a perfect program still has bugs numerics 🧮 So things don't blow up and boil the lobsters alive labels Sep 20, 2022
slope_y = - by / bz
slope² = ifelse(bz < 0, zero(grid), slope_x^2 + slope_y^2)

# in case of an
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in case of what?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

of a stable buoyancy gradient (bz > 0), the slope is set to zero
is this right though? should we taper the slope of the diffusivity?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sorry the slope or the diffusivity?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not sure really
@glwagner ?

@navidcy
Copy link
Copy Markdown
Member

navidcy commented Sep 20, 2022

Also perhaps merge main because I think 0.77.3 is the current version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Even a perfect program still has bugs numerics 🧮 So things don't blow up and boil the lobsters alive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants