From 17431baebae284a60d0eaecde8d08e1446c25c32 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Mon, 1 Jul 2024 08:28:19 -0400 Subject: [PATCH 1/2] for pstar convergence in exact_riemann use std::abs() --- Util/exact_riemann/riemann_star_state.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Util/exact_riemann/riemann_star_state.H b/Util/exact_riemann/riemann_star_state.H index 2448247129..5aeee19bcf 100644 --- a/Util/exact_riemann/riemann_star_state.H +++ b/Util/exact_riemann/riemann_star_state.H @@ -144,7 +144,7 @@ riemann_star_state(const amrex::Real rho_l, const amrex::Real u_l, const amrex:: // estimate the error in the current star solution amrex::Real err1 = std::abs(ustar_r - ustar_l); - amrex::Real err2 = pstar_new - pstar; + amrex::Real err2 = std::abs(pstar_new - pstar); if (err1 < tol * amrex::max(std::abs(ustar_l), std::abs(ustar_r)) && err2 < tol * pstar) { From 65a818c83dbc7061f1f671bc659cd28e3606f670 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Mon, 1 Jul 2024 10:22:05 -0400 Subject: [PATCH 2/2] remove the ustar test --- Util/exact_riemann/README.md | 11 +++++++++++ Util/exact_riemann/riemann_star_state.H | 9 ++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Util/exact_riemann/README.md b/Util/exact_riemann/README.md index ada8e281ec..013a81693a 100644 --- a/Util/exact_riemann/README.md +++ b/Util/exact_riemann/README.md @@ -12,3 +12,14 @@ https://ui.adsabs.harvard.edu/abs/2015ApJS..216...31Z/abstract and more details are given there. To build the solver, simply type 'make' in this directory. + + +Notes: + +* ``test2`` is a vacuum + + The velocity in the star region should be 0, but it seems that + slight differences in the rarefaction integration from the left and + from the right give different roundoff, resulting in a small, finite + velocity. This can be controlled a bit by tightening the tolerance + in the rarefaction integration. diff --git a/Util/exact_riemann/riemann_star_state.H b/Util/exact_riemann/riemann_star_state.H index 5aeee19bcf..31e1952722 100644 --- a/Util/exact_riemann/riemann_star_state.H +++ b/Util/exact_riemann/riemann_star_state.H @@ -142,12 +142,11 @@ riemann_star_state(const amrex::Real rho_l, const amrex::Real u_l, const amrex:: amrex::Real pstar_new = pstar - Z_l * Z_r * (ustar_r - ustar_l) / (Z_l + Z_r); - // estimate the error in the current star solution - amrex::Real err1 = std::abs(ustar_r - ustar_l); - amrex::Real err2 = std::abs(pstar_new - pstar); + // estimate the error in the current pstar solution - if (err1 < tol * amrex::max(std::abs(ustar_l), std::abs(ustar_r)) && - err2 < tol * pstar) { + amrex::Real error = std::abs(pstar_new - pstar); + + if (error < tol * pstar) { converged = true; }