Skip to content

Commit

Permalink
split constants into riemann_constants.H
Browse files Browse the repository at this point in the history
allow the exact Riemann solver to use the new constants
  • Loading branch information
zingale committed Jul 1, 2024
1 parent ad30404 commit 9e7e820
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
2 changes: 2 additions & 0 deletions 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
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
1 change: 1 addition & 0 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
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
#define RIEMANN_CONSTANTS

#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
11 changes: 0 additions & 11 deletions Source/hydro/riemann_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@

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;


}


struct RiemannState
{
amrex::Real rho;
Expand Down
2 changes: 1 addition & 1 deletion Util/exact_riemann/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Blocs := .

# we explicitly want runtime_parameters.H so we have access to
# Castro's runtime parameter system
Blocs += $(CASTRO_HOME)/Source/driver
Blocs += $(CASTRO_HOME)/Source/driver $(CASTRO_HOME)/Source/hydro

include $(CASTRO_HOME)/Exec/Make.Castro
6 changes: 3 additions & 3 deletions Util/exact_riemann/riemann_shock.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <eos_type.H>
#include <eos.H>

#include <riemann_type.H>
#include <riemann_constants.H>

AMREX_INLINE
void
Expand Down Expand Up @@ -97,7 +97,7 @@ shock(const amrex::Real pstar,

amrex::ignore_unused(u_s);

amrex::Real rhostar_hist[riemann_solver::max_iters], Ws_hist[riemann_solver::max_iters];
amrex::Real rhostar_hist[riemann_constants::HISTORY_SIZE], Ws_hist[riemann_constants::HISTORY_SIZE];

// compute the Z_s function for a shock following C&G Eq. 20 and
// 23. Here the "_s" variables are the state (L or R) that we are
Expand Down Expand Up @@ -163,7 +163,7 @@ shock(const amrex::Real pstar,
// now did we converge?

if (! converged) {
for (int i = 0; i < castro::riemann_riemann_solver::max_iters; ++i) {
for (int i = 0; i < castro::riemann_shock_maxiter; ++i) {
std::cout << i << " " << rhostar_hist[i] << " " << Ws_hist[i] << std::endl;
}

Expand Down

0 comments on commit 9e7e820

Please sign in to comment.