Skip to content

Commit

Permalink
update to reflect NSE table interface
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Dec 28, 2023
1 parent 023da90 commit 046a42a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
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 := 32768
MAX_ZONES := 65536

DEFINES += -DNPTS_MODEL=$(MAX_ZONES)

Expand Down
12 changes: 7 additions & 5 deletions massive_star/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# massive star initial model

This is the initial model routine for the massive star problem.

The file: 15m_500_sec.txt is a 15 solar mass MESA initial model, with
The file: `15m_500_sec.txt` is a 15 solar mass MESA initial model, with
an aprox21 composition.

It can be converted into the subset of nuclei for aprox19 via
convert_21_to_19.py
`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:
Also note that when running with > 16384 zones, you need to do:

```
ulimit -s 16384
ulimit -s 32768
```

Since the arrays are put on the stack.
since the arrays are put on the stack.
16 changes: 11 additions & 5 deletions massive_star/init_1d.H
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,18 @@ set_aux(eos_t& eos_state) {
Real dbeadt_pass;
Real e_nu_pass;

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

eos_state.aux[AuxZero::iabar] = abar_pass;
nse_interp(nse_state);

for (int n = 0; n < NumSpec; ++n) {
eos_state.xn[n] = nse_state.X[n];
}

eos_state.aux[AuxZero::iabar] = nse_state.abar;

} else {
set_aux_comp_from_X(eos_state);
Expand Down

0 comments on commit 046a42a

Please sign in to comment.