Skip to content

Default Poincare coefficient for AMD is inappropriately small #4367

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

Open
jagoosw opened this issue Apr 8, 2025 · 5 comments
Open

Default Poincare coefficient for AMD is inappropriately small #4367

jagoosw opened this issue Apr 8, 2025 · 5 comments
Labels
numerics 🧮 So things don't blow up and boil the lobsters alive

Comments

@jagoosw
Copy link
Collaborator

jagoosw commented Apr 8, 2025

In the AMD model the default Poincare coefficient is 1/12:

function AnisotropicMinimumDissipation(time_disc::TD = ExplicitTimeDiscretization(), FT = Oceananigans.defaults.FloatType;
C = FT(1/12), Cν = nothing, Cκ = nothing, Cb = nothing) where TD

but this is probably not the right default to have.

The Poincare coefficient depends on the advection scheme, and for second order centered should be 1/3 (Verstappen, 2014). Since that's the default advection scheme and (as far as I'm aware) the most common used for explicit LES, I think the defaults for AMD should probably be that too.

I can't find any derivations for other advection schemes and as far as I'm aware the validity of AMD has only been checked with spectral methods and second order centered.

I also noticed that reference is made to this in the LES docs.

Should I open a PR changing the default to 1/3?

@jagoosw jagoosw added bug 🐞 Even a perfect program still has bugs numerics 🧮 So things don't blow up and boil the lobsters alive labels Apr 8, 2025
@glwagner
Copy link
Member

glwagner commented Apr 8, 2025

The reference in the docstring suggests 1/12: https://www.sciencedirect.com/science/article/pii/S0045793016304005?casa_token=MiYsFFOBzm0AAAAA:O9fn8l8EY_Wy5eJf-YbsdqThYVTGpKQ9aU3GWr88zfg10QLp-I4u7TfioHIF0y_czWUOx2Cm

It's all a bit of numerology to me though. I don't see any distinction between spectral or finite volume in that reference.

It could be a good idea to show that there's a problem with the default first to motivate changes rather than relying on theoretical arguments only. But I'm not sure I should have an opinion here, perhaps it's better if others chime in. Perhaps if the feeling is strong enough, you can multiply by 4.

PS I wouldn't describe setting your eddy viscosity too low or high as a "bug", just a poor numerical choice.

@glwagner glwagner removed the bug 🐞 Even a perfect program still has bugs label Apr 8, 2025
@glwagner glwagner changed the title Default Poincare coefficient for AMD are probably wrong Default Poincare coefficient for AMD may be inappropriately small Apr 8, 2025
@jagoosw
Copy link
Collaborator Author

jagoosw commented Apr 9, 2025

The reference in the docstring suggests 1/12: https://www.sciencedirect.com/science/article/pii/S0045793016304005?casa_token=MiYsFFOBzm0AAAAA:O9fn8l8EY_Wy5eJf-YbsdqThYVTGpKQ9aU3GWr88zfg10QLp-I4u7TfioHIF0y_czWUOx2Cm

I think they're getting there a different way but that in equation 39 they're finding the equivalent of setting it to 1/3?

It could be a good idea to show that there's a problem with the default first to motivate changes rather than relying on theoretical arguments only. But I'm not sure I should have an opinion here, perhaps it's better if others chime in. Perhaps if the feeling is strong enough, you can multiply by 4.

The reason I got into this is because a model I'm working on was way too diffusive but has been cured by changing the Poincare coefficient. I think in lots of situations it doesn't make much difference, for example in this paper they tested and found it didn't make any difference, but in some situations it makes it too diffusive. Is there some sort of case you think I should demonstrate with?

@glwagner
Copy link
Member

glwagner commented Apr 9, 2025

huh, so increasing the coefficient made your model less diffusive?

I think if you just want to show those results that's enough. Or just some simple turbulence case.

You don't have to show anything necessarily, but I feel if you can demonstrate something that will help prevent future attempts to change things because we would then have some solid evidence to back up the choice.

@jagoosw
Copy link
Collaborator Author

jagoosw commented Apr 18, 2025

Yeah, I'm pretty sure it's because when the coefficient is too small, energy gets trapped at small scales, causing more resolved dissipation.

I made a test case here. The first plot is with the default coefficient, and the second with C=1/3.

Image

Image

I have plotted the filter width $\delta$, and you can see that it's too small to dissipate in the default case, leading to a buildup of energy in the inertial range.

Lower/higher res cases showing that the base case truncates the inertial range (I think) Lower resolution: ![Image](https://github.com/user-attachments/assets/c87e4bd5-4aef-4d94-8ac4-c252c9cbfabf) Higher resolution:

Image

(I haven't normalised the energy, which is why it's different in the different resolutions)

@jagoosw jagoosw changed the title Default Poincare coefficient for AMD may be inappropriately small Default Poincare coefficient for AMD is inappropriately small Apr 18, 2025
@glwagner
Copy link
Member

That looks great. Is that with Centered advection?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
numerics 🧮 So things don't blow up and boil the lobsters alive
Projects
None yet
Development

No branches or pull requests

2 participants