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

Missing (-1)^{n+1} factor from hyperdiffusion term #286

Closed
navidcy opened this issue Apr 6, 2023 · 5 comments · Fixed by #283
Closed

Missing (-1)^{n+1} factor from hyperdiffusion term #286

navidcy opened this issue Apr 6, 2023 · 5 comments · Fixed by #283
Labels
documentation 📚 Improvements or additions to documentation dynamics 〰️ Affects the dynamical core

Comments

@navidcy
Copy link
Collaborator

navidcy commented Apr 6, 2023

Hyper diffusion term should be

$$ (-1)^{n+1}\nabla^{2n} $$

@milankl
Copy link
Member

milankl commented Apr 6, 2023

Just checked the operators with varying powers and they look good

image

($\ell_{max}$ shoud be $\ell$, my bad, but $\ell_{max} = 31$ here, that's why they all coincide at this point)

I stumbled across this for the dynamics as we don't do any $(-1)^{n+1}$ business in spectral space, so I was confused for why that is, whereas you obviously have to do that with grid-point based operators.

Update: Okay, it is because the eigenvalues of the laplace operator $\nabla^2$ in spherical harmonics are $-\ell(\ell+1)$, so the eigenvalues of $\nabla^{2n}$ are actually $(-1)^n (\ell(\ell + 1))^n$. However, we normalise the $\nabla^{2n}$ by the largest eigenvalue (such that the sign drops out too) and then consider the (normalised) diffusion coefficent as an (inverse) time scale $\nu^*$ [1/s] (which is always positive) so we have in total

$$(-1)^{n+1}\nu\nabla^{2n} = \nu^* \left(\frac{\ell(\ell + 1)}{ \ell_{max}(\ell_{max} + 1)} \right)^n $$

Where on the left the $(-1)^{n+1}$ compensates for the alternating (anti)dissipative nature of $\nabla^{2n}$, to always yield something dissipative. On the right the sign drops out because we normalise by the largest eigenvalue anyway and therefore retain the dissipative nature (and the sign in the figure above). Does that make sense? I'll try to update the docs to better explain that. Thanks for pointing this out.

@milankl
Copy link
Member

milankl commented Apr 6, 2023

Quite cool to see the impact: $\nabla^2$ very diffusive in the top, kills all the turbulence, only orography signal remains to $-\nabla^8$ at the bottom

image

@milankl milankl added the documentation 📚 Improvements or additions to documentation label Apr 6, 2023
@milankl milankl added this to the v0.5 milestone Apr 6, 2023
@navidcy
Copy link
Collaborator Author

navidcy commented Apr 6, 2023

Just checked the operators with varying powers and they look good

image

(ℓmax shoud be ℓ, my bad, but ℓmax=31 here, that's why they all coincide at this point)

I stumbled across this for the dynamics as we don't do any (−1)n+1 business in spectral space, so I was confused for why that is, whereas you obviously have to do that with grid-point based operators.

Update: Okay, it is because the eigenvalues of the laplace operator ∇2 in spherical harmonics are −ℓ(ℓ+1), so the eigenvalues of ∇2n are actually (−1)n(ℓ(ℓ+1))n. However, we normalise the ∇2n by the largest eigenvalue (such that the sign drops out too) and then consider the (normalised) diffusion coefficent as an (inverse) time scale ν∗ [1/s] (which is always positive) so we have in total

(−1)n+1ν∇2n=ν∗(ℓ(ℓ+1)ℓmax(ℓmax+1))n

Where on the left the (−1)n+1 compensates for the alternating (anti)dissipative nature of ∇2n, to always yield something dissipative. On the right the sign drops out because we normalise by the largest eigenvalue anyway and therefore retain the dissipative nature (and the sign in the figure above). Does that make sense? I'll try to update the docs to better explain that. Thanks for pointing this out.

In spectral space the minus sign of the eigenvalues of the Laplacian cancels out with the $(-1)^{n+1}$. E.g., in rectilinear coordinates, $\nabla^2 \to - k^2$ and thus

$$ (-1)^{n+1} \nabla^{2n} \to (-1)^{n+1} (- k^2)^n = - k^{2n} $$

@milankl
Copy link
Member

milankl commented Apr 6, 2023

That's what I said, no?

@navidcy
Copy link
Collaborator Author

navidcy commented Apr 6, 2023

Yes, but it was before coffee for me so I got a bit confused with eigenvalue normalizing and thought I'd clarify. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📚 Improvements or additions to documentation dynamics 〰️ Affects the dynamical core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants