From b41ff254a55f20448f92d6aad03b09c5518af056 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Mon, 25 Nov 2024 11:02:05 -0500 Subject: [PATCH] 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 --- unit_test/burn_cell/GNUmakefile | 2 +- unit_test/burn_cell/_parameters | 2 ++ unit_test/burn_cell/burn_cell.H | 11 +++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/unit_test/burn_cell/GNUmakefile b/unit_test/burn_cell/GNUmakefile index 8372650ebb..3940100208 100644 --- a/unit_test/burn_cell/GNUmakefile +++ b/unit_test/burn_cell/GNUmakefile @@ -24,7 +24,7 @@ EOS_DIR := helmholtz # This sets the network directory NETWORK_DIR := aprox13 - +SCREEN_METHOD := screen5 CONDUCTIVITY_DIR := stellar INTEGRATOR_DIR = VODE diff --git a/unit_test/burn_cell/_parameters b/unit_test/burn_cell/_parameters index 9047a84f8e..9dc27e92ef 100644 --- a/unit_test/burn_cell/_parameters +++ b/unit_test/burn_cell/_parameters @@ -19,3 +19,5 @@ density real 1.e7 temperature real 3.e9 skip_initial_normalization bool 0 + +init_species_all_equal bool 0 diff --git a/unit_test/burn_cell/burn_cell.H b/unit_test/burn_cell/burn_cell.H index 71f379471e..43496f1a67 100644 --- a/unit_test/burn_cell/burn_cell.H +++ b/unit_test/burn_cell/burn_cell.H @@ -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(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