Skip to content

Commit

Permalink
Merge branch 'development' into fix_inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz authored Aug 14, 2023
2 parents 88cfc8f + 783d1a0 commit 79707dd
Show file tree
Hide file tree
Showing 33 changed files with 1,195 additions and 1,025 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/castro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@ jobs:
- uses: actions/checkout@v3
- name: Get Latest Release Tag
run: |
CASTRO_TAG=$(wget https://github.com/AMReX-Astro/Castro/releases/latest 2>&1 | grep Location: | awk '{print $2}' | awk -F/ '{print $NF}')
echo "CASTRO_TAG=$CASTRO_TAG" >> $GITHUB_ENV
AMREX_TAG=$(wget https://github.com/AMReX-Codes/amrex/releases/latest 2>&1 | grep Location: | awk '{print $2}' | awk -F/ '{print $NF}')
echo "AMREX_TAG=$AMREX_TAG" >> $GITHUB_ENV
- name: Download Castro
uses: actions/checkout@v3
with:
repository: 'AMReX-Astro/Castro'
ref: ${{env.CASTRO_TAG}}
ref: development
path: 'Castro'
- name: Download AMReX
uses: actions/checkout@v3
with:
repository: 'AMReX-Codes/amrex'
ref: ${{env.MICROPHYSICS_TAG}}
ref: ${{env.AMREX_TAG}}
path: 'amrex'
- name: Dependencies
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ jobs:
cd unit_test/test_react
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
- name: compile test_react (subch_simple)
- name: compile test_react (ignition_reaclib/URCA-simple)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_react
make realclean
make NETWORK_DIR=subch_simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
- name: compile test_ase (ase)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_ase
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
5 changes: 4 additions & 1 deletion EOS/gamma_law/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void actual_eos (I input, T& state)

// Compute the pressure simply from the ideal gas law, and the
// specific internal energy using the gamma-law EOS relation.
Real pressure = state.rho * state.T * (C::k_B / (state.mu * m_nucleon));
Real pressure = state.rho * state.T * C::k_B / (state.mu * m_nucleon);
Real energy = pressure / (eos_gamma - 1.0) * rhoinv;
if constexpr (has_pressure<T>::value) {
state.p = pressure;
Expand Down Expand Up @@ -265,6 +265,9 @@ void actual_eos (I input, T& state)

// sound speed
state.cs = std::sqrt(eos_gamma * state.p * rhoinv);
if constexpr (has_G<T>::value) {
state.G = 0.5 * (1.0 + eos_gamma);
}
}
}

Expand Down
25 changes: 21 additions & 4 deletions EOS/primordial_chem/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,16 @@ void actual_eos (I input, T& state)

case eos_input_rp:
// dens, pressure, and xmass are inputs
#ifndef AMREX_USE_GPU
amrex::Error("eos_input_rp is not supported");
#endif

break;
if constexpr (has_pressure<T>::value) {
dens = state.rho;

// stop the integration if the pressure < 0
AMREX_ASSERT(state.p > 0.);
eint = state.p * sum_gammasinv / dens;
temp = eint / (sum_gammasinv * gasconstant * sum_Abarinv);
}
break;

case eos_input_ps:
// pressure, entropy, and xmass are inputs
Expand Down Expand Up @@ -269,11 +274,23 @@ void actual_eos (I input, T& state)
if constexpr (has_pressure<T>::value) {
Real pressure = state.rho * eint / sum_gammasinv;
state.p = pressure;

state.dpdT = pressure / temp;
state.dpdr = pressure / dens;
state.cs = std::sqrt((1.0 + 1.0/sum_gammasinv) * state.p /state.rho);
if constexpr (has_G<T>::value) {
state.G = 0.5 * (1.0 + (1.0 + 1.0/sum_gammasinv));
}
}

Real dedT = sum_gammasinv * sum_Abarinv * gasconstant;
Real dedr = 0.0_rt;
if constexpr (has_energy<T>::value) {
state.dedT = dedT;
state.dedr = dedr;
if constexpr (has_pressure<T>::value) {
state.dpde = state.dpdT / state.dedT;
}
}

}
Expand Down
2 changes: 2 additions & 0 deletions integration/BackwardEuler/be_integrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <be_type.H>
#include <network.H>
#include <actual_network.H>
#ifndef NEW_NETWORK_IMPLEMENTATION
#include <actual_rhs.H>
#endif
#include <burn_type.H>
#include <linpack.H>
#include <numerical_jacobian.H>
Expand Down
2 changes: 2 additions & 0 deletions integration/ForwardEuler/actual_integrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <network.H>
#include <actual_network.H>
#include <rhs.H>
#ifndef NEW_NETWORK_IMPLEMENTATION
#include <actual_rhs.H>
#endif
#include <burn_type.H>
#include <eos_type.H>
#include <eos.H>
Expand Down
2 changes: 2 additions & 0 deletions integration/QSS/actual_integrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <network.H>
#include <actual_network.H>
#include <rhs.H>
#ifndef NEW_NETWORK_IMPLEMENTATION
#include <actual_rhs.H>
#endif
#include <burn_type.H>
#include <eos_type.H>
#include <eos.H>
Expand Down
3 changes: 3 additions & 0 deletions integration/integrator_type_simplified_sdc.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
#include <eos.H>
#include <eos_composition.H>
#include <burn_type.H>
#include <actual_network.H>
#ifndef NEW_NETWORK_IMPLEMENTATION
#include <actual_rhs.H>
#endif
#include <integrator_type.H>

