Skip to content

Commit

Permalink
some generalization of the NSE table stuff (#1580)
Browse files Browse the repository at this point in the history
this fixes table initialization and linking with nets other than
aprox19.  The instructions are also updated.
  • Loading branch information
zingale authored Jun 7, 2024
1 parent 094a26d commit e56bbf1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
4 changes: 1 addition & 3 deletions Make.Microphysics_extern
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ table:
ifeq ($(USE_NSE_TABLE),TRUE)
NSE_TABULAR_HOME ?= $(MICROPHYSICS_HOME)/nse_tabular
EXTERN_CORE += $(NSE_TABULAR_HOME)
ifeq ($(findstring aprox19, $(NETWORK_DIR)), aprox19)
all: nsetable
endif
all: nsetable
endif

nsetable:
Expand Down
8 changes: 7 additions & 1 deletion interfaces/network_initialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include <nse_solver.H>
#endif
#endif
#ifdef NSE_TABLE
#include <nse_table.H>
#endif

void network_init()
{
Expand All @@ -28,6 +31,9 @@ nonaka_init();
actual_rhs_init();
#endif

#ifdef NSE_TABLE
// read in the NSE table (if there is one)
init_nse();
#endif
#endif

}
6 changes: 0 additions & 6 deletions networks/aprox19/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@ using namespace amrex;
#include <extern_parameters.H>
#include <tfactors.H>
#include <aprox_rates.H>
#ifdef NSE_TABLE
#include <nse_table.H>
#endif

using namespace network_rp;

AMREX_INLINE
void actual_network_init() {
#ifdef NSE_TABLE
init_nse();
#endif
}

#ifndef NSE
Expand Down
16 changes: 13 additions & 3 deletions nse_tabular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ The table provides:
* X(A), X(B), ... : the reduced composition mass fractions. They are
assumed to be in the same order as the nuclei in the on-grid network.

The data is ordered such that rho varies the slowest (from low to
high), T varies the next slowest (from low to high), and Ye varies the
fastest (from high to low).


## Generating the table

Expand Down Expand Up @@ -90,9 +94,15 @@ following should be copied into the on-grid network's subdirectory
into it. Note the `table_name` string in the header should be
updated to reflect the new name of the table.

The data is ordered such that rho varies the slowest (from low to
high), T varies the next slowest (from low to high), and Ye varies the
fastest (from high to low).
You also need to add a line to the network's `Make.package` of the form:

```
NSE_TABLE_NAME := nse.tbl
```

making sure to use whatever filename you renamed the table to. This will
be used to ensure that the table is symlinked into the build directory.


## Outputting for a different network

Expand Down

0 comments on commit e56bbf1

Please sign in to comment.