inquiry about getting the eigenfunction of EVP in dedalus v2

228 views
Skip to first unread message

Yin Wang

unread,
Jan 25, 2024, 10:52:12 PMJan 25
to Dedalus Users
Dear dedalus experts,

I am a beginner of dedalus and am currently using dedalus v2.

My colleague wrote a script based on dedalus v2 to use EVP solver to calculate the maximum growth rate of magnetorotational instability in Taylor-Couette flow. I have attached the script in this thread.

The script runs well on my PC, and I get the maximum growth rate. Now my goal is to get the eigenfunctions of velocity and magnetic fields corresponding to the maximum growth rate. I am wondering if someone could let me know how can I realize this? Or if there is already a thread with the similar issue, please let me know.

Thank you very much!

Best,
Yin

mri_test.py

Daniel Lecoanet

unread,
Jan 26, 2024, 9:09:07 AMJan 26
to Dedalus Users
Hi,


It will put the eigenvector data into solver.state, so that you can access the velocity, magnetic field, etc. associated with each eigenmode.

Daniel

--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/504e2afa-4449-43ca-a460-dacf008fa98bn%40googlegroups.com.
<mri_test.py>

Jeffrey S. Oishi

unread,
Jan 26, 2024, 9:24:53 AMJan 26
to dedalu...@googlegroups.com
Hi,

Also, please see eigentools: https://github.com/DedalusProject/eigentools

which provides additional support for eigenvalue problems in d2.

Jeff

Yin Wang

unread,
Feb 12, 2024, 11:31:53 PMFeb 12
to Dedalus Users
Hi Daniel and Jeff,

Thank you both for the information and now I feel like I can use the "solver.set_state() method" to get the "eigenfunctions" of magnetic field and velocity field.

However, these "eigenfunctions" are still a little strange: for a given paramter set, no matter how large the Nr is ( Nr is the number of the Chebyshev grid points in radial direction), only the first 20 data points of each "eigenfunction" are finite (and they don't change with Nr), and all the rest data points are negligibly small.
This makes me feel like these "eigenfunctions" are in the "spectral coordinate" rather than in the "Chebyshev grid coordinate". Could you please confirm this? If this is the case, how can I convert these "spectral eigenfunction coffeecients" to "grid eigenfunction coefficients"?

I also attached my dedalus v2 script to get the  "eigenfunction" for your reference. In my code, at line101 I use "np.argmax" to find the index "ifast" of the eigenmode that has the largest growth rate. Then at line102 I use "solver.set_state(index=ifast)" to locate the corresponding "eigenfunctions". Here I assume that the fastest growing mode's indices in "solver.eigenvalues" and "solver.set_state" are the same, please also help confrim this.

Thank you in advance!

Best,
Yin
mri_EigenFunc_test.py

Adrian Fraser

unread,
Feb 13, 2024, 1:05:24 PMFeb 13
to Dedalus Users
Hi Yin,

I think you're correct that you're pulling the spectral coefficients. Take a look at input cell 8 here (just before the "Analysis" section), and see how u is set to solver.state['u'] and then you can specifically access u['g'] rather than u['c']. You might try something similar rather than how you are currently accessing these fields in your max_growth_rate function.

The eigenvalue/mode order is the same, yes. But just to reiterate Jeff's point: you should check out Eigentools because it has some quite helpful tools for exactly the things you're trying to do here.

Adrian

Yin Wang

unread,
Feb 18, 2024, 4:52:31 PMFeb 18
to Dedalus Users
Hi Adrian (and all),

Thanks for the information.
Now I can export the "grid coefficients" of the eigenfunction correctly, just by changing "solver.state['ur'].data" to "solver.state['ur']['g'].data" in my script.
My problem is solved, thanks a lot.

Best,
Yin

Luis

unread,
Jun 25, 2024, 2:29:34 PMJun 25
to Dedalus Users
Hi Adrian and all,

We are working on transfering our MRI code from dedalus v2 to v3. While I was working on the diskbasis, I don't know how to implement boundary conditions at two different radius. For example, we want to have non-slip boundary condition at both r = 1 and r =3. I wonder based on pipeflow script do you have any thought on how to implement these boundary conditions? Thank you!

Best
Hongke


Jeffrey S. Oishi

unread,
Jun 25, 2024, 2:36:16 PMJun 25
to dedalu...@googlegroups.com
Hi Hongke,

You want AnnulusBasis, not DiskBasis.

Jeff
> To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/b70126ca-71e2-42cc-b8c1-7da74b17a6c3n%40googlegroups.com.

Luis

unread,
Jun 25, 2024, 2:51:14 PMJun 25
to Dedalus Users
Hi Professor Oishi,

Ahhh, I see. Thank you!

Hongke

Luis

unread,
Jun 27, 2024, 2:04:52 PMJun 27
to Dedalus Users
Hi all,

I implemeneted a annulus flow using AnnulusBasis, but I have a new problem on solving the axissymmetric mode. And the error message is Non-square system: group=(0, None), I=259, J=260. I went back to the pipeflow script and I found the pipeflow script have the same problem if I change sp = solver.subproblems_by_group[(m, None)]  to sp = solver.subproblems_by_group[(0, None)].I wonder if I want to solve for the axissymetric mode then what should I change in terms of tau terms or something else. 

Best
Hongke

On Tuesday, June 25, 2024 at 2:36:16 PM UTC-4 jso...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages