Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use adaptive stepping for exact Riemann integration #2869

Merged
merged 17 commits into from
Jun 19, 2024

Conversation

zingale
Copy link
Member

@zingale zingale commented Jun 6, 2024

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

  • test suite needs to be run on this PR
  • this PR will change answers in the test suite to more than roundoff level
  • all newly-added functions have docstrings as per the coding conventions
  • the CHANGES file has been updated, if appropriate
  • if appropriate, this change is described in the docs

@zingale zingale changed the title [WIP] use adaptive stepping for exact Riemann integration use adaptive stepping for exact Riemann integration Jun 8, 2024
@zingale
Copy link
Member Author

zingale commented Jun 8, 2024

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
Copy link
Member Author

zingale commented Jun 17, 2024

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

Copy link
Collaborator

@aisclark91 aisclark91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks great, there is only one issue:

In riemman_star_state.H, after ustar_l and ustar_r are computed of each iteration, in line 141 we obtain :
ustar = 0.5_rt * (ustar_l + ustar_r);
This expression is not right, the actual expression is:
ustar = (Z_l * ustar_l + Z_r * ustar_r)/(Z_l + Z_r)
In accordance with Van Leer [22] eq A3. I double checked it to be sure.

@zingale
Copy link
Member Author

zingale commented Jun 19, 2024

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 zingale merged commit 5f48f95 into AMReX-Astro:development Jun 19, 2024
25 checks passed
@zingale zingale deleted the rarefaction_integration branch June 19, 2024 16:26
@zingale
Copy link
Member Author

zingale commented Jun 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants