Skip to content

Commit

Permalink
add a init_species_all_equal option to burn_cell
Browse files Browse the repository at this point in the history
if this is True, then we don't need to specify the mass fractions
individually, instead they are all initialized to X = 1/NumSpec
  • Loading branch information
zingale committed Nov 14, 2024
1 parent 1753bb9 commit a0a3983
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion unit_test/burn_cell/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EOS_DIR := helmholtz

# This sets the network directory
NETWORK_DIR := aprox13

SCREEN_METHOD := screen5
CONDUCTIVITY_DIR := stellar

INTEGRATOR_DIR = VODE
Expand Down
2 changes: 2 additions & 0 deletions unit_test/burn_cell/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ density real 1.e7
temperature real 3.e9

skip_initial_normalization bool 0

init_species_all_equal bool 0
11 changes: 7 additions & 4 deletions unit_test/burn_cell/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ void burn_cell_c()
// Make sure user set all the mass fractions to values in the interval [0, 1]
for (int n = 1; n <= NumSpec; ++n) {

massfractions[n-1] = get_xn(n);
if (unit_test_rp::init_species_all_equal) {
massfractions[n-1] = 1.0_rt / static_cast<Real>(NumSpec);
} else {
massfractions[n-1] = get_xn(n);

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

}

// Echo initial conditions at burn and fill burn state input
Expand Down

0 comments on commit a0a3983

Please sign in to comment.