Skip to content

Commit

Permalink
make the shock threshold runtime settable
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Jan 7, 2024
1 parent 69d7001 commit 4123355
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Source/driver/_cpp_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,12 @@ react_rho_min Real 0.0
react_rho_max Real 1.e200

# disable burning inside hydrodynamic shock regions
# note: requires compiling with `USE_SHOCK_VAR=TRUE`
disable_shock_burning int 0

# shock detection threshold for grad{P} / P
shock_detection_threshold Real 0.6666666666666666666666_rt

# initial guess for the temperature when inverting the EoS (e.g. when
# calling eos_input_re)
T_guess Real 1.e8
Expand Down
4 changes: 1 addition & 3 deletions Source/hydro/advection_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ Castro::shock(const Box& bx,
// we look for |grad P . dx| / P > 2/3 and div u < 0
// This is basically the method in Gronow et al. 2020

constexpr Real eps = 2.0_rt / 3.0_rt;

const auto dx = geom.CellSizeArray();
const int coord_type = geom.Coord();

Expand Down Expand Up @@ -150,7 +148,7 @@ Castro::shock(const Box& bx,

Real gradPdx_over_P = std::sqrt(dP_x * dP_x + dP_y * dP_y + dP_z * dP_z) / q_arr(i,j,k,QPRES);

if (gradPdx_over_P > eps && div_u < 0.0_rt) {
if (gradPdx_over_P > castro::shock_detection_threshold && div_u < 0.0_rt) {
shk(i,j,k) = 1.0_rt;
} else {
shk(i,j,k) = 0.0_rt;
Expand Down

0 comments on commit 4123355

Please sign in to comment.