High Mach Number Turbulence can cause NaNs #596
Replies: 2 comments 7 replies
-
The first thing that comes to mind is units. It looks like you're trying to run the code in CGS. While this might work, it can also lead to numerical issues. Codes as large as this are rarely purely scale-free -- at some point a number may be considered "effectively 0" or "effectively infinity" by the algorithm, based on its size relative to 1. Even if not, floating-point numbers have finite range, and some of your values already exceed single-precision. Given the perfectly scale-free nature of the equations of hydrodynamics, it's always possible (and I usually suggest) to scale your values by some typical normalizations for your problem. For this, you might want to end up with a system where rho_0, v_wind, and x1max are all 1; then tlim would probably also end up closer to 1 as well. Other than that, you could try turning on different pieces of physics one at a time. It looks like you have turbulent driving, and also some sort of custom mass injection. Can the code run fine with one of them turned off? |
Beta Was this translation helpful? Give feedback.
-
This sounds like a problem I'm familiar with! What I have done in a similar simulation is to drive turbulence with an instantaneous energy injection |
Beta Was this translation helpful? Give feedback.
-
I am running a simulation to model stellar winds. I need an initial turbulence injection to model a realistic ISM.
When injecting turbulence (even with all my physical sources off, just an ambient background with hydro) after a few timesteps I get NaNs for all variables in some cells. This then spreads to the rest of the domain over a few timesteps. At the start, the velocities are on the order of km/s^-1 (realistic for the ISM) and the mach number is between 3-120.
At a certain point. The velocities will explode to 15 orders of magnitude larger and the mach numbers become on the order of 1e10
I have tried various combinations of spatial reconstruction (up to 4c), Riemman solvers (Roe, LLF, HLLC, LHLLC) and time integrators (VL2, RK2, RK3, SSPRK(5,4)) all with the same outcome.
Higher resolutions seem to last longer before the issue. 32^3 tests cause it to happen at around 4e12 s, while 512^3 on a HPC happens around 16.e13 s. Different spatial reconstructions also effect the time it takes. 4c causes it to happen on the first time step.
Has anyone else encountered a similar issue or have a solution? Or any way I could go about solving this?
Thanks for any help!
This is my input file:
Beta Was this translation helpful? Give feedback.
All reactions