From c9604bf8d02195e42a41cbc9a97d9fb8640fb892 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 7 Oct 2023 09:30:55 -0400 Subject: [PATCH] use copy_cons_to_burn_type for simplified-SDC (#2603) --- Source/reactions/Castro_react.cpp | 22 +++----------------- Source/reactions/Make.package | 1 + Source/{sdc => reactions}/sdc_cons_to_burn.H | 0 Source/sdc/Make.package | 1 - 4 files changed, 4 insertions(+), 20 deletions(-) rename Source/{sdc => reactions}/sdc_cons_to_burn.H (100%) diff --git a/Source/reactions/Castro_react.cpp b/Source/reactions/Castro_react.cpp index 9c87344d07..6a77622a66 100644 --- a/Source/reactions/Castro_react.cpp +++ b/Source/reactions/Castro_react.cpp @@ -5,6 +5,7 @@ #ifdef MODEL_PARSER #include #endif +#include using std::string; using namespace amrex; @@ -583,24 +584,9 @@ Castro::react_state(Real time, Real dt) } // Feed in the old-time state data. + // this also sets burn_state.{rho,T} - burn_state.y[SRHO] = U_old(i,j,k,URHO); - burn_state.y[SMX] = U_old(i,j,k,UMX); - burn_state.y[SMY] = U_old(i,j,k,UMY); - burn_state.y[SMZ] = U_old(i,j,k,UMZ); - burn_state.y[SEDEN] = U_old(i,j,k,UEDEN); - burn_state.y[SEINT] = U_old(i,j,k,UEINT); - for (int n = 0; n < NumSpec; n++) { - burn_state.y[SFS+n] = U_old(i,j,k,UFS+n); - } -#if NAUX_NET > 0 - for (int n = 0; n < NumAux; n++) { - burn_state.y[SFX+n] = U_old(i,j,k,UFX+n); - } -#endif - - // we need an initial T guess for the EOS - burn_state.T = U_old(i,j,k,UTEMP); + copy_cons_to_burn_type(i, j, k, U_old, burn_state); burn_state.T_fixed = -1.e30_rt; @@ -629,8 +615,6 @@ Castro::react_state(Real time, Real dt) } #endif - burn_state.rho = burn_state.y[SRHO]; - // Don't burn if we're outside of the relevant (rho, T) range. if (U_old(i,j,k,UTEMP) < castro::react_T_min || U_old(i,j,k,UTEMP) > castro::react_T_max || diff --git a/Source/reactions/Make.package b/Source/reactions/Make.package index 54f9bc979b..529cdf348b 100644 --- a/Source/reactions/Make.package +++ b/Source/reactions/Make.package @@ -2,6 +2,7 @@ # this is included when USE_REACT = TRUE CEXE_headers += Castro_react.H +CEXE_headers += sdc_const_to_burn.H CEXE_sources += Castro_react.cpp CEXE_headers += Castro_react_util.H diff --git a/Source/sdc/sdc_cons_to_burn.H b/Source/reactions/sdc_cons_to_burn.H similarity index 100% rename from Source/sdc/sdc_cons_to_burn.H rename to Source/reactions/sdc_cons_to_burn.H diff --git a/Source/sdc/Make.package b/Source/sdc/Make.package index b942621345..c135c88138 100644 --- a/Source/sdc/Make.package +++ b/Source/sdc/Make.package @@ -1,5 +1,4 @@ CEXE_headers += Castro_sdc.H -CEXE_headers += sdc_const_to_burn.H CEXE_sources += sdc_util.cpp