Skip to content

Commit

Permalink
Merge branch 'development' into divu_shock_flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jul 9, 2024
2 parents 8db7ccb + b373e92 commit 17c0344
Show file tree
Hide file tree
Showing 23 changed files with 158 additions and 122 deletions.
24 changes: 24 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# 24.07

* Reorganizing of the existing 2-shock and HLL Riemann solvers
(#2887, #2888, #2889, #2890)

* Some clean-up, accuracy improvements, and optimization of the
exact Riemann solver in preparation for coupling it to simulations
(#2868, #2869, #2875)

* a new problem setup, `subch_planar`, for exploring He detonations
(#2870, #2873, #2881, #2883, #2886, #2877, #2878)

* clean-up the computation of the shock variable for hybrid Riemann
solves (#2865)

* code clean-ups (#2852, #2871, #2891)

* documentation improvements (#2843, #2879)

* add an EditorConfig (#2872)

* add the circular detonation problem to test multidimensional shock
algorithms (#2858)

# 24.06

* Doc updates (#2839, #2842, #2846, #2851, #2854, #2860)
Expand Down
2 changes: 0 additions & 2 deletions Diagnostics/DustCollapse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ USE_OMP = FALSE

USE_REACT = FALSE

USE_ACC = FALSE

# programs to be compiled
ALL: dustcollapse_$(DIM)d.ex

Expand Down
2 changes: 0 additions & 2 deletions Diagnostics/Radiation/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ USE_OMP = FALSE

USE_REACT = FALSE

USE_ACC = FALSE

ALL: radhelp

radhelp:
Expand Down
2 changes: 0 additions & 2 deletions Diagnostics/Sedov/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ USE_OMP = FALSE

USE_REACT = FALSE

USE_ACC = FALSE

# programs to be compiled
ALL: sedov_$(DIM)d.ex

Expand Down
6 changes: 0 additions & 6 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ build_status:
# The default is to include the sponge functionality
DEFINES += -DSPONGE

# OpenACC support
ifeq ($(USE_ACC), TRUE)
DEFINES += -DACC
endif



#------------------------------------------------------------------------------
# Castro directories
Expand Down
132 changes: 66 additions & 66 deletions Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
plotfile = det_x_plt00040
time = 5.1558159140336702e-06
variables minimum value maximum value
density 185259659.3 216625503.34
xmom -13760057465 2.9527146771e+16
density 185260165.55 216617920.63
xmom -63255523503 2.9519346608e+16
ymom 0 0
zmom 0 0
rho_E 1.3062473821e+26 2.7889438781e+26
rho_e 1.3062473821e+26 2.7747059271e+26
Temp 50000000.026 7845854559
rho_H1 2.1203665799e-22 0.020000114043
rho_He3 0.0017224849005 0.021021778892
rho_He4 94384549.451 200001582.65
rho_C12 0.020000000216 21181006.118
rho_N14 1.9999997268e-22 0.020000159166
rho_O16 0.02 19209.472033
rho_Ne20 0.02 3403.302453
rho_Mg24 0.02 23330.215568
rho_Si28 0.02 2016074.1508
rho_S32 0.02 1656865.76
rho_Ar36 0.02 822126.88981
rho_Ca40 0.02 725125.60248
rho_Ti44 0.02 34184.806642
rho_Cr48 0.02 78126.082381
rho_Fe52 0.02 278040.09021
rho_Fe54 0.02 94986843.638
rho_Ni56 0.02 2239055.987
rho_n 0.020000004562 234580.08802
rho_p 0.019999995438 3609282.9073
rho_enuc -4.6902991452e+29 3.5778382148e+32
pressure 5.5236728651e+25 1.1610543806e+26
kineng 0 2.047804488e+24
soundspeed 612864631.21 895226062.8
Gamma_1 1.3599756296 1.3819790602
MachNumber 0 0.16114515958
uplusc 612864631.21 999634014.46
uminusc -895226128.14 -612860627.32
entropy 98214767.758 336273492.62
rho_E 1.3062473821e+26 2.7891343298e+26
rho_e 1.3062473821e+26 2.7748842906e+26
Temp 50000000.026 7845854931.5
rho_H1 2.1204369735e-22 0.020000115169
rho_He3 0.0017224919811 0.02102205401
rho_He4 94366339.651 200001593.93
rho_C12 0.020000000216 21203829.102
rho_N14 1.999999523e-22 9.5660401467
rho_O16 0.02 19209.488217
rho_Ne20 0.02 3464.1596069
rho_Mg24 0.02 23322.458406
rho_Si28 0.02 2015700.9685
rho_S32 0.02 1656602.4644
rho_Ar36 0.02 822007.67426
rho_Ca40 0.02 724910.24417
rho_Ti44 0.02 34179.295535
rho_Cr48 0.02 78164.189237
rho_Fe52 0.02 278034.23746
rho_Fe54 0.02 95026946.079
rho_Ni56 0.02 2239485.5719
rho_n 2.1204369735e-22 234580.3659
rho_p 0.019999995438 3610755.3081
rho_enuc -4.6808330292e+29 3.576498348e+32
pressure 5.5236728651e+25 1.1610548795e+26
kineng 0 2.0467474279e+24
soundspeed 612864631.21 895226097.3
Gamma_1 1.3599756287 1.3819899024
MachNumber 0 0.16110770916
uplusc 612864631.21 999815567.76
uminusc -895226406.71 -612860598.79
entropy 98214767.758 336273469.46
magvort 0 0
divu -97879.954761 33763.419428
eint_E 6.5312369103e+17 1.3804343698e+18
eint_e 6.5312369103e+17 1.3804343698e+18
logden 8.267780861 8.3357095848
StateErr_0 185259659.3 216625503.34
StateErr_1 50000000.026 7845854559
divu -97879.470548 34017.033805
eint_E 6.5312369103e+17 1.380434464e+18
eint_e 6.5312369103e+17 1.380434464e+18
logden 8.2677820478 8.3356943826
StateErr_0 185260165.55 216617920.63
StateErr_1 50000000.026 7845854931.5
StateErr_2 1e-30 9.9999779324e-11
X(H1) 1e-30 9.9999779324e-11
X(He3) 8.9862145938e-12 9.9999601254e-11
X(He4) 0.48407561714 0.9999999982
X(C12) 1.0000000108e-10 0.099893133188
X(N14) 1e-30 1.0000000432e-10
X(O16) 1e-10 9.6047335509e-05
X(Ne20) 1e-10 1.6050538078e-05
X(Mg24) 1e-10 0.00011120690546
X(Si28) 1e-10 0.010059247336
X(S32) 1e-10 0.0083490446432
X(Ar36) 1e-10 0.0041662673673
X(Ca40) 1e-10 0.0037091533301
X(Ti44) 1e-10 0.00017295101573
X(Cr48) 1e-10 0.00040068985616
X(Fe52) 1e-10 0.0013377863567
X(Fe54) 1e-10 0.46486808681
X(Ni56) 1e-10 0.010336068249
X(n) 1.0000002281e-10 0.001172900139
X(p) 9.9999977027e-11 0.017594951746
abar 4.000000001 6.7310197958
Ye 0.49998669648 0.50001557929
x_velocity -68.800275809 138706560.7
X(He3) 8.9861142144e-12 9.9999601254e-11
X(He4) 0.48402941802 0.9999999982
X(C12) 1.0000000108e-10 0.09999745037
X(N14) 1e-30 4.5113532098e-08
X(O16) 1e-10 9.6047388579e-05
X(Ne20) 1e-10 1.6337008127e-05
X(Mg24) 1e-10 0.00011119757992
X(Si28) 1e-10 0.010055548658
X(S32) 1e-10 0.0083462743796
X(Ar36) 1e-10 0.0041650262219
X(Ca40) 1e-10 0.0037107481152
X(Ti44) 1e-10 0.00017303069502
X(Cr48) 1e-10 0.00040092438857
X(Fe52) 1e-10 0.0013387480381
X(Fe54) 1e-10 0.46489869655
X(Ni56) 1e-10 0.010338413209
X(n) 1e-30 0.0011729011118
X(p) 9.999997703e-11 0.017599035758
abar 4.000000001 6.7313315116
Ye 0.49998670822 0.50001557428
x_velocity -316.27744461 138671594.27
y_velocity 0 0
z_velocity 0 0
t_sound_t_enuc 3.4412406685e-13 0.97470686938
enuc -2.4937801624e+21 1.6516237283e+24
magvel 0 138706560.7
radvel -68.800275809 138706560.7
circvel 0 2.8284271247
magmom 0 2.9527146771e+16
t_sound_t_enuc 3.4411968038e-13 0.97442435993
enuc -2.4887686639e+21 1.6510630042e+24
magvel 0 138671594.27
radvel -316.27744461 138671594.27
circvel 0 2.4494897428
magmom 0 2.9519346608e+16
angular_momentum_x 0 0
angular_momentum_y 0 0
angular_momentum_z 0 0
Expand Down
10 changes: 9 additions & 1 deletion Exec/science/Detonation/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ void problem_initialize_state_data (int i, int j, int k,

state(i,j,k,URHO) = problem::dens;

Real sigma = 1.0_rt / (1.0_rt + std::exp(-(c_T - xcen)/ width));
Real sigma_arg = -(c_T - xcen) / width;
Real sigma;
// need to avoid FP overflow for sigma_arg >= 709
// 1/(1 + exp(100)) ~= 3e-44, which is much smaller than machine epsilon
if (sigma_arg < 100) {
sigma = 1.0_rt / (1.0_rt + std::exp(sigma_arg));
} else {
sigma = 0.0_rt;
}

state(i,j,k,UTEMP) = problem::T_l + (problem::T_r - problem::T_l) * (1.0_rt - sigma);

Expand Down
14 changes: 7 additions & 7 deletions Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
zmom 0 0
rho_E 7.4982062146e+11 5.0669247218e+24
rho_e 7.1077581849e+11 5.0640768325e+24
Temp 242288.68588 1409652233.6
rho_He4 8.693611703e-17 3.5999033031
Temp 242288.68588 1409652233.5
rho_He4 8.693611703e-17 3.5999032997
rho_C12 3.4774446812e-05 7825956.6934
rho_O16 5.2161670217e-05 11739149.75
rho_Ne20 8.693611703e-17 181951.05725
rho_Mg24 8.693611703e-17 1192.7969771
rho_Si28 8.693611703e-17 6.6913703161
rho_S32 8.693611703e-17 0.00019493291757
rho_Ne20 8.693611703e-17 181951.05685
rho_Mg24 8.693611703e-17 1192.796965
rho_Si28 8.693611703e-17 6.691370255
rho_S32 8.693611703e-17 0.00019493291439
rho_Ar36 8.693611703e-17 1.9565534609e-05
rho_Ca40 8.693611703e-17 1.9565534331e-05
rho_Ti44 8.693611703e-17 1.9565534308e-05
Expand All @@ -25,5 +25,5 @@
grav_x -684991644 -51428.243166
grav_y -739606241.84 739606820.44
grav_z 0 0
rho_enuc -8.1740856019e+12 7.6429034917e+23
rho_enuc -6.4788917128e+12 7.6429034813e+23

1 change: 0 additions & 1 deletion Exec/unit_tests/model_burner/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ COMP = gnu

USE_MPI = TRUE
USE_OMP = FALSE
USE_ACC = FALSE

USE_DIFFUSION = FALSE
USE_GRAV = FALSE
Expand Down
4 changes: 0 additions & 4 deletions Source/driver/Castro.H
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ using namespace castro;

#include <fundamental_constants.H>

constexpr int HISTORY_SIZE=40;
constexpr int PSTAR_BISECT_FACTOR = 5;


#include <AMReX_BC_TYPES.H>
#include <AMReX_AmrLevel.H>
#include <AMReX_iMultiFab.H>
Expand Down
4 changes: 3 additions & 1 deletion Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
#include <ambient.H>
#include <castro_limits.H>

#include <riemann_constants.H>

using namespace amrex;

bool Castro::signalStopJob = false;
Expand Down Expand Up @@ -392,7 +394,7 @@ Castro::read_params ()
#endif

if (riemann_solver == 1) {
if (riemann_shock_maxiter > HISTORY_SIZE) {
if (riemann_shock_maxiter > riemann_constants::HISTORY_SIZE) {
amrex::Error("riemann_shock_maxiter > HISTORY_SIZE");
}

Expand Down
1 change: 1 addition & 0 deletions Source/hydro/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ CEXE_sources += riemann.cpp
CEXE_headers += HLL_solvers.H
CEXE_headers += riemann_solvers.H
CEXE_headers += riemann_2shock_solvers.H
CEXE_headers += riemann_constants.H
CEXE_headers += riemann_type.H
CEXE_headers += slope.H
CEXE_headers += reconstruction.H
Expand Down
11 changes: 6 additions & 5 deletions Source/hydro/riemann_2shock_solvers.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using namespace amrex::literals;

#include <riemann_constants.H>
#include <riemann_type.H>
#ifdef RADIATION
#include <Radiation.H>
Expand Down Expand Up @@ -60,7 +61,7 @@ namespace TwoShock {
const amrex::Real gdot, const amrex::Real gmin, const amrex::Real gmax,
const int lriemann_shock_maxiter, const amrex::Real lriemann_pstar_tol,
amrex::Real& pstar, amrex::Real& gamstar,
bool& converged, amrex::GpuArray<amrex::Real, PSTAR_BISECT_FACTOR*HISTORY_SIZE>& pstar_hist_extra) {
bool& converged, amrex::GpuArray<amrex::Real, riemann_constants::PSTAR_BISECT_FACTOR * riemann_constants::HISTORY_SIZE>& pstar_hist_extra) {

// we want to zero
// f(p*) = u*_l(p*) - u*_r(p*)
Expand Down Expand Up @@ -106,7 +107,7 @@ namespace TwoShock {
converged = false;
amrex::Real pstar_c = 0.0;

for (int iter = 0; iter < PSTAR_BISECT_FACTOR * lriemann_shock_maxiter; iter++) {
for (int iter = 0; iter < riemann_constants::PSTAR_BISECT_FACTOR * lriemann_shock_maxiter; iter++) {

pstar_c = 0.5_rt * (pstar_lo + pstar_hi);
pstar_hist_extra[iter] = pstar_c;
Expand Down Expand Up @@ -167,7 +168,7 @@ namespace TwoShock {
constexpr amrex::Real weakwv = 1.e-3_rt;

#ifndef AMREX_USE_GPU
amrex::GpuArray<amrex::Real, HISTORY_SIZE> pstar_hist;
amrex::GpuArray<amrex::Real, riemann_constants::HISTORY_SIZE> pstar_hist;
#endif


Expand Down Expand Up @@ -336,7 +337,7 @@ namespace TwoShock {
pstarl = amrex::max(pstarl, small_pres);
pstaru = amrex::max(pstaru, small_pres);

amrex::GpuArray<amrex::Real, PSTAR_BISECT_FACTOR*HISTORY_SIZE> pstar_hist_extra;
amrex::GpuArray<amrex::Real, riemann_constants::PSTAR_BISECT_FACTOR * riemann_constants::HISTORY_SIZE> pstar_hist_extra;

pstar_bisection(pstarl, pstaru,
ql.un, ql.p, taul, gamel, clsql,
Expand All @@ -352,7 +353,7 @@ namespace TwoShock {
std::cout << iter_l << " " << pstar_hist[iter_l] << std::endl;
}
std::cout << "pstar extra history: " << std::endl;
for (int iter_l = 0; iter_l < PSTAR_BISECT_FACTOR * riemann_shock_maxiter; iter_l++) {
for (int iter_l = 0; iter_l < riemann_constants::PSTAR_BISECT_FACTOR * riemann_shock_maxiter; iter_l++) {
std::cout << iter_l << " " << pstar_hist_extra[iter_l] << std::endl;
}

Expand Down
16 changes: 16 additions & 0 deletions Source/hydro/riemann_constants.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef RIEMANN_CONSTANTS_H
#define RIEMANN_CONSTANTS_H

#include <AMReX_REAL.H>

using namespace amrex::literals;

namespace riemann_constants {
constexpr amrex::Real smlp1 = 1.e-10_rt;
constexpr amrex::Real small = 1.e-8_rt;
constexpr amrex::Real smallu = 1.e-12_rt;
constexpr int HISTORY_SIZE=40;
constexpr int PSTAR_BISECT_FACTOR = 5;
}

#endif
7 changes: 0 additions & 7 deletions Source/hydro/riemann_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@

using namespace amrex::literals;

namespace riemann_constants {
const amrex::Real smlp1 = 1.e-10_rt;
const amrex::Real small = 1.e-8_rt;
const amrex::Real smallu = 1.e-12_rt;
}


struct RiemannState
{
amrex::Real rho;
Expand Down
3 changes: 1 addition & 2 deletions Source/sdc/sdc_newton_solve.H
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ sdc_newton_solve(const Real dt_m,

// solve the linear system: Jac dU = -f
#ifdef NEW_NETWORK_IMPLEMENTATION
RHS::dgefa(Jac);
info = 0;
info = RHS::dgefa(Jac);
#else
IArray1D ipvt;
dgefa<NumSpec+1>(Jac, ipvt, info);
Expand Down
Loading

0 comments on commit 17c0344

Please sign in to comment.