Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update the massive star to work with the new NSE table #60

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/massive_star.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Run with regular grid
run: |
cd massive_star
./initialmodel1d.gnu.ex inputs
./initialmodel1d.gnu.ex inputs problem.nx=16384

- name: Compare to stored output
run: |
Expand Down
2 changes: 1 addition & 1 deletion massive_star/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ USE_CXX_REACTIONS = TRUE

USE_FORT_MICROPHYSICS = FALSE

MAX_ZONES := 16384
MAX_ZONES := 32768

DEFINES += -DNPTS_MODEL=$(MAX_ZONES)

Expand Down
11 changes: 11 additions & 0 deletions massive_star/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ convert_21_to_19.py

This setup uses Ye as the primary composition variable from the initial
model in regions that are in NSE.

Note: you should ensure that the NSE conditions in the inputs file match
those of your simulation, so the model will be properly in HSE.

Also note that when running with 32768 zones, you need to do:

```
ulimit -s 16384
```

Since the arrays are put on the stack.
28,386 changes: 16,385 additions & 12,001 deletions massive_star/ci-benchmarks/15m_500_sec.aprox19.hse.20.00km

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions massive_star/init_1d.H
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ set_aux(eos_t& eos_state) {
// we are in NSE, so leave ye alone, but get abar and redo xn

Real abar_pass;
Real dq_pass;
Real bea_pass;
Real dyedt_pass;
Real dabardt_pass;
Real dbeadt_pass;
Real e_nu_pass;

nse_interp(eos_state.T, eos_state.rho, eos_state.aux[AuxZero::iye],
abar_pass, dq_pass, dyedt_pass, eos_state.xn);
abar_pass, bea_pass,
dyedt_pass, dabardt_pass, dbeadt_pass, e_nu_pass,
eos_state.xn);

eos_state.aux[AuxZero::iabar] = abar_pass;

Expand Down
8 changes: 5 additions & 3 deletions massive_star/inputs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
problem.model_file = 15m_500_sec.aprox19.dat

problem.xmin = 0.0
problem.xmax = 2.4e10
problem.xmax = 32768000000.0

problem.nx = 12000
problem.nx = 32768

network.rho_nse = 2.e6
network.rho_nse = 1.e7
network.T_nse = 3.e9

network.nse_table_interp_linear = 0
9 changes: 0 additions & 9 deletions massive_star/inputs.hires

This file was deleted.

8 changes: 4 additions & 4 deletions urca/spherical/init_1d.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ AMREX_INLINE void fopt_urca_23(eos_t& eos_state, Real& fopt, Real& r_ecap, Real&
constexpr int do_T_derivatives{0};
evaluate_rates<do_T_derivatives, rate_t>(burn_state, rates);

r_ecap = rates.screened_rates(k_na23_to_ne23);
r_beta = rates.screened_rates(k_ne23_to_na23);
r_ecap = rates.screened_rates(k_Na23_to_Ne23);
r_beta = rates.screened_rates(k_Ne23_to_Na23);

// calculate e-capture and beta decay rates are in equilibrium
Real xr_ecap = burn_state.xn[ina23] * r_ecap;
Expand Down Expand Up @@ -103,8 +103,8 @@ AMREX_INLINE void composition_equilibrium(eos_t& eos_state){
constexpr int do_T_derivatives{0};
evaluate_rates<do_T_derivatives, rate_t>(burn_state, rates);

Real r_ecap = rates.screened_rates(k_na23_to_ne23);
Real r_beta = rates.screened_rates(k_ne23_to_na23);
Real r_ecap = rates.screened_rates(k_Na23_to_Ne23);
Real r_beta = rates.screened_rates(k_Ne23_to_Na23);

eos_state.xn[ine23] = problem_rp::na_ne_23/(1.0_rt + r_beta/r_ecap);
eos_state.xn[ina23] = problem_rp::na_ne_23 - eos_state.xn[ine23];
Expand Down