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
292 stars 99 forks source link

use adaptive stepping for exact Riemann integration #2869

Closed zingale closed 2 weeks ago

zingale commented 4 weeks ago

PR summary

There are 2 main changes here:

  1. the riemann_support.H header is now split into 2, one for shocks and one for rarefactions
  2. the rarefaction integration no longer uses a fixed stepsize, but instead now does an adaptive RK4 integration

This changes results to roundoff / tol error, as expected.

PR motivation

PR checklist

zingale commented 3 weeks ago

Here are comparisons of density for the 4 test problems from our 2015 paper:

riemann_compare_test1 riemann_compare_test2 riemann_compare_test3 riemann_compare_test4

zingale commented 2 weeks ago

Here are some of my notes for this: exact_riemann.pdf

zingale commented 2 weeks ago

I don't think that the expression I am using is wrong. If the iteration were successful, then u_star,l = u_star,r, so this average is just dealing with the tolerance of the solver.

zingale commented 2 weeks ago

it is actually just a different average, the Z's there are the slope at the intersection, which should be the same if we've converged the root finding.