Problem with constant field

40 views
Skip to first unread message

Lautaro Alvear

unread,
Jan 27, 2026, 12:14:16 PM (7 days ago) Jan 27
to Dedalus Users
Hi Dedalus experts, I have been simulating axisymmetric compressible magnetohydrodynamics in a star with the Cowling approximation (i.e, with a gravitational potential that is constant in time) and I have been keeping track of the forces acting on the fluid. When I plot the variation of these quantities, I see that the gravitational force term of the Euler equation  (\nabla \Phi) is changing in time, with it's RMS value decreasing linearly with a slope of the order ~ 1e-10.

This seems extremely strange to me, as I do not change this quantity at all in the code, only assigning it the initial value (which I do reading and interpolating a file that has this value for certain values of r), including it in the Euler equation (without adding it as a field to the solver as to not evolve it) and including it in necessary tasks for the file handler, such as the gravitational energy or the RMS value of this quantity.

I would like to know if someone has ran into similar issues or if someone knows what could be causing this. Im running the code with a resolution of (1,64,128) parallelized in 16 processes on a [1,16] mesh. This seems relevant as, looking at the difference between the components, the radial component seems to be alternating between shells without difference and shells where the difference is not equal to 0.

Below I attach a video showing the difference of nabla Phi for each of the components.

Best Regards,

Lautaro.


DeltaGravForcePlot.mp4

Daniel Lecoanet

unread,
Jan 27, 2026, 5:03:05 PM (7 days ago) Jan 27
to dedalu...@googlegroups.com
Hi Lautaro,

While Phi is not changing in your problem, if you define it as a field, Dedalus will, by default, transform it between grid and coefficient spaces on each timestep. This introduces transform error which can slowly build up over time, but which typically stays very small (as you said, about 10^-10). To eliminate this, and to make the simulations more efficient, you should use the d3.Grid operator which fixes grad(Phi). E.g.,

grad_Phi = d3.Grid(grad(Phi)).evaluate()

Hope that helps,
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 visit https://groups.google.com/d/msgid/dedalus-users/8e5ff080-b737-4427-b585-001db94f17ean%40googlegroups.com.
<DeltaGravForcePlot.mp4>

Lautaro Alvear

unread,
Jan 29, 2026, 11:48:41 AM (5 days ago) Jan 29
to Dedalus Users
Thanks Daniel, that fixed the issue :).

Best Regards,

Lautaro.
Reply all
Reply to author
Forward
0 new messages