From e56bbf10f02424dd0897514aefd8443b35f51dff Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 6 Jun 2024 20:00:57 -0400 Subject: [PATCH] some generalization of the NSE table stuff (#1580) this fixes table initialization and linking with nets other than aprox19. The instructions are also updated. --- Make.Microphysics_extern | 4 +--- interfaces/network_initialization.cpp | 8 +++++++- networks/aprox19/actual_network.H | 6 ------ nse_tabular/README.md | 16 +++++++++++++--- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Make.Microphysics_extern b/Make.Microphysics_extern index 75e797618e..31d3643440 100644 --- a/Make.Microphysics_extern +++ b/Make.Microphysics_extern @@ -91,9 +91,7 @@ table: ifeq ($(USE_NSE_TABLE),TRUE) NSE_TABULAR_HOME ?= $(MICROPHYSICS_HOME)/nse_tabular EXTERN_CORE += $(NSE_TABULAR_HOME) - ifeq ($(findstring aprox19, $(NETWORK_DIR)), aprox19) - all: nsetable - endif + all: nsetable endif nsetable: diff --git a/interfaces/network_initialization.cpp b/interfaces/network_initialization.cpp index ead21a33a5..594c7e9166 100644 --- a/interfaces/network_initialization.cpp +++ b/interfaces/network_initialization.cpp @@ -12,6 +12,9 @@ #include #endif #endif +#ifdef NSE_TABLE +#include +#endif void network_init() { @@ -28,6 +31,9 @@ nonaka_init(); actual_rhs_init(); #endif +#ifdef NSE_TABLE + // read in the NSE table (if there is one) + init_nse(); +#endif #endif - } diff --git a/networks/aprox19/actual_network.H b/networks/aprox19/actual_network.H index c60e9252d5..78c509e454 100644 --- a/networks/aprox19/actual_network.H +++ b/networks/aprox19/actual_network.H @@ -15,17 +15,11 @@ using namespace amrex; #include #include #include -#ifdef NSE_TABLE -#include -#endif using namespace network_rp; AMREX_INLINE void actual_network_init() { -#ifdef NSE_TABLE - init_nse(); -#endif } #ifndef NSE diff --git a/nse_tabular/README.md b/nse_tabular/README.md index ffbc002f39..dfa0814785 100644 --- a/nse_tabular/README.md +++ b/nse_tabular/README.md @@ -46,6 +46,10 @@ The table provides: * X(A), X(B), ... : the reduced composition mass fractions. They are assumed to be in the same order as the nuclei in the on-grid network. +The data is ordered such that rho varies the slowest (from low to +high), T varies the next slowest (from low to high), and Ye varies the +fastest (from high to low). + ## Generating the table @@ -90,9 +94,15 @@ following should be copied into the on-grid network's subdirectory into it. Note the `table_name` string in the header should be updated to reflect the new name of the table. -The data is ordered such that rho varies the slowest (from low to -high), T varies the next slowest (from low to high), and Ye varies the -fastest (from high to low). +You also need to add a line to the network's `Make.package` of the form: + +``` +NSE_TABLE_NAME := nse.tbl +``` + +making sure to use whatever filename you renamed the table to. This will +be used to ensure that the table is symlinked into the build directory. + ## Outputting for a different network