Implementing MHD with Incompressible Flow

59 views
Skip to first unread message

Siddhant Ranka

unread,
Jul 1, 2024, 5:10:12 PMJul 1
to Dedalus Users
Hello,

My name is Siddhant Ranka and I am a new dedalus user. I have previously sent a post about using the MHD model to simulate the merging of two Taylor states and I had run into an error implementing the MHD continuity equation. I still have been unable to implement the MHD continuity equation, so I have been trying to implement MHD with incompressible flow by keeping the density constant. I am using an IVP with 2 by 2 mesh, cartesian coordinates in 3 dimensions, and the RealFourier basis for the x, y, and z bases. I am using div(v) = 0 to represent incompressible flow. However, I keep getting RuntimeError: Factor is exactly singular as my error. I have attached the code for this problem below. My problem is set up as SSX = d3.IVP([v, A, lnrho, T, phi, tau_A], time=t, namespace=locals()). I have also attached a screenshot showing the rest of the simulation equations.

Thank you,

Siddhant
IVP_SSX.py
Screenshot 2024-07-01 at 5.09.35 PM.png

Daniel Lecoanet

unread,
Jul 1, 2024, 5:53:39 PMJul 1
to Dedalus Users
Hi Siddhant,

You’ve missing a pressure gauge. See for example this script:


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/024cac31-9d07-420a-b231-2610ce215eecn%40googlegroups.com.
<IVP_SSX.py><Screenshot 2024-07-01 at 5.09.35 PM.png>

Siddhant Ranka

unread,
Jul 1, 2024, 6:52:10 PMJul 1
to Dedalus Users
Thank you Daniel. I implemented the pressure gauge by adding integ(p)  = 0 and by adding div(v) + tau_p = 0, but I still keep getting the same error. I created a scalar pressure field p as well by writing p = dist.Field(name='p', bases=(xbasis, ybasis, zbasis)). I have attached my new screenshots of the code below. 

Sincerely,

Siddhant
Screenshot 2024-07-01 at 6.43.34 PM.png
Screenshot 2024-07-01 at 6.43.56 PM.png

Siddhant Ranka

unread,
Jul 2, 2024, 10:06:50 AMJul 2
to Dedalus Users
It works now - I forgot to add grad(p) to the momentum equation.

Thank you,

Siddhant

Reply all
Reply to author
Forward
0 new messages