diff --git a/doc/content/source/tallies/scores_triggers.md b/doc/content/source/tallies/scores_triggers.md index af9bf0ab4..24f8bf7b7 100644 --- a/doc/content/source/tallies/scores_triggers.md +++ b/doc/content/source/tallies/scores_triggers.md @@ -15,6 +15,10 @@ a tally. Options include: - `damage_energy`: damage energy production - `flux`: particle scalar flux - `H3_production`: tritium production reaction rate +- `total`: the total reaction rate +- `absorption`: the absorption reaction rate +- `scatter`: the scatter reaction rate +- `fission`: the fission reaction rate For more information on the specific meanings of these various scores, please consult the [OpenMC tally documentation](https://docs.openmc.org/en/stable/usersguide/tallies.html). The names of diff --git a/include/base/OpenMCProblemBase.h b/include/base/OpenMCProblemBase.h index 682a39a54..715159faf 100644 --- a/include/base/OpenMCProblemBase.h +++ b/include/base/OpenMCProblemBase.h @@ -69,9 +69,15 @@ class OpenMCProblemBase : public CardinalProblem, public PostprocessorInterface */ void catchOpenMCError(const int & err, const std::string descriptor) const; + /** + * Whether the score is a reaction rate score + * @return whether the tally from OpenMC has units of 1/src + */ + bool isReactionRateScore(const std::string & score) const; + /** * Whether the score is a heating-type score - * @return whether tally from OpenMC has units of eV/src + * @return whether the tally from OpenMC has units of eV/src */ bool isHeatingScore(const std::string & score) const; diff --git a/src/base/CardinalEnums.C b/src/base/CardinalEnums.C index 6dadb713f..0ce14a407 100644 --- a/src/base/CardinalEnums.C +++ b/src/base/CardinalEnums.C @@ -94,7 +94,9 @@ getInitialPropertiesEnum() MultiMooseEnum getTallyScoreEnum() { - return MultiMooseEnum("heating heating_local kappa_fission fission_q_prompt fission_q_recoverable damage_energy flux H3_production"); + return MultiMooseEnum( + "heating heating_local kappa_fission fission_q_prompt fission_q_recoverable damage_energy " + "flux H3_production total absorption scatter fission"); } MooseEnum @@ -102,6 +104,6 @@ getEnergyGroupsEnum() { return MooseEnum( "CASMO_2 CASMO_4 CASMO_8 CASMO_16 CASMO_25 CASMO_40 VITAMIN_J_42 SCALE_44 MPACT_51 MPACT_60 " - "MPACT_69 CASMO_70 " - "XMAS_172 VITAMIN_J_175 SCALE_252 TRIPOLI_315 SHEM_361 CCFE_709 UKAEA_1102 ECCO_1968"); + "MPACT_69 CASMO_70 XMAS_172 VITAMIN_J_175 SCALE_252 TRIPOLI_315 SHEM_361 CCFE_709 UKAEA_1102 " + "ECCO_1968"); } diff --git a/src/base/OpenMCCellAverageProblem.C b/src/base/OpenMCCellAverageProblem.C index a91ddf1f0..596896537 100644 --- a/src/base/OpenMCCellAverageProblem.C +++ b/src/base/OpenMCCellAverageProblem.C @@ -2221,10 +2221,12 @@ OpenMCCellAverageProblem::tallyMultiplier(unsigned int global_score) const else source *= *_source_strength; + // Reaction rate scores have units of reactions/src (OpenMC) or reactions/s (Cardinal). + if (isReactionRateScore(_all_tally_scores[global_score])) + return source; + if (_all_tally_scores[global_score] == "flux") return source / _scaling; - else if (_all_tally_scores[global_score] == "H3-production") - return source; else mooseError("Unhandled tally score enum!"); } diff --git a/src/base/OpenMCProblemBase.C b/src/base/OpenMCProblemBase.C index 6965019df..e17143f84 100644 --- a/src/base/OpenMCProblemBase.C +++ b/src/base/OpenMCProblemBase.C @@ -692,11 +692,23 @@ OpenMCProblemBase::numCells() const return n_openmc_cells; } +bool +OpenMCProblemBase::isReactionRateScore(const std::string & score) const +{ + const std::set viable_scores = { + "H3-production", "total", "absorption", "scatter", "fission"}; + return viable_scores.count(score); +} + bool OpenMCProblemBase::isHeatingScore(const std::string & score) const { - std::set viable_scores = {"heating", "heating-local", "kappa-fission", - "fission-q-prompt", "fission-q-recoverable", "damage-energy"}; + const std::set viable_scores = {"heating", + "heating-local", + "kappa-fission", + "fission-q-prompt", + "fission-q-recoverable", + "damage-energy"}; return viable_scores.count(score); } diff --git a/test/tests/neutronics/tallies/reaction_rates/geometry.xml b/test/tests/neutronics/tallies/reaction_rates/geometry.xml new file mode 100644 index 000000000..3f4dc24e7 --- /dev/null +++ b/test/tests/neutronics/tallies/reaction_rates/geometry.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/test/tests/neutronics/tallies/reaction_rates/gold/openmc_out.csv b/test/tests/neutronics/tallies/reaction_rates/gold/openmc_out.csv new file mode 100644 index 000000000..68bb263d0 --- /dev/null +++ b/test/tests/neutronics/tallies/reaction_rates/gold/openmc_out.csv @@ -0,0 +1,2 @@ +time,fluid_abs,fluid_fis,fluid_sca,fluid_tot,max_err_abs,max_err_fis,max_err_sca,max_err_tot,pebble1_abs,pebble1_fis,pebble1_sca,pebble1_tot,pebble2_abs,pebble2_fis,pebble2_sca,pebble2_tot,pebble3_abs,pebble3_fis,pebble3_sca,pebble3_tot,total_abs,total_fis,total_sca,total_tot +2,4149.6966831807,680.47521645749,296062.06592204,300211.76260522,0.056733496208636,0.056604251482993,0.055791612323537,0.055791025495985,192976.8576854,39318.916021239,7071351.6419481,7264328.4996335,275273.85825425,103528.67789506,7056891.3237557,7332165.1820099,374173.7454997,179011.11385643,7060000.1112522,7434173.8567519,12226931.171582,4433961.3918573,357830861.2212,370057792.39278 diff --git a/test/tests/neutronics/tallies/reaction_rates/materials.xml b/test/tests/neutronics/tallies/reaction_rates/materials.xml new file mode 100644 index 000000000..54d5c6a86 --- /dev/null +++ b/test/tests/neutronics/tallies/reaction_rates/materials.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/tests/neutronics/tallies/reaction_rates/openmc.i b/test/tests/neutronics/tallies/reaction_rates/openmc.i new file mode 100644 index 000000000..7397179eb --- /dev/null +++ b/test/tests/neutronics/tallies/reaction_rates/openmc.i @@ -0,0 +1,179 @@ +[Mesh] + [sphere] + type = FileMeshGenerator + file = ../../meshes/sphere.e + [] + [solid] + type = CombinerGenerator + inputs = sphere + positions = '0 0 0 + 0 0 4 + 0 0 8' + [] + [solid_ids] + type = SubdomainIDGenerator + input = solid + subdomain_id = '100' + [] + [fluid] + type = FileMeshGenerator + file = ../../heat_source/stoplight.exo + [] + [fluid_ids] + type = SubdomainIDGenerator + input = fluid + subdomain_id = '200' + [] + [combine] + type = CombinerGenerator + inputs = 'solid_ids fluid_ids' + [] +[] + +[Problem] + type = OpenMCCellAverageProblem + verbose = true + + source_strength = 1e6 + + temperature_blocks = '100 200' + density_blocks = '200' + cell_level = 0 + + initial_properties = xml + + [Tallies] + [Cell] + type = CellTally + score = 'absorption fission scatter total' + blocks = '100 200' + [] + [] +[] + +[Executioner] + type = Steady +[] + +[Postprocessors] + [total_abs] + type = ElementIntegralVariablePostprocessor + variable = absorption + [] + [fluid_abs] + type = PointValue + variable = absorption + point = '0.0 0.0 2.0' + [] + [pebble1_abs] + type = PointValue + variable = absorption + point = '0.0 0.0 0.0' + [] + [pebble2_abs] + type = PointValue + variable = absorption + point = '0.0 0.0 4.0' + [] + [pebble3_abs] + type = PointValue + variable = absorption + point = '0.0 0.0 8.0' + [] + [max_err_abs] + type = TallyRelativeError + tally_score = 'absorption' + [] + + [total_fis] + type = ElementIntegralVariablePostprocessor + variable = fission + [] + [fluid_fis] + type = PointValue + variable = fission + point = '0.0 0.0 2.0' + [] + [pebble1_fis] + type = PointValue + variable = fission + point = '0.0 0.0 0.0' + [] + [pebble2_fis] + type = PointValue + variable = fission + point = '0.0 0.0 4.0' + [] + [pebble3_fis] + type = PointValue + variable = fission + point = '0.0 0.0 8.0' + [] + [max_err_fis] + type = TallyRelativeError + tally_score = 'fission' + [] + + [total_sca] + type = ElementIntegralVariablePostprocessor + variable = scatter + [] + [fluid_sca] + type = PointValue + variable = scatter + point = '0.0 0.0 2.0' + [] + [pebble1_sca] + type = PointValue + variable = scatter + point = '0.0 0.0 0.0' + [] + [pebble2_sca] + type = PointValue + variable = scatter + point = '0.0 0.0 4.0' + [] + [pebble3_sca] + type = PointValue + variable = scatter + point = '0.0 0.0 8.0' + [] + [max_err_sca] + type = TallyRelativeError + tally_score = 'scatter' + [] + + [total_tot] + type = ElementIntegralVariablePostprocessor + variable = total + [] + [fluid_tot] + type = PointValue + variable = total + point = '0.0 0.0 2.0' + [] + [pebble1_tot] + type = PointValue + variable = total + point = '0.0 0.0 0.0' + [] + [pebble2_tot] + type = PointValue + variable = total + point = '0.0 0.0 4.0' + [] + [pebble3_tot] + type = PointValue + variable = total + point = '0.0 0.0 8.0' + [] + [max_err_tot] + type = TallyRelativeError + tally_score = 'total' + [] +[] + +[Outputs] + execute_on = final + csv = true +[] diff --git a/test/tests/neutronics/tallies/reaction_rates/settings.xml b/test/tests/neutronics/tallies/reaction_rates/settings.xml new file mode 100644 index 000000000..e95a187c8 --- /dev/null +++ b/test/tests/neutronics/tallies/reaction_rates/settings.xml @@ -0,0 +1,16 @@ + + + fixed source + 100 + 50 + 10 + + + -5.0 -5.0 0 5.0 5.0 12.0 + + + 600.0 + nearest + false + 294.0 1600.0 + diff --git a/test/tests/neutronics/tallies/reaction_rates/tests b/test/tests/neutronics/tallies/reaction_rates/tests new file mode 100644 index 000000000..37334e1a5 --- /dev/null +++ b/test/tests/neutronics/tallies/reaction_rates/tests @@ -0,0 +1,9 @@ +[Tests] + [reaction_rates] + type = CSVDiff + input = openmc.i + csvdiff = openmc_out.csv + requirement = "The system shall allow tallying of absorption/fission/scattering/total reaction rates in fixed source mode." + required_objects = 'OpenMCCellAverageProblem' + [] +[]