From 9cf0cb6b3e31a382e73dac7d94875c2e099b1e0b Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 8 Dec 2023 13:16:51 -0500 Subject: [PATCH] sync to the new tabular NSE interfacet (#2673) this syncs up with the Microphysics changes in AMReX-Astro/Microphysics#1404 --- .../nse_test/problem_initialize_state_data.H | 26 ++++++++++--------- .../problem_initialize_state_data.H | 22 +++++++--------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/Exec/reacting_tests/nse_test/problem_initialize_state_data.H b/Exec/reacting_tests/nse_test/problem_initialize_state_data.H index 43b6666355..884a606411 100644 --- a/Exec/reacting_tests/nse_test/problem_initialize_state_data.H +++ b/Exec/reacting_tests/nse_test/problem_initialize_state_data.H @@ -5,6 +5,7 @@ #include #include #if defined(NSE_TABLE) +#include #include #elif defined(NSE_NET) #include @@ -64,14 +65,15 @@ void problem_initialize_state_data (int i, int j, int k, burn_state.y_e = ye; #if defined(NSE_TABLE) - Real abar; - Real dq; - Real dyedt; - Real dabardt; - Real dbeadt; - Real e_nu; - - nse_interp(T, problem::rho0, ye, abar, dq, dyedt, dabardt, dbeadt, e_nu, burn_state.xn); + nse_table_t nse_state; + nse_state.T = T; + nse_state.rho = problem::rho0; + nse_state.Ye = ye; + nse_interp(nse_state); + + for (int n = 0; n < NumSpec; ++n) { + burn_state.xn[n] = nse_state.X[n]; + } #elif defined(NSE_NET) Real eps = 1.e-10_rt; bool input_ye_is_valid = true; @@ -105,16 +107,16 @@ void problem_initialize_state_data (int i, int j, int k, for (int n = 0; n < NumSpec; n++) { burn_state.xn[n] /= sumX; } - + #ifdef NSE_NET state(i,j,k,UMUP) = burn_state.mu_p; state(i,j,k,UMUN) = burn_state.mu_n; #endif - + #ifdef AUX_THERMO burn_state.aux[AuxZero::iye] = ye; - burn_state.aux[AuxZero::iabar] = abar; - burn_state.aux[AuxZero::ibea] = dq; + burn_state.aux[AuxZero::iabar] = nse_state.abar; + burn_state.aux[AuxZero::ibea] = nse_state.bea; #endif eos(eos_input_rt, burn_state); diff --git a/Exec/science/massive_star/problem_initialize_state_data.H b/Exec/science/massive_star/problem_initialize_state_data.H index 5850ba23b4..c34101fd76 100644 --- a/Exec/science/massive_star/problem_initialize_state_data.H +++ b/Exec/science/massive_star/problem_initialize_state_data.H @@ -5,6 +5,7 @@ #include #include #ifdef NSE_TABLE +#include #include #endif @@ -80,21 +81,16 @@ void problem_initialize_state_data (int i, int j, int k, if (nse_check) { - Real abar; - Real dq; - Real dyedt; - Real dabardt; - Real dbeadt; - Real e_nu; - Real xn[NumSpec]; + nse_table_t nse_state; + nse_state.T = state(i,j,k,UTEMP); + nse_state.rho = state(i,j,k,URHO); + nse_state.Ye = state(i,j,k,UFX+AuxZero::iye); + nse_interp(nse_state); - nse_interp(state(i,j,k,UTEMP), state(i,j,k,URHO), - state(i,j,k,UFX+AuxZero::iye), abar, dq, dyedt, dabardt, dbeadt, e_nu, xn); - - state(i,j,k,UFX+AuxZero::iabar) = abar; - state(i,j,k,UFX+AuxZero::ibea) = dq; + state(i,j,k,UFX+AuxZero::iabar) = nse_state.abar; + state(i,j,k,UFX+AuxZero::ibea) = nse_state.bea; for (int n = 0; n < NumSpec; n++) { - state(i,j,k,UFS+n) = amrex::max(xn[n], small_x); + state(i,j,k,UFS+n) = amrex::max(nse_state.X[n], small_x); } // we just got new X's, so we need to re-renormalize them