From 6b70251da9224294d7248774fe1ba177109787f9 Mon Sep 17 00:00:00 2001 From: Zhi Date: Mon, 27 Nov 2023 15:54:34 -0500 Subject: [PATCH 1/4] only allow chabrier1998 or null when USE_NSE_NET=TRUE --- Make.Microphysics_extern | 7 +++++++ nse_solver/nse_solver.H | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Make.Microphysics_extern b/Make.Microphysics_extern index 787482f9f5..d290dee656 100644 --- a/Make.Microphysics_extern +++ b/Make.Microphysics_extern @@ -145,6 +145,13 @@ ifeq ($(USE_NSE_TABLE), TRUE) endif endif +# Only allows null chabrier1998 screening with NSE_NET +ifeq ($(USE_NSE_NET),TRUE) + ifneq ($(or $(filter-out null chabrier1998,$(SCREEN_METHOD)),),) + $(error USE_NSE_NET can only be used with null or chabrier1998 screening) + endif +endif + clean:: @if [ -L helm_table.dat ]; then rm -f helm_table.dat; fi @if [ -L reaclib_rate_metadata.dat ]; then rm -f reaclib_rate_metadata.dat; fi diff --git a/nse_solver/nse_solver.H b/nse_solver/nse_solver.H index a7a4ea9ff4..32b048eaea 100644 --- a/nse_solver/nse_solver.H +++ b/nse_solver/nse_solver.H @@ -89,10 +89,10 @@ void apply_nse_exponent(T& nse_state) { Real T_in = nse_state.T_fixed > 0.0_rt ? nse_state.T_fixed : nse_state.T; Real exponent; - // if we use a non-null screening method. + // if we use chabrier1998 screening // Get the required terms to calculate coulomb correction term, u_c -#if SCREEN_METHOD != 0 +#if SCREEN_METHOD == 1 // Find n_e for original state; const amrex::Real n_e = nse_state.rho * nse_state.y_e / C::m_u; @@ -112,8 +112,8 @@ void apply_nse_exponent(T& nse_state) { #endif // term for calculating u_c - // if use non-null screening, calculate the coulomb correction term -#if SCREEN_METHOD != 0 + // if use chabrier1998 screening, calculate the coulomb correction term +#if SCREEN_METHOD == 1 gamma = std::pow(zion[n], 5.0_rt/3.0_rt) * Gamma_e; // chemical potential for coulomb correction From 5dbd2c4b26fd47095fcf7a88f973afa59d9da39b Mon Sep 17 00:00:00 2001 From: Zhi Date: Mon, 27 Nov 2023 15:56:11 -0500 Subject: [PATCH 2/4] fix comment grammar --- Make.Microphysics_extern | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.Microphysics_extern b/Make.Microphysics_extern index d290dee656..063e029934 100644 --- a/Make.Microphysics_extern +++ b/Make.Microphysics_extern @@ -145,7 +145,7 @@ ifeq ($(USE_NSE_TABLE), TRUE) endif endif -# Only allows null chabrier1998 screening with NSE_NET +# Only allow null chabrier1998 screening with NSE_NET ifeq ($(USE_NSE_NET),TRUE) ifneq ($(or $(filter-out null chabrier1998,$(SCREEN_METHOD)),),) $(error USE_NSE_NET can only be used with null or chabrier1998 screening) From bd897599757e525a9a9846b21389cf31d72a74e9 Mon Sep 17 00:00:00 2001 From: Zhi Date: Mon, 27 Nov 2023 15:59:55 -0500 Subject: [PATCH 3/4] change SCREEN_METHOD for NSE_NET unit tests --- nse_solver/make_table/GNUmakefile | 2 ++ unit_test/test_nse/GNUmakefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nse_solver/make_table/GNUmakefile b/nse_solver/make_table/GNUmakefile index 0b48798f98..71b95bfc2a 100644 --- a/nse_solver/make_table/GNUmakefile +++ b/nse_solver/make_table/GNUmakefile @@ -24,6 +24,8 @@ EOS_DIR := helmholtz # This sets the network directory NETWORK_DIR := aprox21 +SCREEN_METHOD := chabrier1998 + CONDUCTIVITY_DIR := stellar INTEGRATOR_DIR = VODE diff --git a/unit_test/test_nse/GNUmakefile b/unit_test/test_nse/GNUmakefile index 42590e8a9f..34e21f6078 100644 --- a/unit_test/test_nse/GNUmakefile +++ b/unit_test/test_nse/GNUmakefile @@ -26,6 +26,8 @@ EOS_DIR := helmholtz # This sets the network directory NETWORK_DIR := aprox21 +SCREEN_METHOD := chabrier1998 + CONDUCTIVITY_DIR := stellar INTEGRATOR_DIR = VODE From 6a8d32b8348e9b010899d7c4ea96a1997cc75386 Mon Sep 17 00:00:00 2001 From: Zhi Date: Mon, 27 Nov 2023 16:15:09 -0500 Subject: [PATCH 4/4] fix screen_method number --- nse_solver/nse_solver.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nse_solver/nse_solver.H b/nse_solver/nse_solver.H index 32b048eaea..b357f2c16b 100644 --- a/nse_solver/nse_solver.H +++ b/nse_solver/nse_solver.H @@ -92,7 +92,7 @@ void apply_nse_exponent(T& nse_state) { // if we use chabrier1998 screening // Get the required terms to calculate coulomb correction term, u_c -#if SCREEN_METHOD == 1 +#if SCREEN_METHOD == 4 // Find n_e for original state; const amrex::Real n_e = nse_state.rho * nse_state.y_e / C::m_u; @@ -113,7 +113,7 @@ void apply_nse_exponent(T& nse_state) { // term for calculating u_c // if use chabrier1998 screening, calculate the coulomb correction term -#if SCREEN_METHOD == 1 +#if SCREEN_METHOD == 4 gamma = std::pow(zion[n], 5.0_rt/3.0_rt) * Gamma_e; // chemical potential for coulomb correction