From a0a3983e3d9e1bd3c24f0c04fa61c30983af1d70 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 14 Nov 2024 09:41:46 -0500 Subject: [PATCH 1/2] add a init_species_all_equal option to burn_cell 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..ad7771e7bc 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 From 6a98856b119601be11da3c982bf9917bad641ffa Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 14 Nov 2024 10:08:52 -0500 Subject: [PATCH 2/2] add namespace --- unit_test/burn_cell/burn_cell.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_test/burn_cell/burn_cell.H b/unit_test/burn_cell/burn_cell.H index ad7771e7bc..43496f1a67 100644 --- a/unit_test/burn_cell/burn_cell.H +++ b/unit_test/burn_cell/burn_cell.H @@ -22,7 +22,7 @@ void burn_cell_c() for (int n = 1; n <= NumSpec; ++n) { if (unit_test_rp::init_species_all_equal) { - massfractions[n-1] = 1.0_rt / static_cast(NumSpec); + massfractions[n-1] = 1.0_rt / static_cast(NumSpec); } else { massfractions[n-1] = get_xn(n);