Hi Joseph,
I recently leveraged Dedalus to perform a 2D EVP calculations -- although it required to write down many equations (on the order of 50-100), coupled along the Fourier direction. I believe, the current implementation of Dedalus does not do this job for you automatically. So, we do have to combine a bit of analytical work with numerics. The idea basically is to create a 1D EVP but promote the state vector to a higher dimensional one where the state vector is X = [ f_m(r) for m in range(1, N) ] and f_m(r) is the eigenfunction at Fourier mode number m and N is the maximum number of Fourier modes that you wish to couple (this coupling is necessary when you Fourier transform analytically the product of background term that depends both on theta and r and the other term which is your desired state vector.)
For example, if you do not have a theta dependence on the background field, then the perturbations written as f_m(r)*exp(i*m*theta)*exp(i*lambda*t)* immediately yields a 1D-EVP:
dt(M(f_m)) = L(f_m) where f_m is the eigenfunction of the linear operator L (that can have terms like d/dr and radial dependent terms), M is another linear operator. This is straightforward.
__________________________________________________
Now, bring in the background field that has both theta and r dependence. Linearizing your equations to keep first order terms in state vectors (i.e., f_m's), you will this time have coupling between different f_m's (m is the Fourier mode number) as the background field (let's call it B, for brevity and background, instead of omega_pnsq) also has m dependance. You will probably have something like:
dt(M(f_m)) = L(f_m) + \sum_j {A_j * f_{m-j}} where A_j is another linear operator (some algebraic function of the background B; here j in A_j represents the jth Fourier component of A (which is eventually of B)). Please note that this is still a linear equation, but the only complexity is that it couples many f_m's together (thus you would get the 2D eigenmodes later on; think of them as different modes of vibration of a 2D membrane like that of a drum).
Set you background fields in different variables named as B_ij where ij represents the Fourier mode number:
for jj in range(0, N+1):
nccvar = domain.new_field()
nccvar.set_scales('1', keep_data=False)
nccvar['c'] = feed_your_background_data_for_m_equals_to_jj_but_only_the_radial_dependence
problem.parameters['B_jj'] = ncc_var
Now, the task is to write equations like below (which can be done via a python script to write strings that represent all of your coupled but still linear equations and then pass them onto one of the greatest friends -- Dedalus :) ).
for m in range(1,N):
problem.add_equation("dt(M(f_m)) - L(f_m) - \sum_j {A_j* f_{m-j}} = 0") ...(1)
problem.add_bc("write your BCs for each f_m")
Now, build an eigenvalue solver and proceed with the usual 1D EVP. The only difference between the usual 1D EVP (where the background does not depend on theta) and 2D (as done here) is that the earlier one has problem vars = [f_{one_particular_m_only}] and the latter one has problem_vars = [f_1, f_2, ..., f_N]. We still employ the same 1D Chebyshev basis, in this method. Maybe Dedalus v3 has interesting features to deal with such problems.
**Note: Since the coupling between the background and the state vectors brings in the full summation in j (in equation 1 above), you will end up with one particular annoying term: A_m* f_0, which unless f_0=0, you would have to get rid of this term by solving an associated linear BVP as discussed briefly in
https://groups.google.com/g/dedalus-users/c/PeQLSCUArRU**
BTW, I noticed that you have created 2D domain and I was wondering why you have np.complex128 for the eigenfunctions (I am assuming you are working with real observables). Since the method employed here is 1D EVP but for the appended state vectors, i.e., the new state vector = X = [f_1(r), f_2(r), ...f_N(r)], there should be 1D domain and thus it is now required to have np.complex128 data type for the eigenfunctions as you have imposed as they are Fourier-transformed materials.
Hope this helps. Please let us know if you happen to have some more queries.
Thanks a lot,
Bindesh
UW-Madison