[FLASH-USERS] Need Help with Non-positive/Zero dt in MHD rz Simulation.

Hansen, Eddie ehansen at pas.rochester.edu
Mon Jul 3 09:03:05 EDT 2023


This could be a result of how the fast Alfven speed is being calculated. We have seen that in rare cases this form can lead to non-positive dt (in Hydro_computeDt):
cfx2 = .5*((sndspd2+b2)+sqrt((sndspd2+b2)**2-4.*sndspd2*bbx2))

We believe this is due to rounding error giving a very small but negative value inside the sqrt(). An equivalent form, but one that guarantees a non-negative value is:
cfx2 = .5*((sndspd2+b2)+sqrt((sndspd2-b2)*(sndspd2-b2)+4.*sndspd2*(bby2+bbz2)))

This is around line 267 in Hydro_computeDt.F90. Your problem might be resolved if you comment out the old form and incorporate this new form (with analogous equations for cfy2 and cfz2).
--
Eddie Hansen
Research Scientist
Flash Center for Computational Science


From: flash-users <flash-users-bounces at flash.rochester.edu> on behalf of Sheth, Nishka <phc027 at usask.ca>
Date: Friday, June 30, 2023 at 7:24 PM
To: flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: [FLASH-USERS] Need Help with Non-positive/Zero dt in MHD rz Simulation.
Hello Flash users,

I am currently  trying to simulate an MHD flux tube using FLASH 4.6.2. The simulation is set up in a 2D rz cylindrical geometry, with initial conditions consisting of uniform density and pressure. I have introduced magnetic field components, B_r(r,z) and B_z(r,z), while the velocity field has not been incorporated yet.

I am facing an issue of dt getting non positive/ zero after few steps. I want to simulate my problem till t = 20 while I am receiving this error at around t = 1e-02.

I have made attempts to address the problem by adjusting the CFL number (like 0.1, 0.5, 0.8), simulating in the normalized units and experimenting with different Riemann solvers, but the issue remains unresolved. I am seeking guidance on how to overcome this error.

Furthermore, I have observed that this error consistently arises when I include the B_z field in my simulations, regardless of the magnetic field profile. Could anyone offer suggestions or insights on important considerations when incorporating the B_z field?

I would greatly appreciate any assistance in resolving these challenges.

Thank you in advance.

Nishka Sheth
Physics Graduate Student
University of Saskatchewan, Canada
phc027 at usask.ca

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20230703/af32d2ef/attachment.htm>


More information about the flash-users mailing list