Skip to content

Commit b41ff25

Browse files
authored
add a init_species_all_equal option to burn_cell (#1665)
if this is True, then we don't need to specify the mass fractions individually, instead they are all initialized to X = 1/NumSpec
1 parent fc1cfa4 commit b41ff25

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

unit_test/burn_cell/GNUmakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ EOS_DIR := helmholtz
2424

2525
# This sets the network directory
2626
NETWORK_DIR := aprox13
27-
27+
SCREEN_METHOD := screen5
2828
CONDUCTIVITY_DIR := stellar
2929

3030
INTEGRATOR_DIR = VODE

unit_test/burn_cell/_parameters

+2
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ density real 1.e7
1919
temperature real 3.e9
2020

2121
skip_initial_normalization bool 0
22+
23+
init_species_all_equal bool 0

unit_test/burn_cell/burn_cell.H

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ void burn_cell_c()
2121
// Make sure user set all the mass fractions to values in the interval [0, 1]
2222
for (int n = 1; n <= NumSpec; ++n) {
2323

24-
massfractions[n-1] = get_xn(n);
24+
if (unit_test_rp::init_species_all_equal) {
25+
massfractions[n-1] = 1.0_rt / static_cast<amrex::Real>(NumSpec);
26+
} else {
27+
massfractions[n-1] = get_xn(n);
2528

26-
if (massfractions[n-1] < 0 || massfractions[n-1] > 1) {
27-
amrex::Error("mass fraction for " + short_spec_names_cxx[n-1] + " not initialized in the interval [0,1]!");
29+
if (massfractions[n-1] < 0 || massfractions[n-1] > 1) {
30+
amrex::Error("mass fraction for " + short_spec_names_cxx[n-1] + " not initialized in the interval [0,1]!");
31+
}
2832
}
29-
3033
}
3134

3235
// Echo initial conditions at burn and fill burn state input

0 commit comments

Comments
 (0)