Factor is exactly singular error in 3D model adaptation

33 views
Skip to first unread message

Nathan Stolnicki

unread,
Jul 2, 2024, 2:07:25 PM (3 days ago) Jul 2
to Dedalus Users

Hello!


I am trying to implement a 3D two fluid model of reconnection into Dedalus as an IVP (equations 1 & 2 in this paper https://iopscience.iop.org/article/10.1088/1742-6596/401/1/012019/pdf). However, I am currently stuck where the simulation returns a factor is exactly singular error immediately after the solver builds. I have implemented dissipation which allows me to set the quantities of interest to zero at the boundaries. However, even without the dissipation terms and boundary conditions the simulation will return a factor is exactly singular error immediately. I believe this to be an issue arising from my implementation of the third (z) dimension as I have had success in the past with 2D models similar to this one. I am aware of the gauge condition needed for the dt(U) equation, and so we have a tau term and corresponding integ(phi) = 0 equation. Any help or insight into this problem would be greatly appreciated! I have attached the current version of the code to this post.


Thank you!

Nathan Stolnicki

3d_IVP.py

Jeffrey S. Oishi

unread,
Jul 2, 2024, 2:22:03 PM (3 days ago) Jul 2
to dedalu...@googlegroups.com
Hi Nathan,

I'd love to help, but that paper is rather difficult for me to
understand. What is the meaning of the bracket in 3D? More
fundamentally, what does and does not depend on z? Note that the flux
function is said to depend only on x and y, but then a Laplacian of it
is defined. Is that taken to be only in the x-y plane? I think without
answers to these questions, it would be difficult to say what is wrong
with your script. Perhaps it would be worthwhile to rewrite equation 1
and 2 of that paper in standard vectorial notation to make clear what
exactly the quantities that depend on x, y, z are and then try to
implement that.

Jeff
> --
> 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/a9c9c58e-acd8-4a69-b2d2-affaf9af744cn%40googlegroups.com.

Zach Williams

unread,
Jul 3, 2024, 9:58:16 AM (2 days ago) Jul 3
to Dedalus Users
Hi Jeff,

Thanks for the response! Nathan and I have been playing around with a few different models as we explore what we might find interesting for future projects.

I agree that some of their notation is confusing. The model from which Eqns 1 and 2 derive (Schep and Pegaroro 1994) allows for the quantities (including psi) to vary in all three spatial dimensions, so we are treating all variables as such with x,y, and z dependence (to have psi(x,y) would be strange, given that J = -Lap(psi) explicitly does have z dependence). However, the model does have a defined guide field in the z direction, so there is a distinction between 'perp' and 'parallel'. As such, the brackets follow the usual definition for derivatives in the perpendicular direction, namely [A,B] = z-hat dot grad(A) cross grad(B) or dx(A)dy(B) - dx(B)dy(A).

Our biggest confusion right now is our inability to get around the 'singular equation error', when we try to strip down the equations to as simple a form as possible. We studied an application of this model that is only 2D (remove all z derivative terms) with great success - for some reason it seems adding the extra dimension z and nothing else causes problems. This is my/our first time playing around with 3 spatial dimensions in Dedalus so I'm guessing it's just a matter of our lack of experience.

I hope that provides some clarity, we welcome any thoughts you or others may have!

Cheers,
Zach

Jeffrey S. Oishi

unread,
Jul 3, 2024, 10:32:23 AM (2 days ago) Jul 3
to dedalu...@googlegroups.com
Hi Zach,

The issue goes away if you use RealFourier bases and np.float64 as the dtype.

Jeff
> To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/7b0ba174-c643-4d51-8c0c-653555ce4317n%40googlegroups.com.

Zach Williams

unread,
Jul 3, 2024, 10:44:49 AM (2 days ago) Jul 3
to Dedalus Users
Hi Jeff,

I had thought that might be an issue and we have previously checked that - double checking now unfortunately we still get the issue even with RealFourier and np.float64. I'll check and make sure our D3 is up-to-date, we'll play around with that unless you have other thoughts.

Thank you!

Cheers,
Zach

Jeffrey S. Oishi

unread,
Jul 3, 2024, 10:51:53 AM (2 days ago) Jul 3
to dedalu...@googlegroups.com
Zach,

In such a case, you might also check your parameters. I'll note your
simulation crashed nearly immediately for me when I used RealFourier
and float64, but it was not exactly singular.

Jeff
> To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/86179399-b887-410a-84cc-ccd6366d352dn%40googlegroups.com.

Keaton Burns

unread,
Jul 3, 2024, 11:02:10 AM (2 days ago) Jul 3
to dedalu...@googlegroups.com
Hi all,

It looks like the “tau_psi2” term needs to be “lift(tau_psi2)” in the “dt(F)” equation. This helps the conditioning a lot.

Best,
-Keaton


Reply all
Reply to author
Forward
0 new messages