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

only compute hydro version of shock variable for hybrid Riemann #2865

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Source/hydro/Castro_ctu_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,13 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co
shk.resize(obx, 1);
fab_size += shk.nBytes();

Array4<Real> const shk_arr = shk.array();

// Multidimensional shock detection
// Used for the hybrid Riemann solver

#ifdef SHOCK_VAR
bool compute_shock = true;
#else
bool compute_shock = false;
#endif
// this is a local shock variable used only for the Riemann
// solver -- this will never be used to update the value in the
// conserved state.

Array4<Real> const shk_arr = shk.array();

// get the primitive variable hydro sources

Expand All @@ -285,7 +282,7 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co
hydro::src_to_prim(i, j, k, dt, U_old_arr, q_arr, old_src_arr, src_corr_arr, src_q_arr);
});

if (hybrid_riemann == 1 || compute_shock) {
if (hybrid_riemann == 1) {
shock(obx, q_arr, old_src_arr, shk_arr);
}
else {
Expand Down