Skip to content

Commit

Permalink
add d<B/A>/dt
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Nov 4, 2023
1 parent 8a260dc commit e1ff5fc
Show file tree
Hide file tree
Showing 6 changed files with 47,003 additions and 46,974 deletions.
93,932 changes: 46,966 additions & 46,966 deletions networks/aprox19/nse_aprox19.tbl

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion nse_tabular/nse_table.H
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void init_nse() {
>> nse_table::beatab(j)
>> nse_table::dyedttab(j)
>> nse_table::dabardttab(j)
>> nse_table::dbeadttab(j)
>> nse_table::enutab(j);
for (int n = 1; n <= NumSpec; n++) {
data >> nse_table::massfractab(n, j);
Expand Down Expand Up @@ -234,7 +235,7 @@ Real tricubic(const int ir0, const int it0, const int ic0,

AMREX_GPU_HOST_DEVICE AMREX_INLINE
void nse_interp(const Real T, const Real rho, const Real ye,
Real& abar, Real& bea, Real& dyedt, Real& dabardt, Real& e_nu,
Real& abar, Real& bea, Real& dyedt, Real& dabardt, Real& dbeadt, Real& e_nu,
Real* X, bool skip_X_fill=false) {

// if skip_X_fill = true then we don't fill X[] with the mass fractions.
Expand All @@ -259,6 +260,7 @@ void nse_interp(const Real T, const Real rho, const Real ye,
bea = trilinear(ir1, it1, ic1, rholog, tlog, yet, beatab);
dyedt = trilinear(ir1, it1, ic1, rholog, tlog, yet, dyedttab);
dabardt = trilinear(ir1, it1, ic1, rholog, tlog, yet, dabardttab);
dbeadt = trilinear(ir1, it1, ic1, rholog, tlog, yet, dbeadttab);
e_nu = trilinear(ir1, it1, ic1, rholog, tlog, yet, enutab);

// massfractab is 2-d, so we wrap the access in a lambda already
Expand Down Expand Up @@ -292,6 +294,7 @@ void nse_interp(const Real T, const Real rho, const Real ye,
bea = tricubic(ir0, it0, ic0, rholog, tlog, yet, beatab);
dyedt = tricubic(ir0, it0, ic0, rholog, tlog, yet, dyedttab);
dabardt = tricubic(ir0, it0, ic0, rholog, tlog, yet, dabardttab);
dbeadt = tricubic(ir0, it0, ic0, rholog, tlog, yet, dbeadttab);
e_nu = tricubic(ir0, it0, ic0, rholog, tlog, yet, enutab);

// massfractab is 2-d, so we wrap the access in a lambda already
Expand Down
34 changes: 28 additions & 6 deletions nse_tabular/nse_table.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions nse_tabular/nse_table_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace nse_table
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> beatab;
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> dyedttab;
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> dabardttab;
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> dbeadttab;
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> enutab;

extern AMREX_GPU_MANAGED amrex::Array2D<amrex::Real, 1, NumSpec, 1, npts> massfractab;
Expand Down
1 change: 1 addition & 0 deletions nse_tabular/nse_table_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace nse_table
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> beatab;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> dyedttab;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> dabardttab;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> dbeadttab;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, npts> enutab;

AMREX_GPU_MANAGED amrex::Array2D<amrex::Real, 1, NumSpec, 1, npts> massfractab;
Expand Down
4 changes: 3 additions & 1 deletion unit_test/test_nse_interp/nse_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,18 @@ void nse_cell_c()
Real bea;
Real dyedt;
Real dabardt;
Real dbeadt;
Real e_nu;
Real X[NumSpec];

nse_interp(temperature, density, ye,
abar, bea, dyedt, dabardt, e_nu, X);
abar, bea, dyedt, dabardt, dbeadt, e_nu, X);

std::cout << "abar = " << abar << std::endl;
std::cout << "bea = " << bea << std::endl;
std::cout << "dyedt = " << dyedt << std::endl;
std::cout << "dabardt = " << dabardt << std::endl;
std::cout << "dbeadt = " << dbeadt << std::endl;
std::cout << "e_nu = " << e_nu << std::endl;
for (int n = 0; n < NumSpec; ++n) {
std::cout << "X(" << short_spec_names_cxx[n] << ") = " << X[n] << std::endl;
Expand Down

0 comments on commit e1ff5fc

Please sign in to comment.