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

Enforce chabrier1998 or null screening with NSE_NET #1398

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions Make.Microphysics_extern
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ ifeq ($(USE_NSE_TABLE), TRUE)
endif
endif

# 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)
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
Expand Down
2 changes: 2 additions & 0 deletions nse_solver/make_table/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ EOS_DIR := helmholtz
# This sets the network directory
NETWORK_DIR := aprox21

SCREEN_METHOD := chabrier1998

CONDUCTIVITY_DIR := stellar

INTEGRATOR_DIR = VODE
Expand Down
8 changes: 4 additions & 4 deletions nse_solver/nse_solver.H
Original file line number Diff line number Diff line change
Expand Up @@ -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 == 4

// Find n_e for original state;
const amrex::Real n_e = nse_state.rho * nse_state.y_e / C::m_u;
Expand All @@ -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 == 4
gamma = std::pow(zion[n], 5.0_rt/3.0_rt) * Gamma_e;

// chemical potential for coulomb correction
Expand Down
2 changes: 2 additions & 0 deletions unit_test/test_nse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ EOS_DIR := helmholtz
# This sets the network directory
NETWORK_DIR := aprox21

SCREEN_METHOD := chabrier1998

CONDUCTIVITY_DIR := stellar

INTEGRATOR_DIR = VODE
Expand Down