SpeedyWeather / SpeedyWeather.jl

Play atmospheric modelling like it's LEGO.
https://speedyweather.github.io/SpeedyWeather.jl/dev
MIT License
400 stars 24 forks source link

Spectral filtering instead of hyperdiffusion #547

Open milankl opened 3 weeks ago

milankl commented 3 weeks ago

We currently do the solid lines for horizontal diffusion of vorticity and divergence which change shape with higher resolution (hence the time scale is adapted to compensate that somehow)

image

I believe a more scale-selective diffusion just via a spectral filter might avoid overly diffusive simulations while efficiently taking out power at high wavenumbers, like the dashed lines above, which were created with

$$ K(l) = \frac{1}{2} (1 - \text{erf}(s(l - T - k)))$$

with parameters $k = 0$ (the shift, for k=-5 the 5th highest wavenumbers is dampened like the highest wavenumber with $k=0$) and the stretch $s = 0.12$ which controls the scale-selectiveness, ($s=0.7$ is more like a biharmonic Laplacian, etc.)

Coded like

using SpecialFunctions
T = 31
l = 0:T
s = 0.05
k = 0
1/2 * (erfc(s*(l - T - k)))

(erfc = 1 - erf)