diff --git a/.github/workflows/nse_table.yml b/.github/workflows/nse_table.yml index 58715f14af..3daf1e585a 100644 --- a/.github/workflows/nse_table.yml +++ b/.github/workflows/nse_table.yml @@ -26,26 +26,6 @@ jobs: sudo apt-get update -y -qq sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0 - - name: Compile, burn_cell (NSE, aprox19) - run: | - cd unit_test/burn_cell - make realclean - make NETWORK_DIR=aprox19 USE_NSE_TABLE=TRUE INTEGRATOR_DIR=VODE -j 4 - - - name: Run burn_cell (NSE, aprox19) - run: | - cd unit_test/burn_cell - ./main3d.gnu.ex inputs_aprox19.nse amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out - - - name: Print backtrace - if: ${{ failure() && hashFiles('unit_test/burn_cell/Backtrace.0') != '' }} - run: cat unit_test/burn_cell/Backtrace.0 - - - name: Compare to stored output (NSE, aprox19) - run: | - cd unit_test/burn_cell - diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox19_nse_unit_test.out - - name: Compile, burn_cell_sdc (NSE, aprox19) run: | cd unit_test/burn_cell_sdc diff --git a/Make.Microphysics_extern b/Make.Microphysics_extern index 64ca8faefe..60327aebc5 100644 --- a/Make.Microphysics_extern +++ b/Make.Microphysics_extern @@ -87,6 +87,15 @@ endif table: @if [ ! -f helm_table.dat ]; then echo Linking helm_table.dat; ln -s $(EOS_PATH)/helm_table.dat .; fi +# USE_ALL_NSE will be used if any of the NSE techniques is applied +ifeq ($(USE_NSE_TABLE),TRUE) + USE_ALL_NSE := TRUE +endif + +ifeq ($(USE_NSE_NET),TRUE) + USE_ALL_NSE := TRUE +endif + # NSE networks need the table ifeq ($(USE_NSE_TABLE),TRUE) NSE_TABULAR_HOME ?= $(MICROPHYSICS_HOME)/nse_tabular diff --git a/integration/Make.package b/integration/Make.package index 534310c29d..81f5c94887 100644 --- a/integration/Make.package +++ b/integration/Make.package @@ -26,11 +26,12 @@ else CEXE_headers += integrator_setup_strang.H endif -ifeq ($(USE_NSE_TABLE), TRUE) + +ifeq ($(USE_ALL_NSE), TRUE) ifeq ($(USE_ALL_SDC), TRUE) CEXE_headers += nse_update_sdc.H else - CEXE_headers += nse_update_strang.H + $(error NSE with Strang integration is not supported) endif endif diff --git a/integration/nse_update_strang.H b/integration/nse_update_strang.H deleted file mode 100644 index fb896ac3c0..0000000000 --- a/integration/nse_update_strang.H +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef NSE_UPDATE_STRANG_H -#define NSE_UPDATE_STRANG_H - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include - -#ifdef NSE_TABLE -#include -#include -#endif -#ifdef NSE_NET -#include -#endif - -using namespace amrex::literals; - -/// -/// update the state due to NSE changes for the Strang-split case -/// -template -AMREX_GPU_HOST_DEVICE AMREX_INLINE -void nse_burn(BurnT& state, const amrex::Real dt) { - -#if defined(NSE_TABLE) - - using namespace AuxZero; - - // use the NSE table - - // get the energy -- we are assuming that rho, T are valid on input - - eos(eos_input_rt, state); - - // if we are doing drive_initial_convection, we want to use - // the temperature that comes in through T_fixed - - amrex::Real T_in = state.T_fixed > 0.0_rt ? state.T_fixed : state.T; - - // call the NSE table using the * state to get the t^{n+1} - // source estimates. The thermodynamnics here is specified - // in terms of the auxiliary composition, Ye, abar, and B/A - - nse_table_t nse_state; - nse_state.T = T_in; - nse_state.rho = state.rho; - nse_state.Ye = state.aux[iye]; - - nse_interp(nse_state); - - // update Ye - - state.aux[iye] += dt * nse_state.dyedt; - - // now get the composition from the table using the updated Ye - - nse_state.Ye = state.aux[iye]; - nse_interp(nse_state); - - - // this is MeV / nucleon -- here aux has not yet been updated, so we - // access the old binding energy - amrex::Real deltaq = nse_state.bea - state.aux[ibea]; - - state.aux[ibea] += deltaq; - state.aux[iabar] = nse_state.abar; - -#elif defined(NSE_NET) - - // solve for the NSE state -- first compute Ye - state.y_e = 0.0_rt; - for (int n = 0; n < NumSpec; ++n) { - state.y_e += zion[n] * state.xn[n] * aion_inv[n]; - } - - auto nse_state = get_actual_nse_state(state); - - // for now, we'll take dyedt = 0. Later we can evaluate this by - // calling the RHS with the NSE state. - amrex::Real dyedt = 0.0_rt; - - // compute the change in binding energy -- this is the energy release - // we want to do sum {B dY}, where Y is the molar fraction. - // this will be in MeV / nucleon - amrex::Real deltaq = 0.0_rt; - for (int n = 0; n < NumSpec; ++n) { - deltaq += network::bion(n+1) * aion_inv[n] * (nse_state.xn[n] - state.xn[n]); - } - -#endif - - state.success = true; - state.n_rhs = 0; - state.n_jac = 0; - - // convert the energy to erg / g - amrex::Real enuc = deltaq * C::MeV2eV * C::ev2erg * C::n_A; - - state.e = enuc + state.e; - - - // store the new composition - -#if defined(NSE_TABLE) - for (int n = 0; n < NumSpec; ++n) { - state.xn[n] = nse_state.X[n]; - } -#elif defined(NSE_NET) - for (int n = 0; n < NumSpec; ++n) { - state.xn[n] = nse_state.xn[n]; - } -#endif - - -} - -#endif diff --git a/unit_test/test_nse_interp/GNUmakefile b/unit_test/test_nse_interp/GNUmakefile index 1b443926cb..4b8f6c617a 100644 --- a/unit_test/test_nse_interp/GNUmakefile +++ b/unit_test/test_nse_interp/GNUmakefile @@ -11,6 +11,7 @@ USE_MPI = FALSE USE_OMP = FALSE USE_REACT = TRUE +USE_SIMPLIFIED_SDC = TRUE EBASE = main