Hello everyone,
I'm working on a 1D problem with a background flow that has a sort of "smooth square function" shape.
I've tried to represent it in Dedalus.
Unfortunately, I run into 3 problems, which I think are all connected:
1) The mode amplitude declines very slowly with mode number (it's still an exponential, but a very slow one: I would need to include 1024 modes to get good precision).
2) I see some ringing for the derivative in the plateau of the square function
3) I see some ringing for the derivative at the boundaries of the domain
I suppose it makes sense that a spectral code would struggle to represent something with sharp features. However, my issues persist even when I smooth the sides of the square to the point where they each occupy 25% of the domain.
I was wondering if someone has encoutered a similar issue before, and found a workaround?
Thanks for your help !
Nathan
PS: I attach a minimal working example, so you can play around.