From e6170398777c6715b2082319c84d43a56af4fd2f Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Wed, 19 Jun 2024 18:53:41 -0400 Subject: [PATCH] more cleaning --- .../ci-benchmarks/test1-riemann.out | 90 +++++++++---------- Util/exact_riemann/main.cpp | 2 - Util/exact_riemann/riemann_rarefaction.H | 3 - Util/exact_riemann/riemann_shock.H | 4 - Util/exact_riemann/riemann_star_state.H | 11 +-- 5 files changed, 49 insertions(+), 61 deletions(-) diff --git a/Util/exact_riemann/ci-benchmarks/test1-riemann.out b/Util/exact_riemann/ci-benchmarks/test1-riemann.out index 4c6ec142cf..1624fcf02c 100644 --- a/Util/exact_riemann/ci-benchmarks/test1-riemann.out +++ b/Util/exact_riemann/ci-benchmarks/test1-riemann.out @@ -68,51 +68,51 @@ 67 519531.25 3782769.06389 306131662.364 1.99799647911e+23 58852893.6708 9.19281449819e+16 1.50260347548 68 527343.75 3677627.42215 314046760.692 1.9150955856e+23 57947741.148 9.04497857546e+16 1.5041134824 69 535156.25 3573422.36381 322064216.687 1.83402150589e+23 57038358.4286 8.89637619826e+16 1.50565406349 - 70 542968.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 71 550781.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 72 558593.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 73 566406.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 74 574218.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 75 582031.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 76 589843.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 77 597656.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 78 605468.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 79 613281.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 80 621093.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 81 628906.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 82 636718.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 83 644531.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 84 652343.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 85 660156.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 86 667968.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 87 675781.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 88 683593.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 89 691406.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 90 699218.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 91 707031.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 92 714843.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 93 722656.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 94 730468.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 95 738281.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 96 746093.75 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 97 753906.25 3566771.3761 322581533.648 1.82889264617e+23 57003324.3672 8.8868625651e+16 1.50575410561 - 98 761718.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 99 769531.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 100 777343.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 101 785156.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 102 792968.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 103 800781.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 104 808593.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 105 816406.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 106 824218.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 107 832031.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 108 839843.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 109 847656.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 110 855468.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 111 863281.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 112 871093.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 113 878906.25 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 - 114 886718.75 2952884.63461 322581533.648 1.82889264617e+23 758658820.738 1.09750124478e+17 1.49554976549 + 70 542968.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 71 550781.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 72 558593.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 73 566406.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 74 574218.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 75 582031.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 76 589843.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 77 597656.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 78 605468.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 79 613281.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 80 621093.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 81 628906.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 82 636718.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 83 644531.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 84 652343.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 85 660156.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 86 667968.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 87 675781.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 88 683593.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 89 691406.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 90 699218.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 91 707031.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 92 714843.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 93 722656.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 94 730468.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 95 738281.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 96 746093.75 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 97 753906.25 3566771.39183 322581533.75 1.82889264698e+23 57003293.328 8.88686252995e+16 1.50575410519 + 98 761718.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 99 769531.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 100 777343.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 101 785156.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 102 792968.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 103 800781.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 104 808593.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 105 816406.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 106 824218.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 107 832031.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 108 839843.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 109 847656.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 110 855468.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 111 863281.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 112 871093.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 113 878906.25 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 + 114 886718.75 2952884.63392 322581533.75 1.82889264698e+23 758658822.183 1.09750124564e+17 1.49554976542 115 894531.25 1000000 0 2.55457320691e+22 999999.999997 4.08260803009e+16 1.57201404928 116 902343.75 1000000 0 2.55457320691e+22 999999.999997 4.08260803009e+16 1.57201404928 117 910156.25 1000000 0 2.55457320691e+22 999999.999997 4.08260803009e+16 1.57201404928 diff --git a/Util/exact_riemann/main.cpp b/Util/exact_riemann/main.cpp index 2c497f25eb..c2b3ed296d 100644 --- a/Util/exact_riemann/main.cpp +++ b/Util/exact_riemann/main.cpp @@ -18,8 +18,6 @@ int main(int argc, char *argv[]) { amrex::Initialize(argc, argv); std::cout << "starting the exact Riemann solver..." << std::endl; - std::cout << argv[1] << std::endl; - std::cout << strlen(argv[1]) << std::endl; // initialize the external runtime parameters in C++ diff --git a/Util/exact_riemann/riemann_rarefaction.H b/Util/exact_riemann/riemann_rarefaction.H index 9592225fa0..c5d98c6f87 100644 --- a/Util/exact_riemann/riemann_rarefaction.H +++ b/Util/exact_riemann/riemann_rarefaction.H @@ -68,7 +68,6 @@ riemann_invariant_rhs2(const amrex::Real u, const amrex::Real tau, const amrex:: amrex::ignore_unused(u); - std::cout << "in riemann_invariant_rhs2: " << u << " " << tau << " " << p << std::endl; eos_rep_t eos_state; eos_state.rho = 1.0_rt / tau; eos_state.p = p; @@ -326,8 +325,6 @@ rarefaction_to_u(const amrex::Real rho_s, const amrex::Real u_s, const amrex::Re bool finished = false; - std::cout << "integrating from u: " << u << " " << ustop << " " << xi << " " << c << std::endl; - // this will be used as an initial guess to accelerate the EOS inversions amrex::Real T = eos_state.T; diff --git a/Util/exact_riemann/riemann_shock.H b/Util/exact_riemann/riemann_shock.H index 93fc4c17ac..c91ac466de 100644 --- a/Util/exact_riemann/riemann_shock.H +++ b/Util/exact_riemann/riemann_shock.H @@ -129,10 +129,6 @@ shock(const amrex::Real pstar, 2.0_rt * (1.0_rt - gammaE_bar / gammaC_bar) * (gammaE_bar - 1.0_rt) * (pstar - p_s) / (pstar + p_s); - std::cout << "pstar, ps = " << pstar << " " << p_s << " " << gammaE_s << " " << gammaE_star << std::endl; - std::cout << (pstar/rho_s - (gammaE_star - 1.0_rt)/(gammaE_s - 1.0_rt) * p_s/rho_s); - std::cout << (pstar + 0.5_rt * (gammaE_star - 1.0_rt) * (pstar + p_s)); - // there is a pathological case that if p_s - pstar ~ 0, the root finding // just doesn't work. In this case, we use the ideas from CG, Eq. 35, and // take W = sqrt(gamma p rho) diff --git a/Util/exact_riemann/riemann_star_state.H b/Util/exact_riemann/riemann_star_state.H index 789d2b1417..67eeabada7 100644 --- a/Util/exact_riemann/riemann_star_state.H +++ b/Util/exact_riemann/riemann_star_state.H @@ -80,9 +80,6 @@ riemann_star_state(const amrex::Real rho_l, const amrex::Real u_l, const amrex:: // find the exact pstar and ustar std::cout << "solving for star state: " << std::endl; - std::cout << rho_l << " " << u_l << " " << p_l << std::endl; - std::cout << rho_r << " " << u_r << " " << p_r << std::endl; - // this procedure follows directly from Colella & Glaz 1985, section 1 // the basic idea is that we want to find the pstar that satisfies: @@ -118,7 +115,6 @@ riemann_star_state(const amrex::Real rho_l, const amrex::Real u_l, const amrex:: amrex::Real Z_l, Z_r; - std::cout << "iteration: " << iter << " " << pstar << " " << p_l << " " << p_r << std::endl; // left wave if (pstar - p_l > SMALL * p_l) { @@ -146,9 +142,6 @@ 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); - std::cout << "done with iteration " << iter << std::endl; - std::cout << "ustar_l/r, pstar: " << ustar_l << " " << ustar_r << " " << pstar_new << std::endl; - // estimate the error in the current star solution amrex::Real err1 = std::abs(ustar_r - ustar_l); amrex::Real err2 = pstar_new - pstar; @@ -164,6 +157,10 @@ riemann_star_state(const amrex::Real rho_l, const amrex::Real u_l, const amrex:: iter++; } + if (! converged) { + amrex::Error("star state did not converge"); + } + ustar = 0.5_rt * (ustar_l + ustar_r); std::cout << "found pstar, ustar: " << pstar << " " << ustar << std::endl;