MHD setup in Dedalus2

53 views
Skip to first unread message

Erin E Goldstraw

unread,
Feb 2, 2026, 5:19:19 AMFeb 2
to Dedalus Users
Dear Dedalus Users,

I am trying to solve the MHD equations. 
The equations and boundary conditions are given in Equation_Summary.pdf. 
My current code setup is given in solar-fmhd-d2_minimal.py. 

Could someone please check this set up? 
I am not sure about the gauge conditions and keep encountering problems with numeric instabilities when running this code. 

Any advice would be greatly appreciate. I would like to understand the Dedalus methodology better.

Please and thank you,
Erin Goldstraw

Equation_Summary.pdf
solar-fmhd-d2_minimal.py

Sadokat Malikova

unread,
Feb 2, 2026, 5:43:05 AMFeb 2
to dedalu...@googlegroups.com
Dear Erin Goldstraw,

From a quick glance, you are imposing perfectly conducting wall condition:
∂zBx = 0, ∂zBy = 0, Bz = 0.
In your code try with:
 bz=0  bc. 
I think this is the problem.

with best regards,
Sadokat

--
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 visit https://groups.google.com/d/msgid/dedalus-users/056c8aa2-ee28-4e15-956d-34521e324933n%40googlegroups.com.

Erin E Goldstraw

unread,
Feb 2, 2026, 5:57:27 AMFeb 2
to Dedalus Users
Dear Sadokat,

Thank you for your suggestion. 
I think I have previously tried both d/dz(bz)=0 and bz=0 at one time or another without much affect. 
I will try again. 

Any other suggestions are welcome.
Thank you,
Erin

Erin E Goldstraw

unread,
Mar 4, 2026, 4:29:20 AM (11 days ago) Mar 4
to dedalu...@googlegroups.com
Dear Dedalus group,

Thank you for the suggestion. Setting the boundary conditions for Bz to be the derivative of Bz=0 does allow the code to run at least for a couple of hours. I haven't run it longer yet. 

Here are a couple more questions.
Is it possible to use the ideal induction equation for Bz on the boundary? How would this be written?

This code runs at the moment using a maximum timestep of 1e-4. Increasing this to 1e-3 results in infinite kinetic energy before long. 
Any suggestions and advice to improve the stability of this code and in general would be appreciated. In theory I plan to run these simulations for around a simulation time of 400. So a timestep of 1e-4 is going to take a while. 

Thank you again,
Erin Goldstraw

You received this message because you are subscribed to a topic in the Google Groups "Dedalus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dedalus-users/2D9fEt_PPMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/75cfdb7c-6452-4898-ab8c-7b86bbffb15an%40googlegroups.com.


--
Dr Erin E. Goldstraw
Reply all
Reply to author
Forward
0 new messages