Hi all,
I've just written my first script using Dedalus and am having a couple of problems I can't find documentation to, can you give some advice?
I'm trying to solve the barotropic vorticity equation on a doubly-periodic beta plane. Taking inspiration from the tutorial notebooks and some of the advice on this list to avoid a singular matrix, I wrote the script attached.
My questions:
1. What is the correct way to set the initial condition in the spectral domain?
I want the IC to be a random excitation of specific wavenumbers. I thought this would work:
zeta = solver.state['zeta']
k = domain.bases[0].wavenumbers[:, np.newaxis]
l = domain.bases[1].wavenumbers[np.newaxis, :]
ksq = k**2 + l**2
init = np.random.random(ksq.shape) + 1j*np.random.random(ksq.shape)
init[ksq > 50**2] = 0
zeta['c'] = init
but the resulting grid has a single spot in the corners (see attached image of initial cond).
2. cfl.compute_dt() is returning infinity after the first timestep.
Velocities u and v are diagnostic in my computation, why is this not working?
3. The evolution is slower than an equivalent single-threaded script I wrote that uses numpy fft routines. Am I doing something silly in defining my problem that is causing it to run slowly?
4. Is there a standard method to add hyperdiffusivity or a high wavenumber filter?
Many thanks in advance,
James