Skip to content

Commit

Permalink
Merge branch 'development' into network_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jan 20, 2025
2 parents f69b258 + e3b281a commit 5694bfe
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 40 deletions.
2 changes: 2 additions & 0 deletions screening/_parameters
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@namespace: screening

enable_chabrier1998_quantum_corr bool 0
enable_debye_huckel_skip bool 0
debye_huckel_skip_threshold real 1.01e0
41 changes: 39 additions & 2 deletions screening/screen.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define SCREEN_METHOD_chugunov2007 2
#define SCREEN_METHOD_chugunov2009 3
#define SCREEN_METHOD_chabrier1998 4
#define SCREEN_METHOD_debye_huckel 5

#include <cmath>
#include <iostream>
Expand Down Expand Up @@ -152,6 +153,33 @@ fill_plasma_state(plasma_state_t<number_t>& state, const number_t& temp,
state.gamma_e_fac = gamma_e_constants * std::cbrt(state.n_e);
}

template <typename number_t>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
number_t debye_huckel (const plasma_state_t<number_t>& state,
const scrn::screen_factors_t& scn_fac)
{
// Calculates the Debye-Huckel enhancement factor for weak Coloumb coupling,
// as listed in the Appendix of Chugunov and DeWitt 2009, PhRvC, 80, 014611

// input:
// state = plasma state (T, rho, abar, zbar, etc.)
// scn_fac = screening factors for A and Z

amrex::Real z1z2 = scn_fac.z1 * scn_fac.z2;
amrex::Real z_ratio = state.z2bar / state.zbar;

// Gamma_e from eq. 6
number_t Gamma_e = state.gamma_e_fac / state.temp;

// eq. A1
number_t h_DH = z1z2 * admath::sqrt(3 * amrex::Math::powi<3>(Gamma_e) * z_ratio);

// machine limit the output
constexpr amrex::Real h_max = 300.e0_rt;
number_t h = admath::min(h_DH, h_max);
return admath::exp(h);
}

#if SCREEN_METHOD == SCREEN_METHOD_screen5
template <typename number_t>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
Expand Down Expand Up @@ -620,11 +648,20 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
number_t actual_screen(const plasma_state_t<number_t>& state,
const scrn::screen_factors_t& scn_fac)
{
number_t scor;
number_t scor = 1.0_rt;
#if SCREEN_METHOD == SCREEN_METHOD_null
// null screening
amrex::ignore_unused(state, scn_fac);
scor = 1.0_rt;
return scor;
#endif
if (screening_rp::enable_debye_huckel_skip) {
scor = debye_huckel(state, scn_fac);
if (scor <= screening_rp::debye_huckel_skip_threshold) {
return scor;
}
}
#if SCREEN_METHOD == SCREEN_METHOD_debye_huckel
scor = debye_huckel(state, scn_fac);
#elif SCREEN_METHOD == SCREEN_METHOD_screen5
scor = actual_screen5(state, scn_fac);
#elif SCREEN_METHOD == SCREEN_METHOD_chugunov2007
Expand Down
37 changes: 0 additions & 37 deletions unit_test/test_react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,3 @@
This is a unit test that sets up a cube of data (rho, T, and X varying
along dimensions) and calls the burner on it. You can specify the integrator
via `INTEGRATOR_DIR` and the network via `NETWORK_DIR` in the `GNUmakefile`

## CPU Status

This table summarizes tests run with gfortran.


| network | VODE | VODE90 | BS | Rosenbrock |
|------------------------|-------------------------|-------------------------|-------------------------|---------------|
| aprox13 | works<br>(6:1517:2393) | works<br>(6:1517:23793) | works<br>(126:858:4678) | crashes |
| aprox19 | works<br>(27:152:8127) | works<br>(27:152:8127) | works<br>(72:297:2869) | runs too long |
| triple_alpha_plus_cago | works<br>(6:32:1950) | works<br>(6:32:1950) | works<br>(126:148:3044) | crashes |
| ignition_chamulak | works<br>(6:6:28) | works<br>(6:6:28) | works<br>(144:144:153) | works (252:252:252) |


## Running on GPUs with VODE

To run a GPU test with the VODE integrator and aprox13, do:

```
make -j COMP=PGI USE_CUDA=TRUE AMREX_USE_CUDA=TRUE USE_GPU_PRAGMA=TRUE NETWORK_DIR=aprox13 EOS_DIR=helmholtz
```

Tested with PGI 18.10 and CUDA 9.2.148.

To run in a different directory, the following files are necessary to
run in addition to the executable:

- `helm_table.dat` (will be symlinked in at compile time)
- `inputs_aprox13`
- `probin.aprox13`
- `xin.aprox13`

Then in an interactive session, (e.g. on Summit), do:

```
jsrun -n 1 -a 1 -g 1 ./[executable] inputs_aprox13
```
1 change: 0 additions & 1 deletion unit_test/test_react/TODO

This file was deleted.

0 comments on commit 5694bfe

Please sign in to comment.