AMReX-Astro / Castro

Castro (Compressible Astrophysics): An adaptive mesh, astrophysical compressible (radiation-, magneto-) hydrodynamics simulation code for massively parallel CPU and GPU architectures.
http://amrex-astro.github.io/Castro
Other
299 stars 97 forks source link

more fixes for amr.subcycling_mode = None + retry #2824

Closed zingale closed 5 months ago

zingale commented 5 months ago

PR summary

PR motivation

PR checklist

yut23 commented 5 months ago

Is this bite taken out of the secondary an issue? inputs_2d_collision.test says it sets problem.collision_separation = 1.25 to start with the stars already merging, but these don't look like very well-behaved initial conditions. Screenshot from 2024-04-18 19-11-08

zingale commented 5 months ago

if you build Sedov in 2D and run as:

./Castro2d.gnu.MPI.ex inputs.2d.sph_in_cylcoords castro.change_max=1.01 amr.subcycling_mode=None castro.fixed_dt=2.e-5

then it retries after step 2 and dies in the Riemann solver

zingale commented 5 months ago

actually, it runs if we add castro.riemann_solver=0

zingale commented 5 months ago

okay... with this PR, the Sedov retries a bit at the start and then runs fine. Looking at the output, it looks reasonable (by eye). I will compare to the subcycling case in a bit.

On development, it constantly retries and then dies with too many subcycles.

So I think that these fixes are needed.

yut23 commented 5 months ago

This number (which I'm assuming is some sort of placeholder) seems to be leaking into the state variables. Changing it to 1.e40 changes all the invalid density values, for example from -5e+65 to -5e+45. https://github.com/AMReX-Astro/Castro/blob/5f44c133d85369cba7d2a12edc5f40ffaa271b3e/Source/gravity/Gravity.cpp#L396

zingale commented 5 months ago

regression tests pass: http://groot.astro.sunysb.edu/Castro/test-suite/gfortran/2024-04-19-001/index.html