From 9edc7c1ffd42d84fbe445053a881c76d133cef6f Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Fri, 21 Jul 2023 15:29:55 -0400 Subject: [PATCH] Renumber the screening methods so null is at index 0 (#1286) --- Make.Microphysics_extern | 8 ++++---- nse_solver/nse_solver.H | 4 ++-- screening/screen.H | 20 ++++++++++---------- sphinx_docs/source/screening.rst | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Make.Microphysics_extern b/Make.Microphysics_extern index 2ee4665125..984e461e4c 100644 --- a/Make.Microphysics_extern +++ b/Make.Microphysics_extern @@ -15,13 +15,13 @@ ifeq ($(USE_NONAKA_PLOT),TRUE) endif SCREEN_METHOD ?= screen5 -ifeq ($(SCREEN_METHOD), screen5) +ifeq ($(SCREEN_METHOD), null) DEFINES += -DSCREEN_METHOD=0 -else ifeq ($(SCREEN_METHOD), chugunov2007) +else ifeq ($(SCREEN_METHOD), screen5) DEFINES += -DSCREEN_METHOD=1 -else ifeq ($(SCREEN_METHOD), chugunov2009) +else ifeq ($(SCREEN_METHOD), chugunov2007) DEFINES += -DSCREEN_METHOD=2 -else ifeq ($(SCREEN_METHOD), null) +else ifeq ($(SCREEN_METHOD), chugunov2009) DEFINES += -DSCREEN_METHOD=3 else ifeq ($(SCREEN_METHOD), chabrier1998) DEFINES += -DSCREEN_METHOD=4 diff --git a/nse_solver/nse_solver.H b/nse_solver/nse_solver.H index d5117ab67f..b8fadacbaf 100644 --- a/nse_solver/nse_solver.H +++ b/nse_solver/nse_solver.H @@ -89,7 +89,7 @@ void apply_nse_exponent(T& nse_state) { // if we use a non-null screening method. // Get the required terms to calculate coulomb correction term, u_c -#if SCREEN_METHOD != 3 +#if SCREEN_METHOD != 0 // three unit-less constants for calculating coulomb correction term // see Calder 2007, doi:10.1086/510709 for more detail @@ -119,7 +119,7 @@ void apply_nse_exponent(T& nse_state) { // term for calculating u_c // if use non-null screening, calculate the coulomb correction term -#if SCREEN_METHOD != 3 +#if SCREEN_METHOD != 0 gamma = std::pow(zion[n], 5.0_rt/3.0_rt) * Gamma_e; // chemical potential for coulomb correction diff --git a/screening/screen.H b/screening/screen.H index 34599b27a8..868fa1060e 100644 --- a/screening/screen.H +++ b/screening/screen.H @@ -17,13 +17,13 @@ using namespace amrex; using namespace integrator_rp; #if SCREEN_METHOD == 0 -const std::string screen_name = "screen5"; +const std::string screen_name = "null"; #elif SCREEN_METHOD == 1 -const std::string screen_name = "chugunov2007"; +const std::string screen_name = "screen5"; #elif SCREEN_METHOD == 2 -const std::string screen_name = "chugunov2009"; +const std::string screen_name = "chugunov2007"; #elif SCREEN_METHOD == 3 -const std::string screen_name = "null"; +const std::string screen_name = "chugunov2009"; #elif SCREEN_METHOD == 4 const std::string screen_name = "chabrier1998"; #endif @@ -977,16 +977,16 @@ void actual_screen(const plasma_state_t& state, Real& scor, Real& scordt) { #if SCREEN_METHOD == 0 - actual_screen5(state, scn_fac, scor, scordt); -#elif SCREEN_METHOD == 1 - chugunov2007(state, scn_fac, scor, scordt); -#elif SCREEN_METHOD == 2 - chugunov2009(state, scn_fac, scor, scordt); -#elif SCREEN_METHOD == 3 // null screening amrex::ignore_unused(state, scn_fac); scor = 1.0_rt; scordt = 0.0_rt; +#elif SCREEN_METHOD == 1 + actual_screen5(state, scn_fac, scor, scordt); +#elif SCREEN_METHOD == 2 + chugunov2007(state, scn_fac, scor, scordt); +#elif SCREEN_METHOD == 3 + chugunov2009(state, scn_fac, scor, scordt); #elif SCREEN_METHOD == 4 chabrier1998(state, scn_fac, scor, scordt); #endif diff --git a/sphinx_docs/source/screening.rst b/sphinx_docs/source/screening.rst index fb5e837f1b..e54cd1a878 100644 --- a/sphinx_docs/source/screening.rst +++ b/sphinx_docs/source/screening.rst @@ -40,11 +40,11 @@ The options are: This includes the portion in the appendix that blends in the weak screening limit. +* ``chabrier1998``: + + This implements the screening of :cite:`Chabrier_1998` as well as the quantum corrections for strong screening according to screen5. This is suggested in the appendix of :cite:`Calder_2007`. This screening is compatible with NSE calculations unlike ``screen5``, ``chugunov2007``, and ``chugunov2009``. This screening should be valid in the weak screening regime, :math:`\Gamma < 0.1`, and strong screening regime, :math:`1 \lesssim \Gamma \lesssim 160`. + * ``null`` : This disables screening by always returning 1 for the screening enhancement factor. - -* ``chabrier1998``: - - This implements the screening of :cite:`Chabrier_1998` as well as the quantum corrections for strong screening according to screen5. This is suggested in the appendix of :cite:`Calder_2007`. This screening is compatible with NSE calculations unlike ``screen5``, ``chugunov2007``, and ``chugunov2009``. This screening should be valid in the weak screening regime, :math:`\Gamma < 0.1`, and strong screening regime, :math:`1 \lesssim \Gamma \lesssim 160`.