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
298 stars 97 forks source link

Geometry source terms should be traced #809

Closed zingale closed 23 hours ago

zingale commented 4 years ago

In trace_ppm.cpp, the geometric source terms are added to the states with a mysterious eta factor that depends on the Courant number. We should instead include the geometric source terms into the characteristic tracing, as in the original PPM paper.

zingale commented 4 years ago

In particular, it looks like we are using the PLM tracing for PPM

zingale commented 4 years ago

Here's a derivation of the geometric sources terms for the primitive system we solve euler_geometric_source_terms.pdf

zingale commented 4 years ago

One idea was to simply add these in src_to_prim, but the problem there is that these sources depend on the direction of the reconstruction. When we are doing the tracing in x (r), the sources are present, but they are not present in any of the other tracing directions. This directional dependence doesn't exist for any of the other primitive sources.

zingale commented 1 year ago

I think that the cleanest way to do this is to create a function add_geometry_sources() that is called in trace_ppm.cpp when we are doing the reconstruction of the other source terms. This will depend on idir and we will need to explicitly set do_trace for these components to be true.

zingale commented 2 months ago

another issue with trying to do this in src_to_prim is that we now call src_to_prim when doing the shock detection, so we really do want that to be directionally independent.