using namespace integrator_rp;
Expand Down
4 changes: 4 additions & 0 deletions integration/utils/initial_timestep.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#include <AMReX_REAL.H>
#include <actual_network.H>
#ifdef NEW_NETWORK_IMPLEMENTATION
#include <rhs.H>
#else
#include <actual_rhs.H>
#endif
#include <burn_type.H>

template <typename BurnT, typename IntT>
Expand Down
10 changes: 10 additions & 0 deletions interfaces/eos_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct eos_t:eos_base_t {
amrex::Real dsdr{};
amrex::Real dpde{};
amrex::Real dpdr_e{};
amrex::Real G{}; // fundamental derivative (Thompson 1971), we use equation 2.24 of Menikoff & Plohr 1989

amrex::Real cv{};
amrex::Real cp{};
Expand Down Expand Up @@ -145,6 +146,7 @@ struct chem_eos_t:eos_base_t {
amrex::Real dpdr_e{};
amrex::Real dedT{};
amrex::Real dedr{};
amrex::Real G{};

amrex::Real mu{};
amrex::Real cs{};
Expand Down Expand Up @@ -196,6 +198,14 @@ template <typename T>
struct has_dpdA<T, decltype((void)T::dpdA, void())>
: std::true_type {};

template <typename T, typename Enable = void>
struct has_G
: std::false_type {};

template <typename T>
struct has_G<T, decltype((void)T::G, void())>
: std::true_type {};

template <typename T, typename Enable = void>
struct has_dpdZ
: std::false_type {};
Expand Down
3 changes: 3 additions & 0 deletions interfaces/tfactors.H
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct tf_t {
// amrex::Real t916;
// amrex::Real t976;
// amrex::Real t9i76;
amrex::Real lnt9;
};

AMREX_GPU_HOST_DEVICE inline
Expand Down Expand Up @@ -148,6 +149,8 @@ tf_t get_tfactors(amrex::Real temp)
// tf.t9i38 = tf.t9i18*tf.t9i18*tf.t9i18;
// tf.t9i58 = tf.t9i38*tf.t9i18*tf.t9i18;

tf.lnt9 = std::log(tf.t9);

return tf;
}

Expand Down
1 change: 0 additions & 1 deletion networks/aprox13/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
CEXE_headers += actual_network.H
CEXE_headers += actual_rhs.H

USE_RATES = TRUE
USE_SCREENING = TRUE
Expand Down
1 change: 0 additions & 1 deletion networks/aprox13/actual_rhs.H

This file was deleted.

1 change: 0 additions & 1 deletion networks/aprox19/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
CEXE_headers += actual_network.H
CEXE_headers += actual_rhs.H

USE_RATES = TRUE
USE_SCREENING = TRUE
Expand Down
1 change: 0 additions & 1 deletion networks/aprox19/actual_rhs.H

This file was deleted.

1 change: 0 additions & 1 deletion networks/aprox21/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
CEXE_headers += actual_network.H
CEXE_headers += actual_rhs.H

USE_RATES = TRUE
USE_SCREENING = TRUE
Expand Down
1 change: 0 additions & 1 deletion networks/aprox21/actual_rhs.H

This file was deleted.

1 change: 0 additions & 1 deletion networks/ignition_simple/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
CEXE_headers += actual_network.H
CEXE_headers += actual_rhs.H

USE_RATES = TRUE
USE_SCREENING = TRUE
Expand Down
6 changes: 0 additions & 6 deletions networks/ignition_simple/actual_rhs.H

This file was deleted.

1 change: 0 additions & 1 deletion networks/iso7/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
CEXE_headers += actual_network.H
CEXE_headers += actual_rhs.H

USE_RATES = TRUE
USE_SCREENING = TRUE
Expand Down
1 change: 0 additions & 1 deletion networks/iso7/actual_rhs.H

This file was deleted.

7 changes: 2 additions & 5 deletions networks/rprox/Make.package
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
CEXE_sources += actual_network_data.cpp
CEXE_headers += actual_network.H

CEXE_headers += rprox_tfactors.H
CEXE_headers += rprox_rates.H
CEXE_headers += actual_rhs.H
CEXE_headers += rprox_rates.H

USE_SCREENING = TRUE
USE_SCREENING = TRUE
endif
Loading

0 comments on commit 79707dd

Please sign in to comment.