DedalusProject / dedalus

A flexible framework for solving PDEs with modern spectral methods.
http://dedalus-project.org/
GNU General Public License v3.0
513 stars 121 forks source link

S2 and shell latitudinal NCCs #185

Closed kburns closed 2 years ago

kburns commented 2 years ago

This PR includes work on S2 and shell latitudinal NCCs.

kburns commented 2 years ago

Meridional NCCs and operators now seem to be working pretty well in the shell. Problems will fail if there are both radial and meridional NCCs (currently caught by tests). This can be avoided now by promoting all NCCs to meridional bases, even if they are only radial.

The PR also includes the sparse EVP solver, but this test is currently failing with some ARPACK convergence error -- haven't dug into this yet.

kburns commented 2 years ago

@lecoanet anything else you think we should add for this PR? Real variables would be nice, but I don't think should hold this up, since it's useful enough now for EVPs. Maybe we should fix it to allow radial NCCs and not require promotion to meridional for everything?

lecoanet commented 2 years ago

I would like to add the rotating RBC problem to examples. Otherwise I think the PR is good. There are other things we could add, but nothing seems crucial.

kburns commented 2 years ago

Maybe we should make a "zcross" operator for the shell like for S2, just as a convenience function for Coriolis type terms which come up a lot but would otherwise take a few lines to implement.

lecoanet commented 2 years ago

I added a rotating RBC example problem. I don't think a zcross operator is important. It is nice for S2 because it requires the skew operator which is confusing. I think it is more intuitive how we do this in the shell, so making a specific operator does not feel necessary to me. I would be fine merging in this PR at this stage.

kburns commented 2 years ago

I'm just polishing the example script to match the syntax of the other examples -- but any reason not to use the first-order formulation here? Looks like it gives very similar eigenvalues to the second-order.

lecoanet commented 2 years ago

Go for the 1st order formulation -- I think I started with 1st order formulation, but switched to 2nd order when I was trying to find the discrepancy with the Dormy paper, and never switched back. I think it's a good idea to do 1st order for consistency with other example scripts.

kburns commented 2 years ago

Updated example to 1st order. Rebased onto master. All tests passing on mac x86.