Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ jobs:
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0

- name: Compile, test_nse_interp (NSE, aprox19)
- name: Compile, nse_interp_check (NSE, aprox19)
run: |
cd unit_test/test_nse_interp
cd unit_test/nse_interp_check
make realclean
make -j 4

- name: Run test_nse_interp (NSE, aprox19)
- name: Run nse_interp_check (NSE, aprox19)
run: |
cd unit_test/test_nse_interp
cd unit_test/nse_interp_check
./main3d.gnu.ex amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out

- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_nse_interp/Backtrace.0') != '' }}
run: cat unit_test/test_nse_interp/Backtrace.0
if: ${{ failure() && hashFiles('unit_test/nse_interp_check/Backtrace.0') != '' }}
run: cat unit_test/nse_interp_check/Backtrace.0

- name: Compare to stored output (NSE, aprox19)
run: |
cd unit_test/test_nse_interp
cd unit_test/nse_interp_check
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox19.out
6 changes: 3 additions & 3 deletions Docs/source/unit_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ One-zone tests
Infrastructure tests
====================

.. index:: test_linear_algebra, test_nse_interp, test_parameters, test_sdc_vode_rhs
.. index:: test_linear_algebra, nse_interp_check, test_parameters, test_sdc_vode_rhs

* ``test_linear_algebra`` :

create a diagonally dominant matrix, multiply it by a test vector, $x$,
to get $b = Ax$, and then call the linear algebra routines to see if we
we recover $x$ from $b$.

* ``test_nse_interp`` :
* ``nse_interp_check`` :

run various tests of the NSE interpolation routines.
run various tests of the tabular NSE interpolation routines.

* ``test_parameters`` :

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# test_nse_interp
# `nse_interp_check`

This is a simple test of the NSE cubic interpolation.

Expand All @@ -9,7 +9,10 @@ Then it does 1-d interpolation in each direction (rho, T, Ye)
to make sure that the interpolation there works as expected.
This is done just for Abar.

Finally, it calls the full interface that does tricubic interpolation
Next, it calls the full interface that does tricubic interpolation
and prints out the interpolated state.

Finally, it chooses a zone where cubic interpolation can violate
monotonicity and interpolates neutrino energy.

This is for the tabular NSE: `USE_NSE_TABLE=TRUE`
128 changes: 128 additions & 0 deletions unit_test/nse_interp_check/ci-benchmarks/aprox19.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
Initializing AMReX (26.09-119-ge60cdc18711c)...
AMReX (26.09-119-ge60cdc18711c) initialized
starting the single zone burn...
reading the NSE table (C++) ...

rho, T, Ye = 1230000000 5180000000 0.472

density value brackets: 9.05 < 9.089905111 < 9.1
temperature value brackets: 9.71 < 9.71432976 < 9.72
Ye value brackets: 0.4725 < 0.472 < 0.47

testing 1-d cubic interpolation at input state

4 rho values:
9.000 55.5223665
9.050 55.57080116
9.100 55.61707675
9.150 55.66151541

cubic interpolated value: 55.6078922

4 T values:
9.700 55.5223665
9.710 55.39489494
9.720 55.22387568
9.730 54.99343581

cubic interpolated value: 55.32712406

4 Ye values:
0.475 55.5223665
0.472 55.65227675
0.470 55.78142906
0.468 55.90244371

cubic interpolated value: 55.678404


tricubic interpolated values at input state

abar = 55.60652462
bea = 8.755119523
dyedt = -0.004527880871
dbeadt = 0.000111945508
e_nu = 1.101641642e+16

X(H1) = 0
X(He3) = 2.723457525e-14
X(He4) = 0.0003164137294
X(C12) = 7.975878903e-10
X(N14) = 3.102372259e-14
X(O16) = 1.998161464e-09
X(Ne20) = 2.444604777e-11
X(Mg24) = 1.029036116e-08
X(Si28) = 8.173012779e-06
X(S32) = 1.194076593e-05
X(Ar36) = 1.243414613e-05
X(Ca40) = 1.259531492e-05
X(Ti44) = 0.0001438001413
X(Cr48) = 0.01146726617
X(Fe52) = 0.07746625779
X(Fe54) = 0.9098424639
X(Ni56) = 0.0007087774945
X(n) = 2.078852742e-08
X(p) = 9.843630258e-06


testing temperature derivatives of cubic

first finite-difference derivatives
dAbar/dT = -1.072562355e-09
dbea/dT = -6.867059575e-12

now using derivative of the interpolant
dAbar/dT = -1.072562604e-09
dbea/dT = -6.867048589e-12

testing density derivatives of cubic

first finite-difference derivatives
dAbar/drho = 3.987525411e-10
dbea/drho = 7.619559936e-13

now using derivative of the interpolant
dAbar/drho = 3.987522836e-10
dbea/drho = 7.618831514e-13


EOS T from e consistency check (e should remain unchanged)

old method: invert EOS without considering NSE changes:
change in e: 1.395278886e+18 1.38844906e+18

NSE method: use the nse_T_abar_from_e() function:
updated T: 6394534499
change in abar: 55.60652462 50.26831386
change in e: 1.38844906e+18 1.38844906e+18

EOS T from p consistency check (p should remain unchanged)

old method: invert EOS without considering NSE changes:
change in p: 6.622159603e+26 6.577850616e+26

NSE method: use the nse_T_abar_from_p() function:
updated T: 6466757500
change in abar: 55.60652462 49.50320619
change in p: 6.577850616e+26 6.577850616e+26

EOS rho from p consistency check (p should remain unchanged)

old method: invert EOS without considering NSE changes:
change in p: 6.577758474e+26 6.577850616e+26

NSE method: use the nse_rho_abar_from_p() function:
updated T: 5180000000
change in abar: 55.60652462 55.62494615
change in p: 6.577850616e+26 6.577850616e+26


explore a troublesome state

rho = 9.434630294888599e+09, T = 3.667943011533362e+09, Ye = 0.433159096449449
indices of lowest corner of 4x4x4 cube: ir0 = 58, it0 = 16, ic0 = 26

cubic interpolation gives: e_nu = -4.353326582e+12
bounds of e_nu in the 64 cells used for tricubic: 1.3703405e+11 6.2562515e+14

AMReX (26.09-119-ge60cdc18711c) finalized
File renamed without changes.
Loading
Loading