Skip to content

Commit

Permalink
Merge branch 'development' of ssh://github.com/AMReX-Astro/Castro int…
Browse files Browse the repository at this point in the history
…o development
  • Loading branch information
zingale committed Jan 6, 2024
2 parents bee114b + 8e7784c commit f33c89a
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions Exec/science/massive_star/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifdef NSE_TABLE
#include <nse_table_type.H>
#include <nse_table_check.H>
#include <nse_eos.H>
#endif

AMREX_GPU_HOST_DEVICE AMREX_INLINE
Expand Down Expand Up @@ -128,8 +129,33 @@ void problem_initialize_state_data (int i, int j, int k,
}

if (problem::interpolate_pres == 1) {
eos(eos_input_rp, eos_state);
state(i,j,k,UTEMP) = eos_state.T;

// we need to get T from P, rho, but consistent with NSE (if
// we are in NSE)
if (nse_check) {
// this will also change the composition, since the new T
// alters the NSE
nse_T_abar_from_p(eos_state.rho, eos_state.p, eos_state.aux[AuxZero::iye],
eos_state.T, eos_state.aux[AuxZero::iabar]);
state(i,j,k,UTEMP) = eos_state.T;
state(i,j,k,UFX+AuxZero::iabar) = eos_state.aux[AuxZero::iabar];

// now call the EOS with the new T and abar to get e
eos(eos_input_rt, eos_state);

// finally, get the updated B/A
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);

state(i,j,k,UFX+AuxZero::ibea) = nse_state.bea;

} else {
eos(eos_input_rp, eos_state);
state(i,j,k,UTEMP) = eos_state.T;
}
} else {
eos(eos_input_rt, eos_state);
}
Expand Down

0 comments on commit f33c89a

Please sign in to comment.